summaryrefslogtreecommitdiff
path: root/src/ui/labelwidget.c
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/labelwidget.c
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/labelwidget.c')
-rw-r--r--src/ui/labelwidget.c12
1 files changed, 11 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