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.
This commit is contained in:
Jehan 2024-01-31 14:37:57 +01:00
parent f9a75fbe80
commit 87a3073b04
6 changed files with 24 additions and 34 deletions

View file

@ -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)

View file

@ -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;
}

View file

@ -1,4 +0,0 @@
/* Dark variant for the Compact theme for GIMP 3.0 */
@import url("../Default/gimp-dark.css");
@import url("compact.css");

View file

@ -1,4 +0,0 @@
/* Light variant for the Compact theme for GIMP 3.0 */
@import url("../Default/gimp.css");
@import url("compact.css");

View file

@ -1,3 +0,0 @@
install_data([ 'gimp.css', 'gimp-dark.css', 'compact.css' ],
install_dir: gimpdatadir / 'themes' / 'Compact')

View file

@ -1,6 +1,5 @@
subdir('Default')
subdir('Darker')
subdir('Compact')
themes = [
'System',