[gnome-boxes] wizard-toolbar: Content for customization view
- From: Zeeshan Ali Khattak <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] wizard-toolbar: Content for customization view
- Date: Sun, 7 Dec 2014 23:43:19 +0000 (UTC)
commit ef349c833214ef1e45495b1e82992acbb451ede8
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Wed Dec 3 17:31:11 2014 +0000
wizard-toolbar: Content for customization view
The wizard topbar should provide a different set of controls and
title when customization view is visible in the wizard window.
https://bugzilla.gnome.org/show_bug.cgi?id=741046
data/ui/wizard-toolbar.ui | 150 +++++++++++++++++++++++++++++++-------------
src/wizard-toolbar.vala | 24 ++++++-
src/wizard-window.vala | 1 +
3 files changed, 127 insertions(+), 48 deletions(-)
---
diff --git a/data/ui/wizard-toolbar.ui b/data/ui/wizard-toolbar.ui
index ebde759..811c884 100644
--- a/data/ui/wizard-toolbar.ui
+++ b/data/ui/wizard-toolbar.ui
@@ -1,76 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.9 -->
- <template class="BoxesWizardToolbar" parent="GtkHeaderBar">
+ <template class="BoxesWizardToolbar" parent="GtkStack">
<property name="visible">True</property>
- <property name="title" translatable="yes">Create a Box</property>
- <style>
- <class name="titlebar"/>
- </style>
+ <property name="transition-type">slide-left-right</property>
+ <property name="transition-duration">400</property>
+ <!-- Main page -->
<child>
- <object class="GtkButton" id="cancel_btn">
+ <object class="GtkHeaderBar" id="main">
<property name="visible">True</property>
- <property name="valign">center</property>
- <property name="use-underline">True</property>
- <property name="label" translatable="yes">_Cancel</property>
+ <property name="title" translatable="yes">Create a Box</property>
<style>
- <class name="text-button"/>
+ <class name="titlebar"/>
</style>
- </object>
- <packing>
- <property name="pack-type">start</property>
- </packing>
- </child>
+ <child>
+ <object class="GtkButton" id="cancel_btn">
+ <property name="visible">True</property>
+ <property name="valign">center</property>
+ <property name="use-underline">True</property>
+ <property name="label" translatable="yes">_Cancel</property>
+ <style>
+ <class name="text-button"/>
+ </style>
+ </object>
- <child>
- <object class="GtkButton" id="create_btn">
- <property name="visible">False</property>
- <property name="valign">center</property>
- <property name="use-underline">True</property>
- <property name="label" translatable="yes">C_reate</property>
- <style>
- <class name="suggested-action"/>
- </style>
- </object>
+ <packing>
+ <property name="pack-type">start</property>
+ </packing>
+ </child>
- <packing>
- <property name="pack-type">end</property>
- </packing>
- </child>
+ <child>
+ <object class="GtkButton" id="create_btn">
+ <property name="visible">False</property>
+ <property name="valign">center</property>
+ <property name="use-underline">True</property>
+ <property name="label" translatable="yes">C_reate</property>
+ <style>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
+
+ <child>
+ <object class="GtkButton" id="continue_btn">
+ <property name="visible">True</property>
+ <property name="valign">center</property>
+ <property name="use-underline">True</property>
+ <property name="label" translatable="yes">C_ontinue</property>
+ <style>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
+
+ <child>
+ <object class="GtkButton" id="back_btn">
+ <property name="visible">True</property>
+ <property name="valign">center</property>
+ <property name="use-underline">True</property>
+ <property name="label" translatable="yes">_Back</property>
+ <style>
+ <class name="text-button"/>
+ </style>
+ </object>
+
+ <packing>
+ <property name="pack-type">end</property>
+ </packing>
+ </child>
- <child>
- <object class="GtkButton" id="continue_btn">
- <property name="visible">True</property>
- <property name="valign">center</property>
- <property name="use-underline">True</property>
- <property name="label" translatable="yes">C_ontinue</property>
- <style>
- <class name="suggested-action"/>
- </style>
</object>
<packing>
- <property name="pack-type">end</property>
+ <property name="name">main</property>
</packing>
</child>
+ <!-- Customization page -->
<child>
- <object class="GtkButton" id="back_btn">
+ <object class="GtkHeaderBar" id="customization">
<property name="visible">True</property>
- <property name="valign">center</property>
- <property name="use-underline">True</property>
- <property name="label" translatable="yes">_Back</property>
+ <property name="show-close-button">False</property>
+ <property name="title" translatable="yes">Customize Resources</property>
<style>
- <class name="text-button"/>
+ <class name="titlebar"/>
</style>
+
+ <child>
+ <object class="GtkButton" id="customization_back_btn">
+ <property name="visible">True</property>
+ <property name="valign">center</property>
+ <signal name="clicked" handler="on_customization_back_clicked"/>
+ <style>
+ <class name="image-button"/>
+ </style>
+
+ <child internal-child="accessible">
+ <object class="AtkObject" id="a11y-button">
+ <property name="accessible-name" translatable="yes">Back</property>
+ </object>
+ </child>
+
+ <child>
+ <object class="GtkImage" id="back_image">
+ <property name="visible">True</property>
+ <property name="icon-name">go-previous-symbolic</property>
+ </object>
+ </child>
+ </object>
+
+ <packing>
+ <property name="pack-type">start</property>
+ </packing>
+ </child>
+
</object>
<packing>
- <property name="pack-type">end</property>
+ <property name="name">customization</property>
</packing>
</child>
+
</template>
<object class="GtkSizeGroup" id="sizegroup">
diff --git a/src/wizard-toolbar.vala b/src/wizard-toolbar.vala
index 3c9a67d..10e4dcf 100644
--- a/src/wizard-toolbar.vala
+++ b/src/wizard-toolbar.vala
@@ -2,7 +2,20 @@
using Gtk;
[GtkTemplate (ui = "/org/gnome/Boxes/ui/wizard-toolbar.ui")]
-private class Boxes.WizardToolbar: HeaderBar {
+private class Boxes.WizardToolbar: Gtk.Stack {
+ private WizardWindowPage _page;
+ public WizardWindowPage page {
+ get { return _page; }
+ set {
+ _page = value;
+
+ visible_child_name = WizardWindow.page_names[value];
+ }
+ }
+
+ [GtkChild]
+ public Gtk.HeaderBar main;
+
[GtkChild]
public Button cancel_btn;
[GtkChild]
@@ -34,13 +47,18 @@ private class Boxes.WizardToolbar: HeaderBar {
break;
case WizardPage.INTRODUCTION:
- title = _("Create a box");
+ main.title = _("Create a box");
break;
default:
- title = _("Create a box (step %d/4)").printf (page);
+ main.title = _("Create a box (step %d/4)").printf (page);
break;
}
}
+
+ [GtkCallback]
+ private void on_customization_back_clicked () requires (page == WizardWindowPage.CUSTOMIZATION) {
+ wizard_window.page = WizardWindowPage.MAIN;
+ }
}
diff --git a/src/wizard-window.vala b/src/wizard-window.vala
index ce4f808..4e16798 100644
--- a/src/wizard-window.vala
+++ b/src/wizard-window.vala
@@ -29,6 +29,7 @@ private class Boxes.WizardWindow : Gtk.Window, Boxes.UI {
_page = value;
view.visible_child_name = page_names[value];
+ topbar.page = value;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]