Kaydet (Commit) 75544eb0 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: tdf#102778 by default use breeze_dark when dark themes are requested

Under gtk3 if gtk-application-prefer-dark-theme is enabled or the requested
icon-theme name ends in [-|_]dark

Change-Id: Ia70ea3adc51ac0ec2b26d08fc960c1c7285c338b
üst 42e89217
......@@ -82,6 +82,10 @@ IconThemeSelector::SelectIconThemeForDesktopEnvironment(
if (icon_theme_is_in_installed_themes(mPreferredIconTheme, installedThemes)) {
return mPreferredIconTheme;
}
//if a dark variant is preferred, and we didn't have an exact match, then try our one and only dark theme
if (mPreferredIconTheme.endsWith("_dark") && icon_theme_is_in_installed_themes("breeze_dark", installedThemes)) {
return "breeze_dark";
}
}
OUString themeForDesktop = GetIconThemeForDesktopEnvironment(desktopEnvironment);
......
......@@ -2719,8 +2719,19 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
// preferred icon style
gchar* pIconThemeName = nullptr;
g_object_get( pSettings, "gtk-icon-theme-name", &pIconThemeName, nullptr );
aStyleSet.SetPreferredIconTheme( OUString::createFromAscii( pIconThemeName ) );
gboolean bDarkIconTheme = false;
g_object_get(pSettings, "gtk-icon-theme-name", &pIconThemeName,
"gtk-application-prefer-dark-theme", &bDarkIconTheme,
nullptr );
OUString sIconThemeName(OUString::createFromAscii(pIconThemeName));
if (sIconThemeName.endsWithIgnoreAsciiCase("-dark", &sIconThemeName) ||
sIconThemeName.endsWithIgnoreAsciiCase("_dark", &sIconThemeName))
{
bDarkIconTheme = true;
}
if (bDarkIconTheme)
sIconThemeName += "_dark";
aStyleSet.SetPreferredIconTheme(sIconThemeName);
g_free( pIconThemeName );
aStyleSet.SetToolbarIconSize( ToolbarIconSize::Large );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment