[gnome-usage] window: Add a HdyViewSwitcherBar
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] window: Add a HdyViewSwitcherBar
- Date: Wed, 24 Jun 2020 13:09:58 +0000 (UTC)
commit a875690439c129393a858a48bcbdbd4c523c47da
Author: Adrien Plazas <kekun plazas laposte net>
Date: Tue Sep 10 19:19:52 2019 +0200
window: Add a HdyViewSwitcherBar
This will be used to present the main pages when the view switcher
doesn't fit in the header bar.
src/window.vala | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/src/window.vala b/src/window.vala
index d36b012..338eb29 100644
--- a/src/window.vala
+++ b/src/window.vala
@@ -29,6 +29,7 @@ namespace Usage
public class Window : Gtk.ApplicationWindow
{
private Usage.HeaderBar header_bar;
+ private Hdy.ViewSwitcherBar viewswitcher_bar;
private View[] views;
public Window(Gtk.Application application)
@@ -52,8 +53,12 @@ namespace Usage
var stack = new Gtk.Stack();
stack.visible = true;
+ stack.vexpand = true;
header_bar = new Usage.HeaderBar(stack);
set_titlebar(header_bar);
+ viewswitcher_bar = new Hdy.ViewSwitcherBar();
+ viewswitcher_bar.visible = true;
+ viewswitcher_bar.stack = stack;
views = new View[]
{
@@ -75,7 +80,11 @@ namespace Usage
}
});
- this.add(stack);
+ var box = new Gtk.Box(Gtk.Orientation.VERTICAL, 0);
+ box.visible = true;
+ box.add(stack);
+ box.add(viewswitcher_bar);
+ this.add(box);
}
public Usage.HeaderBar get_header_bar()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]