diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2021-03-09 16:02:46 -0600 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@redhat.com> | 2021-09-08 16:02:11 -0500 |
commit | 515440221961f2244d42a1ab479f1129c674130f (patch) | |
tree | 5138e68241b94bbaceb6e33b04517507f7e2deb7 /panels/info-overview/cc-info-overview-panel.c | |
parent | 763cde56be06ce352f41adcdc1c6756f17043f5d (diff) | |
download | gnome-control-center-mcatanzaro/distributor-logo.tar.gz |
info-overview: add build option to specify a dark mode logo variantmcatanzaro/distributor-logo
Let's allow distributions to specify a different logo to use when using
a dark GTK theme. This is best-effort only since it relies on the
convention that dark themes must end with "dark" and therefore will fail
for a theme named "midnight" or anything that doesn't match convention.
Diffstat (limited to 'panels/info-overview/cc-info-overview-panel.c')
-rw-r--r-- | panels/info-overview/cc-info-overview-panel.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c index 3db143d80..e3af78894 100644 --- a/panels/info-overview/cc-info-overview-panel.c +++ b/panels/info-overview/cc-info-overview-panel.c @@ -880,6 +880,7 @@ cc_info_panel_row_activated_cb (CcInfoOverviewPanel *self, open_software_update (self); } +#if !defined(DISTRIBUTOR_LOGO) || defined(DARK_MODE_DISTRIBUTOR_LOGO) static gboolean use_dark_theme (CcInfoOverviewPanel *panel) { @@ -897,11 +898,19 @@ use_dark_theme (CcInfoOverviewPanel *panel) g_object_get (settings, "gtk-theme-name", &theme_name, NULL); return (theme_name != NULL && g_str_has_suffix (theme_name, "dark")) ? TRUE : FALSE; } +#endif static void setup_os_logo (CcInfoOverviewPanel *panel) { #ifdef DISTRIBUTOR_LOGO +#ifdef DARK_MODE_DISTRIBUTOR_LOGO + if (use_dark_theme (panel)) + { + gtk_image_set_from_file (panel->os_logo, DARK_MODE_DISTRIBUTOR_LOGO); + return; + } +#endif gtk_image_set_from_file (panel->os_logo, DISTRIBUTOR_LOGO); #else g_autofree char *logo_name = g_get_os_info ("LOGO"); |