From 87a3073b041a1155c33813e1350fae45023059d6 Mon Sep 17 00:00:00 2001 From: Jehan Date: Wed, 31 Jan 2024 14:37:57 +0100 Subject: [PATCH] app, themes: get rid of Compact theme and move its logic into code. The Compact theme code is nearly the same as the Default one, apart from setting palette icon size to small (which is already something done by the "Override icon sizes" setting in Preferences), setting font-size to small (which can be independently set by our "Font Scaling" setting) and setting 3 paddings. Rather than having this separate theme, it feels like just moving the padding changes as part of the icon size makes sense. In particular since, when setting icons to "Small" right now, the default padding really feels a bit huge and out of place. So all-in-one seems a better choice. At first, I wanted to set a padding proportional to the icon size, but it didn't work well. For now, I'll just choose padding sizes manually. --- app/gui/themes.c | 28 ++++++++++++++++++++++++---- themes/Compact/compact.css | 18 ------------------ themes/Compact/gimp-dark.css | 4 ---- themes/Compact/gimp.css | 4 ---- themes/Compact/meson.build | 3 --- themes/meson.build | 1 - 6 files changed, 24 insertions(+), 34 deletions(-) delete mode 100644 themes/Compact/compact.css delete mode 100644 themes/Compact/gimp-dark.css delete mode 100644 themes/Compact/gimp.css delete mode 100644 themes/Compact/meson.build diff --git a/app/gui/themes.c b/app/gui/themes.c index 6e1befbe62..d42a5f4d5d 100644 --- a/app/gui/themes.c +++ b/app/gui/themes.c @@ -433,6 +433,9 @@ themes_apply_theme (Gimp *gimp, const gchar *tool_icon_size = "large-toolbar"; const gchar *tab_icon_size = "small-toolbar"; const gchar *button_icon_size = "small-toolbar"; + gint pal_padding = 4; + gint tab_padding = 1; + gint sep_padding = 1; switch (config->custom_icon_size) { @@ -440,21 +443,33 @@ themes_apply_theme (Gimp *gimp, tool_icon_size = "small-toolbar"; tab_icon_size = "small-toolbar"; button_icon_size = "small-toolbar"; + pal_padding = 1; + tab_padding = 0; + sep_padding = 1; break; case GIMP_ICON_SIZE_MEDIUM: tool_icon_size = "large-toolbar"; tab_icon_size = "small-toolbar"; button_icon_size = "small-toolbar"; + pal_padding = 4; + tab_padding = 1; + sep_padding = 1; break; case GIMP_ICON_SIZE_LARGE: tool_icon_size = "dnd"; tab_icon_size = "large-toolbar"; button_icon_size = "large-toolbar"; + pal_padding = 5; + tab_padding = 5; + sep_padding = 2; break; case GIMP_ICON_SIZE_HUGE: tool_icon_size = "dialog"; tab_icon_size = "dnd"; button_icon_size = "dnd"; + pal_padding = 5; + tab_padding = 8; + sep_padding = 4; break; } @@ -465,10 +480,15 @@ themes_apply_theme (Gimp *gimp, "\n" "* { -GimpDockbook-tab-icon-size: %s; }" "\n" - "* { -GimpEditor-button-icon-size: %s; }", - tool_icon_size, - tab_icon_size, - button_icon_size); + "* { -GimpEditor-button-icon-size: %s; }" + "\n" + "toolpalette button { padding: %dpx; }" + "\n" + "button, tab { padding: %dpx; }" + "\n" + "paned separator { padding: %dpx; }", + tool_icon_size, tab_icon_size, button_icon_size, + pal_padding, tab_padding, sep_padding); } if (! error && config->font_relative_size != 1.0) diff --git a/themes/Compact/compact.css b/themes/Compact/compact.css deleted file mode 100644 index 4456c60f2e..0000000000 --- a/themes/Compact/compact.css +++ /dev/null @@ -1,18 +0,0 @@ -/* Set of common styles for the Compact theme for GIMP 3.0 */ - -* { - -GimpToolPalette-tool-icon-size: small-toolbar; - font-size: small; -} - -toolpalette button { - padding: 0px; -} - -button, tab { - padding: 0px; -} - -paned separator { - padding: 1px; -} diff --git a/themes/Compact/gimp-dark.css b/themes/Compact/gimp-dark.css deleted file mode 100644 index 9e271dd887..0000000000 --- a/themes/Compact/gimp-dark.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Dark variant for the Compact theme for GIMP 3.0 */ - -@import url("../Default/gimp-dark.css"); -@import url("compact.css"); diff --git a/themes/Compact/gimp.css b/themes/Compact/gimp.css deleted file mode 100644 index 502cfec9c2..0000000000 --- a/themes/Compact/gimp.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Light variant for the Compact theme for GIMP 3.0 */ - -@import url("../Default/gimp.css"); -@import url("compact.css"); diff --git a/themes/Compact/meson.build b/themes/Compact/meson.build deleted file mode 100644 index 96cd3a40d0..0000000000 --- a/themes/Compact/meson.build +++ /dev/null @@ -1,3 +0,0 @@ -install_data([ 'gimp.css', 'gimp-dark.css', 'compact.css' ], - install_dir: gimpdatadir / 'themes' / 'Compact') - diff --git a/themes/meson.build b/themes/meson.build index 3fd57c6a5f..2b14fb78ba 100644 --- a/themes/meson.build +++ b/themes/meson.build @@ -1,6 +1,5 @@ subdir('Default') subdir('Darker') -subdir('Compact') themes = [ 'System',