move button_back to headerbar

This commit is contained in:
guinux 2016-04-23 20:58:46 +02:00
parent 6046da7729
commit f0ac44bc4f
2 changed files with 208 additions and 224 deletions

View File

@ -695,37 +695,6 @@
</child> </child>
<child> <child>
<object class="GtkBox" id="box4"> <object class="GtkBox" id="box4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkButton" id="button_back">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<signal name="clicked" handler="on_button_back_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="back_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-previous-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box6">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
@ -747,7 +716,6 @@
<property name="margin_end">6</property> <property name="margin_end">6</property>
<property name="margin_top">6</property> <property name="margin_top">6</property>
<property name="margin_bottom">6</property> <property name="margin_bottom">6</property>
<property name="selectable">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -766,7 +734,6 @@
<property name="margin_end">6</property> <property name="margin_end">6</property>
<property name="margin_top">6</property> <property name="margin_top">6</property>
<property name="margin_bottom">6</property> <property name="margin_bottom">6</property>
<property name="selectable">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -803,7 +770,6 @@
<property name="margin_end">6</property> <property name="margin_end">6</property>
<property name="margin_top">6</property> <property name="margin_top">6</property>
<property name="margin_bottom">6</property> <property name="margin_bottom">6</property>
<property name="selectable">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -971,13 +937,6 @@
</packing> </packing>
</child> </child>
</object> </object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing> <packing>
<property name="name">details</property> <property name="name">details</property>
<property name="title" translatable="yes">Details</property> <property name="title" translatable="yes">Details</property>
@ -991,6 +950,26 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="show_close_button">True</property> <property name="show_close_button">True</property>
<child>
<object class="GtkButton" id="button_back">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<signal name="clicked" handler="on_button_back_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="back_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-previous-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
</child>
<child type="title"> <child type="title">
<object class="GtkStackSwitcher" id="filters_stackswitcher"> <object class="GtkStackSwitcher" id="filters_stackswitcher">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -49,6 +49,8 @@ namespace Pamac {
[GtkChild] [GtkChild]
Gtk.Stack main_stack; Gtk.Stack main_stack;
[GtkChild] [GtkChild]
Gtk.Button button_back;
[GtkChild]
Gtk.TreeView packages_treeview; Gtk.TreeView packages_treeview;
[GtkChild] [GtkChild]
Gtk.TreeViewColumn packages_state_column; Gtk.TreeViewColumn packages_state_column;
@ -140,6 +142,7 @@ namespace Pamac {
Object (application: application); Object (application: application);
support_aur (false, false); support_aur (false, false);
button_back.visible = false;
transaction_infobox.visible = false;; transaction_infobox.visible = false;;
refreshing = false; refreshing = false;
transaction_running = false; transaction_running = false;
@ -1396,10 +1399,12 @@ namespace Pamac {
void on_main_stack_visible_child_changed () { void on_main_stack_visible_child_changed () {
switch (main_stack.visible_child_name) { switch (main_stack.visible_child_name) {
case "browse": case "browse":
button_back.visible = false;
filters_stackswitcher.visible = true; filters_stackswitcher.visible = true;
break; break;
case "details": case "details":
filters_stackswitcher.visible = false; filters_stackswitcher.visible = false;
button_back.visible = true;
break; break;
default: default:
break; break;