summaryrefslogtreecommitdiff
path: root/src/ui/root.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/root.c')
-rw-r--r--src/ui/root.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ui/root.c b/src/ui/root.c
index 6e187313..9dee50ae 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -56,7 +56,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
56#if defined (iPlatformPcDesktop) 56#if defined (iPlatformPcDesktop)
57/* TODO: Submenus wouldn't hurt here. */ 57/* TODO: Submenus wouldn't hurt here. */
58static const iMenuItem navMenuItems_[] = { 58static const iMenuItem navMenuItems_[] = {
59 { add_Icon " ${menu.newtab}", 't', KMOD_PRIMARY, "tabs.new" }, 59 { openWindow_Icon " ${menu.newwindow}", SDLK_n, KMOD_PRIMARY, "window.new" },
60 { add_Icon " ${menu.newtab}", SDLK_t, KMOD_PRIMARY, "tabs.new" },
60 { "${menu.openlocation}", SDLK_l, KMOD_PRIMARY, "navigate.focus" }, 61 { "${menu.openlocation}", SDLK_l, KMOD_PRIMARY, "navigate.focus" },
61 { "---" }, 62 { "---" },
62 { download_Icon " " saveToDownloads_Label, SDLK_s, KMOD_PRIMARY, "document.save" }, 63 { download_Icon " " saveToDownloads_Label, SDLK_s, KMOD_PRIMARY, "document.save" },
@@ -468,6 +469,10 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) {
468 return iFalse; 469 return iFalse;
469 } 470 }
470 else if (equal_Command(cmd, "window.setrect")) { 471 else if (equal_Command(cmd, "window.setrect")) {
472 if (hasLabel_Command(cmd, "index") &&
473 argU32Label_Command(cmd, "index") != windowIndex_Root(root->root)) {
474 return iFalse;
475 }
471 const int snap = argLabel_Command(cmd, "snap"); 476 const int snap = argLabel_Command(cmd, "snap");
472 if (snap) { 477 if (snap) {
473 iMainWindow *window = get_MainWindow(); 478 iMainWindow *window = get_MainWindow();
@@ -1059,6 +1064,8 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
1059 updateNavBarIdentity_(navBar); 1064 updateNavBarIdentity_(navBar);
1060 } 1065 }
1061 setFocus_Widget(NULL); 1066 setFocus_Widget(NULL);
1067 makePaletteGlobal_GmDocument(document_DocumentWidget(doc));
1068 refresh_Widget(findWidget_Root("doctabs"));
1062 } 1069 }
1063 else if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) { 1070 else if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) {
1064 iWidget *widget = pointer_Command(cmd); 1071 iWidget *widget = pointer_Command(cmd);
@@ -1774,6 +1781,13 @@ void showToolbar_Root(iRoot *d, iBool show) {
1774 } 1781 }
1775} 1782}
1776 1783
1784size_t windowIndex_Root(const iRoot *d) {
1785 if (type_Window(d->window) == main_WindowType) {
1786 return windowIndex_App(as_MainWindow(d->window));
1787 }
1788 return iInvalidPos;
1789}
1790
1777iInt2 size_Root(const iRoot *d) { 1791iInt2 size_Root(const iRoot *d) {
1778 return d && d->widget ? d->widget->rect.size : zero_I2(); 1792 return d && d->widget ? d->widget->rect.size : zero_I2();
1779} 1793}