Commit d508815f authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Allow distro to rebrand the app

parent ced7cc54
# GNOME Greeter & Tour
#### Note for distributions:
You can customize the distribution name, version and the displayed icon using the config options
```
-Ddistro_name=Fedora -Ddistro_version=3.32 -Ddistro_icon_name=fedora-logo
```
......@@ -7,7 +7,7 @@
<name>GNOME Tour</name>
<summary>GNOME Tour and Greeter.</summary>
<description>
<p>A guided tour & greeter for GNOME.</p>
<p>A guided tour and greeter for GNOME.</p>
</description>
<screenshots>
<screenshot type="default">
......
......@@ -8,3 +8,24 @@ option (
value: 'default',
description: 'The build profile for GNOME Tour. One of "default" or "development".'
)
option (
'distro_name',
type: 'string',
value: 'GNOME',
description: 'Distro name, used for branding.'
)
option (
'distro_icon_name',
type: 'string',
value: 'start-here-symbolic',
description: 'Distro icon name, used for branding.'
)
option (
'distro_version',
type: 'string',
value: '3.36',
description: 'Distro version, used for branding.'
)
......@@ -5,3 +5,6 @@ pub static NAME_SUFFIX: &'static str = @NAME_SUFFIX@;
pub static VERSION: &'static str = @VERSION@;
pub static GETTEXT_PACKAGE: &'static str = @GETTEXT_PACKAGE@;
pub static LOCALEDIR: &'static str = @LOCALEDIR@;
pub static DISTRO_NAME: &'static str = @DISTRO_NAME@;
pub static DISTRO_VERSION: &'static str = @DISTRO_VERSION@;
pub static DISTRO_ICON_NAME: &'static str = @DISTRO_ICON_NAME@;
......@@ -6,6 +6,9 @@ global_conf.set_quoted('NAME_SUFFIX', name_suffix)
global_conf.set_quoted('VERSION', version + version_suffix)
global_conf.set_quoted('GETTEXT_PACKAGE', gettext_package)
global_conf.set_quoted('LOCALEDIR', localedir)
global_conf.set_quoted('DISTRO_NAME', get_option('distro_name'))
global_conf.set_quoted('DISTRO_VERSION', get_option('distro_version'))
global_conf.set_quoted('DISTRO_ICON_NAME', get_option('distro_icon_name'))
config = configure_file(
input: 'config.rs.in',
output: 'config.rs',
......
use crate::config;
use gettextrs::gettext;
use gtk::prelude::*;
......@@ -21,11 +22,11 @@ impl WelcomePageWidget {
self.widget.set_margin_top(24);
self.widget.set_margin_bottom(24);
let logo = gtk::Image::new_from_icon_name(Some("start-here-symbolic"));
let logo = gtk::Image::new_from_icon_name(Some(config::DISTRO_ICON_NAME));
logo.set_pixel_size(196);
self.widget.add(&logo);
let title = gtk::Label::new(Some(&gettext("Welcome to GNOME 3.34")));
let title = gtk::Label::new(Some(&gettext(format!("Welcome to {} {}", config::DISTRO_NAME, config::DISTRO_VERSION))));
title.set_margin_top(36);
title.get_style_context().add_class("large-title");
self.widget.add(&title);
......
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