summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-17 14:31:12 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-17 14:31:12 +0200
commit3b553dd49d8f9adeda125ee6cc13f923611d308b (patch)
tree4cbc45f17c89f0d6b58131a0bff2f99b3aa9f3da /src/ui
parent95cf0209c6a2357788167e01cc8eca2215244f36 (diff)
Tab button coloring with colored backgrounds
It's best to match the active tab button color to the document's background in case the latter is colored.
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/labelwidget.c12
-rw-r--r--src/ui/root.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/src/ui/labelwidget.c b/src/ui/labelwidget.c
index 3454014a..75cbbf3a 100644
--- a/src/ui/labelwidget.c
+++ b/src/ui/labelwidget.c
@@ -231,7 +231,17 @@ static void getColors_LabelWidget_(const iLabelWidget *d, int *bg, int *fg, int
231 *bg = uiBackgroundUnfocusedSelection_ColorId; 231 *bg = uiBackgroundUnfocusedSelection_ColorId;
232 } 232 }
233 else { 233 else {
234 *bg = uiBackgroundSelected_ColorId; 234 const enum iGmDocumentTheme docTheme = docTheme_Prefs(prefs_App());
235 if ((docTheme == colorfulLight_GmDocumentTheme || docTheme == sepia_GmDocumentTheme) &&
236 !cmp_String(&d->widget.parent->id, "tabs.buttons")) {
237 *bg = (docTheme == sepia_GmDocumentTheme &&
238 colorTheme_App() == pureWhite_ColorTheme
239 ? tmBackground_ColorId
240 : tmBannerBackground_ColorId);
241 }
242 else {
243 *bg = uiBackgroundSelected_ColorId;
244 }
235 } 245 }
236 if (!isKeyRoot) { 246 if (!isKeyRoot) {
237 *bg = isDark_ColorTheme(colorTheme_App()) ? uiBackgroundUnfocusedSelection_ColorId 247 *bg = isDark_ColorTheme(colorTheme_App()) ? uiBackgroundUnfocusedSelection_ColorId
diff --git a/src/ui/root.c b/src/ui/root.c
index 6e187313..eeb5956f 100644
--- a/src/ui/root.c
+++ b/src/ui/root.c
@@ -1059,6 +1059,8 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
1059 updateNavBarIdentity_(navBar); 1059 updateNavBarIdentity_(navBar);
1060 } 1060 }
1061 setFocus_Widget(NULL); 1061 setFocus_Widget(NULL);
1062 makePaletteGlobal_GmDocument(document_DocumentWidget(doc));
1063 refresh_Widget(findWidget_Root("doctabs"));
1062 } 1064 }
1063 else if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) { 1065 else if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) {
1064 iWidget *widget = pointer_Command(cmd); 1066 iWidget *widget = pointer_Command(cmd);