[gnome-control-center/mcatanzaro/distributor-logo: 1/2] info-overview: add build option to control distributor logo




commit 4369e31ec541172e1c0d7c64645c7990e413bbca
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue Mar 9 14:51:54 2021 -0600

    info-overview: add build option to control distributor logo
    
    Currently, we display a 256x256 version of the OS icon from
    /etc/os-release. This is too big for my taste, and it's also not
    sufficient for distros that want to display a logo that is not an icon.
    For instance, because we no longer display the operating system name
    immediately beneath the logo, it may be desirable to use a logo variant
    that includes text. This patch adds a meson build option that
    distributions can use to override the logo.
    
    Because the logo might include text, distributions may want to vary the
    logo used in dark mode. A subsequent commit will add a second option for
    this.

 meson.build                                   | 6 ++++++
 meson_options.txt                             | 1 +
 panels/info-overview/cc-info-overview-panel.c | 4 ++++
 3 files changed, 11 insertions(+)
---
diff --git a/meson.build b/meson.build
index e8333c0da..1661caa4b 100644
--- a/meson.build
+++ b/meson.build
@@ -50,6 +50,12 @@ 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')
+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 1b7b54810..93e551373 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -8,3 +8,4 @@ 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')
diff --git a/panels/info-overview/cc-info-overview-panel.c b/panels/info-overview/cc-info-overview-panel.c
index bd0e07762..95a5904df 100644
--- a/panels/info-overview/cc-info-overview-panel.c
+++ b/panels/info-overview/cc-info-overview-panel.c
@@ -869,6 +869,9 @@ cc_info_panel_row_activated_cb (CcInfoOverviewPanel *self,
 static void
 setup_os_logo (CcInfoOverviewPanel *panel)
 {
+#ifdef DISTRIBUTOR_LOGO
+  gtk_image_set_from_file (panel->os_logo, DISTRIBUTOR_LOGO);
+#else
   g_autofree char *logo_name = g_get_os_info ("LOGO");
   if (logo_name != NULL)
     {
@@ -879,6 +882,7 @@ setup_os_logo (CcInfoOverviewPanel *panel)
     {
       gtk_image_set_from_resource (panel->os_logo, 
"/org/gnome/control-center/info-overview/GnomeLogoVerticalMedium.svg");
     }
+#endif
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]