vcl/unx/gtk3/custom-theme.cxx | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-)
New commits: commit 2ebefc61f48b13456de7b45597e64ca5f4d9f729 Author: Sahil Gautam <sahil.gautam.ext...@allotropia.de> AuthorDate: Tue Feb 11 00:46:34 2025 +0530 Commit: Sahil Gautam <sahil.gautam.ext...@allotropia.de> CommitDate: Tue Feb 11 10:55:46 2025 +0100 tdf#164969 fix widget theming/styling in gtk - when using automatic theme, and when theming is enabled, if everything is set to automatic, then the application shouldn't have any visual changes. - use close button color from libadwaita specification, that's the closest we can get to the defaults without defining a "close button color" variable under theme colors. - remove border from the notebook headers, change the color/style to match the default look without any theming. Change-Id: Ib0143ccc681b4f0f5863be028a32af32d9631917 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181381 Reviewed-by: Sahil Gautam <sahil.gautam.ext...@allotropia.de> Tested-by: Jenkins diff --git a/vcl/unx/gtk3/custom-theme.cxx b/vcl/unx/gtk3/custom-theme.cxx index 71bb0ec843b8..b22bb0fe4439 100644 --- a/vcl/unx/gtk3/custom-theme.cxx +++ b/vcl/unx/gtk3/custom-theme.cxx @@ -125,11 +125,18 @@ OString CreateStyleString() Color aSpinBack = aThemeColors.GetBaseColor(); aSpinBack.SetAlpha(20); - Color aPressedColor = ThemeColors::GetThemeColors().GetWindowColor(); + Color aPressedColor = ThemeColors::GetThemeColors().GetBaseColor(); + Color aNotebookBorderColor = aPressedColor; if (aPressedColor.IsDark()) - aPressedColor.IncreaseLuminance(30); + { + aPressedColor.DecreaseLuminance(5); + aNotebookBorderColor.DecreaseLuminance(20); + } else - aPressedColor.DecreaseLuminance(30); + { + aPressedColor.IncreaseLuminance(5); + aNotebookBorderColor.IncreaseLuminance(20); + } // clang-format off OUString aStr = @@ -295,25 +302,30 @@ OString CreateStyleString() *************/ "tabbox > tab:hover," + "notebook > header tab:checked:hover," "notebook > header tab:hover {" - " background-color: #" + aPressedColor.AsRGBHexString() + ";" - " border: 1px solid #" + aThemeColors.GetSeparatorColor().AsRGBHexString() + ";" + " background-color: #" + ThemeColors::GetThemeColors().GetBaseColor().AsRGBHexString() + ";" " color: #" + aThemeColors.GetWindowTextColor().AsRGBHexString() + ";" "}" "tabbox > tab:checked, notebook > header tab:checked {" " background-color: #" + aPressedColor.AsRGBHexString() + ";" - " border: 1px solid #" + aThemeColors.GetSeparatorColor().AsRGBHexString() + ";" + " color: #" + aThemeColors.GetWindowTextColor().AsRGBHexString() + ";" + "}" + + "tabbox > tab, notebook > header tab {" " color: #" + aThemeColors.GetWindowTextColor().AsRGBHexString() + ";" "}" "notebook {" " background-color: #" + aThemeColors.GetWindowColor().AsRGBHexString() + ";" + " color: #" + aThemeColors.GetWindowTextColor().AsRGBHexString() + ";" "}" "notebook > header {" - " background-color: #" + aThemeColors.GetBaseColor().AsRGBHexString() + ";" - " border-color: #" + aThemeColors.GetBaseColor().AsRGBHexString() + ";" + " background-color: #" + aPressedColor.AsRGBHexString() + ";" + " border-color: #" + aNotebookBorderColor.AsRGBHexString() + ";" + " color: #" + aThemeColors.GetWindowTextColor().AsRGBHexString() + ";" "}" "notebook > stack:not(:only-child) {" @@ -522,7 +534,6 @@ OString CreateStyleString() "}" "button.combo:only-child:disabled {" - " box-shadow: 0 0 0 2px transparent;" " background-color: #" + aThemeColors.GetDisabledColor().AsRGBHexString() + ";" " color: #" + aThemeColors.GetInactiveTextColor().AsRGBHexString() + ";" "}" @@ -595,9 +606,11 @@ OString CreateStyleString() " text-shadow: none;" "}" + // use default destructive color value as per libadwaita named-colors.html + // https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/named-colors.html "button.destructive-action:not(:disabled) {" - " background-color: #f38ba8;" - " color: #" + aThemeColors.GetButtonTextColor().AsRGBHexString() + ";" + " background-color: #c01c28;" + " color: #ffffff;" "}" ".view:selected {"