[gnome-boxes] properties: Turn it into Gtk.Notebook from Gtk.Stack
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] properties: Turn it into Gtk.Notebook from Gtk.Stack
- Date: Tue, 25 Nov 2014 15:07:00 +0000 (UTC)
commit 6a5b93e8cd607947e73193628235edf660a62b7b
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Sun Nov 23 16:04:39 2014 +0000
properties: Turn it into Gtk.Notebook from Gtk.Stack
According to the new UI mockup, we need it to be a notebook so that
we have page switching controls before we drop the sidebar.
https://bugzilla.gnome.org/show_bug.cgi?id=733367
src/properties.vala | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/src/properties.vala b/src/properties.vala
index c2397af..e65bb7a 100644
--- a/src/properties.vala
+++ b/src/properties.vala
@@ -10,8 +10,8 @@ private enum Boxes.PropertiesPage {
LAST,
}
-private class Boxes.Properties: Gtk.Stack, Boxes.UI {
- private const string[] page_names = { "general", "system", "devices", "snapshots" };
+private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
+ private const string[] page_titles = { N_("General"), N_("System"), N_("Devices"), N_("Snapshots") };
public UIState previous_ui_state { get; protected set; }
public UIState ui_state { get; protected set; }
@@ -22,16 +22,6 @@ private class Boxes.Properties: Gtk.Stack, Boxes.UI {
private ulong stats_id;
private bool restore_fullscreen;
- private PropertiesPage _page;
- public PropertiesPage page {
- get { return _page; }
- set {
- _page = value;
-
- visible_child_name = page_names[value];
- }
- }
-
private class PageWidget: Gtk.Box {
public bool empty;
@@ -150,7 +140,8 @@ private class Boxes.Properties: Gtk.Stack, Boxes.UI {
for (var i = 0; i < PropertiesPage.LAST; i++) {
var page = new PageWidget (i, machine);
- add_named (page, page_names[i]);
+ var label = new Gtk.Label (page_titles[i]);
+ insert_page (page, label, i);
set_data<PageWidget> (@"boxes-property-$i", page);
page.refresh_properties.connect (() => {
@@ -180,9 +171,6 @@ private class Boxes.Properties: Gtk.Stack, Boxes.UI {
this.window = window;
this.sidebar = dialog.sidebar;
- transition_type = Gtk.StackTransitionType.SLIDE_UP_DOWN;
- transition_duration = 400;
-
show_all ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]