summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-29 07:58:12 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-29 07:58:12 +0300
commitde2dd81306da54b0bfdd9b075dc5de90c871b9af (patch)
tree0ebba8936496ead6e3441570a6e4e7002f2da1b4 /src/ui/util.c
parent87b5dbd9c0393e787d2499d796486d3293f17214 (diff)
Working on multiple UI roots
Restore previous root after processing events. Adjusted colors of the non-focused root.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 9a023ab9..a1d76709 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -922,8 +922,19 @@ static iBool tabSwitcher_(iWidget *tabs, const char *cmd) {
922 if (isVisible_Widget(child)) break; 922 if (isVisible_Widget(child)) break;
923 tabIndex++; 923 tabIndex++;
924 } 924 }
925 tabIndex += (equal_Command(cmd, "tabs.next") ? +1 : -1); 925 const int dir = (equal_Command(cmd, "tabs.next") ? +1 : -1);
926 showTabPage_Widget(tabs, child_Widget(pages, iWrap(tabIndex, 0, childCount_Widget(pages)))); 926 /* If out of tabs, rotate to the next set of tabs if one is available. */
927 if ((tabIndex == 0 && dir < 0) || (tabIndex == childCount_Widget(pages) - 1 && dir > 0)) {
928 iWidget *nextTabs = findChild_Widget(otherRoot_Window(get_Window(), tabs->root)->widget,
929 "doctabs");
930 iWidget *nextPages = findChild_Widget(nextTabs, "tabs.pages");
931 tabIndex = (dir < 0 ? childCount_Widget(nextPages) - 1 : 0);
932 showTabPage_Widget(nextTabs, child_Widget(nextPages, tabIndex));
933 postCommand_App("keyroot.next");
934 }
935 else {
936 showTabPage_Widget(tabs, child_Widget(pages, tabIndex + dir));
937 }
927 refresh_Widget(tabs); 938 refresh_Widget(tabs);
928 return iTrue; 939 return iTrue;
929 } 940 }