[gnome-tour] carousel: display one page at a time
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tour] carousel: display one page at a time
- Date: Tue, 14 Jul 2020 01:52:20 +0000 (UTC)
commit 17c3b811abf7142646ac09070dc62a577e7f887e
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Sun Jul 12 02:14:58 2020 +0200
carousel: display one page at a time
src/widgets/pages/image.rs | 1 +
src/widgets/pages/welcome.rs | 9 ++++++---
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/widgets/pages/image.rs b/src/widgets/pages/image.rs
index 8905a62..92bae44 100644
--- a/src/widgets/pages/image.rs
+++ b/src/widgets/pages/image.rs
@@ -44,6 +44,7 @@ impl ImagePageWidget {
}
fn init(&self) {
+ self.widget.set_property_expand(true);
self.widget.set_halign(gtk::Align::Fill);
self.widget.set_valign(gtk::Align::Fill);
diff --git a/src/widgets/pages/welcome.rs b/src/widgets/pages/welcome.rs
index e0636a5..76529d7 100644
--- a/src/widgets/pages/welcome.rs
+++ b/src/widgets/pages/welcome.rs
@@ -4,13 +4,14 @@ use libhandy::prelude::HeaderBarExt;
pub struct WelcomePageWidget {
pub widget: gtk::Box,
+ handle: libhandy::WindowHandle,
}
impl WelcomePageWidget {
pub fn new() -> Self {
let widget = gtk::Box::new(gtk::Orientation::Vertical, 0);
-
- let welcome_page = Self { widget };
+ let handle = libhandy::WindowHandle::new();
+ let welcome_page = Self { widget, handle };
welcome_page.init();
welcome_page
@@ -71,7 +72,9 @@ impl WelcomePageWidget {
headerbar.set_show_close_button(true);
headerbar.set_title(Some(&gettext("Welcome Tour")));
- self.widget.add(&headerbar);
+ self.handle.add(&headerbar);
+
+ self.widget.add(&self.handle);
self.widget.add(&container);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]