summaryrefslogtreecommitdiff
path: root/src/ui/root.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-20 12:53:12 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-20 12:53:12 +0200
commit6d7b6122e68c8d53b6e7533a6e5d5f55e33831e1 (patch)
tree80bc2867510e3c9b7bc43578fc416165dae3876c /src/ui/root.c
parent2d52f13afb15232cc9c834f0aa14284bf9072a31 (diff)
parent41f378c4b46cb5dd3599d44c81fa51d3183eefee (diff)
Merge branch 'work/v1.11' into dev
# Conflicts: # res/lang/es.bin # res/lang/ie.bin # res/lang/ru.bin # res/lang/sr.bin # res/lang/uk.bin
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}