diff --git a/meson.build b/meson.build index 59982b4e26c608244237fcd2bb59029e255e399d..2d661658f21fa98bf8186496e29854c9a999c9a9 100644 --- a/meson.build +++ b/meson.build @@ -50,6 +50,17 @@ foreach define: set_defines config_h.set_quoted(define[0], define[1]) endforeach +distributor_logo = get_option('distributor_logo') +if (distributor_logo != '') + config_h.set_quoted('DISTRIBUTOR_LOGO', distributor_logo, + description: 'Define to absolute path of distributor logo') + dark_mode_distributor_logo = get_option('dark_mode_distributor_logo') + if (dark_mode_distributor_logo != '') + config_h.set_quoted('DARK_MODE_DISTRIBUTOR_LOGO', dark_mode_distributor_logo, + description: 'Define to absolute path of distributor logo for use in dark mode') + endif +endif + # meson does not support octal values, so it must be handled as a # string. See: https://github.com/mesonbuild/meson/issues/2047 config_h.set('USER_DIR_MODE', '0700', diff --git a/meson_options.txt b/meson_options.txt index dbca7238769a922d405b036f3d8cb4625039879b..461ae34e72c6c9d2492e018f4ce96ef443ca7d84 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,3 +7,5 @@ option('tracing', type: 'boolean', value: false, description: 'add extra debuggi option('wayland', type: 'boolean', value: true, description: 'build with Wayland support') option('profile', type: 'combo', choices: ['default','development'], value: 'default') option('malcontent', type: 'boolean', value: false, description: 'build with malcontent support') +option('distributor_logo', type: 'string', description: 'absolute path to distributor logo for the About panel') +option('dark_mode_distributor_logo', type: 'string', description: 'absolute path to distributor logo dark mode variant') diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c index 78173c6e7196c9b758d5a6a94befb7cb7724a587..acb7884f2184e61f61c61105ad36e1ce641c1036 100644 --- a/panels/info-overview/cc-info-overview-panel.c +++ b/panels/info-overview/cc-info-overview-panel.c @@ -879,6 +879,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) { @@ -886,10 +887,22 @@ use_dark_theme (CcInfoOverviewPanel *panel) return adw_style_manager_get_dark (style_manager); } +#endif static void setup_os_logo (CcInfoOverviewPanel *panel) { +#ifdef DISTRIBUTOR_LOGO +#ifdef DARK_MODE_DISTRIBUTOR_LOGO + if (use_dark_theme (panel)) + { + gtk_picture_set_filename (panel->os_logo, DARK_MODE_DISTRIBUTOR_LOGO); + return; + } +#endif + gtk_picture_set_filename (panel->os_logo, DISTRIBUTOR_LOGO); + return; +#else GtkIconTheme *icon_theme; g_autofree char *logo_name = g_get_os_info ("LOGO"); g_autoptr(GtkIconPaintable) icon_paintable = NULL; @@ -917,6 +930,7 @@ setup_os_logo (CcInfoOverviewPanel *panel) gtk_widget_get_direction (GTK_WIDGET (panel)), 0); gtk_picture_set_paintable (panel->os_logo, GDK_PAINTABLE (icon_paintable)); +#endif } static void