Commit dafeeb0a authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui

Merge branch 'wip/jimmac/final-page' into 'master'

Last page: illustration Closes #7 See merge request GNOME/gnome-tour!6
parents 00fbfafe 6bb73835
......@@ -7,6 +7,6 @@
<file compressed="true" alias="search.svg">resources/assets/search.svg</file>
<file compressed="true" alias="software.svg">resources/assets/software.svg</file>
<file compressed="true" alias="status-menu.svg">resources/assets/status-menu.svg</file>
<file compressed="true" alias="help.svg">resources/assets/help.svg</file>
<file compressed="true" alias="ready-to-go.svg">resources/assets/ready-to-go.svg</file>
</gresource>
</gresources>
......@@ -11,3 +11,11 @@
font-weight: 400;
font-size: 12pt;
}
.last-page {
background-color: #4a86cf; /*GNOME blue*/
}
.last-page .page-title, .last-page .page-body {
color: white;
}
......@@ -29,7 +29,7 @@ impl Pageable for ImagePageWidget {
impl ImagePageWidget {
pub fn new(resource_uri: &str, title: String, head: String, body: String) -> Self {
let widget = gtk::Box::new(gtk::Orientation::Vertical, 12);
let widget = gtk::Box::new(gtk::Orientation::Vertical, 0);
let image_page = Self {
widget,
......@@ -44,21 +44,24 @@ impl ImagePageWidget {
}
fn init(&self) {
self.widget.set_halign(gtk::Align::Center);
self.widget.set_valign(gtk::Align::Center);
self.widget.set_property_margin(48);
self.widget.set_halign(gtk::Align::Fill);
self.widget.set_valign(gtk::Align::Fill);
let container = gtk::Box::new(gtk::Orientation::Vertical, 12);
container.set_halign(gtk::Align::Center);
container.set_valign(gtk::Align::Center);
container.set_property_margin(48);
let image = gtk::Picture::new_for_resource(Some(&self.resource_uri));
image.set_valign(gtk::Align::Start);
self.widget.add(&image);
container.add(&image);
let head_label = gtk::Label::new(Some(&self.get_head()));
head_label.set_justify(gtk::Justification::Center);
head_label.set_valign(gtk::Align::Center);
head_label.set_margin_top(36);
head_label.get_style_context().add_class("page-title");
self.widget.add(&head_label);
container.add(&head_label);
let body_label = gtk::Label::new(Some(&self.get_body()));
body_label.set_lines(2);
......@@ -67,6 +70,8 @@ impl ImagePageWidget {
body_label.set_valign(gtk::Align::Center);
body_label.get_style_context().add_class("page-body");
body_label.set_margin_top(12);
self.widget.add(&body_label);
container.add(&body_label);
self.widget.add(&container);
}
}
......@@ -123,12 +123,14 @@ impl Window {
gettext("The Software app makese it easy to find and install all the apps you need."),
)));
self.paginator.add_page(Box::new(ImagePageWidget::new(
"/org/gnome/Tour/help.svg",
let last_page = ImagePageWidget::new(
"/org/gnome/Tour/ready-to-go.svg",
gettext("Learn More"),
gettext("That's it! To learn more, see the Help"),
gettext("The help app contains information, tips and tricks."),
)));
);
last_page.widget.get_style_context().add_class("last-page");
self.paginator.add_page(Box::new(last_page));
self.container.add_named(&self.paginator.widget, "pages");
self.widget.add(&self.container);
......
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