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

@ -700,117 +700,22 @@
<property name="orientation">vertical</property> <property name="orientation">vertical</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkButton" id="button_back"> <object class="GtkBox" id="box8">
<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>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkBox" id="box8"> <object class="GtkLabel" id="name_label">
<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="halign">start</property>
<property name="spacing">6</property> <property name="margin_left">6</property>
<child> <property name="margin_right">6</property>
<object class="GtkLabel" id="name_label"> <property name="margin_start">6</property>
<property name="visible">True</property> <property name="margin_end">6</property>
<property name="can_focus">False</property> <property name="margin_top">6</property>
<property name="halign">start</property> <property name="margin_bottom">6</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property>
<property name="margin_end">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="desc_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property>
<property name="margin_end">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="link_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property>
<property name="margin_end">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="licenses_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property>
<property name="margin_end">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
<property name="selectable">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -819,10 +724,16 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkStackSwitcher" id="properties_stackswitcher"> <object class="GtkLabel" id="desc_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="stack">properties_stack</property> <property name="halign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property>
<property name="margin_end">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
@ -831,142 +742,190 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkStack" id="properties_stack"> <object class="GtkLabel" id="link_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property>
<property name="margin_end">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="licenses_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property>
<property name="margin_end">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkStackSwitcher" id="properties_stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">properties_stack</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkStack" id="properties_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow" id="details_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child> <child>
<object class="GtkScrolledWindow" id="details_scrolledwindow"> <object class="GtkTreeView" id="details_treeview">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="shadow_type">in</property> <property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection9">
<property name="mode">none</property>
</object>
</child>
<child> <child>
<object class="GtkTreeView" id="details_treeview"> <object class="GtkTreeViewColumn" id="infotype">
<property name="visible">True</property> <property name="sizing">autosize</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="search_column">0</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection9">
<property name="mode">none</property>
</object>
</child>
<child> <child>
<object class="GtkTreeViewColumn" id="infotype"> <object class="GtkCellRendererText" id="cellrenderertext6">
<property name="sizing">autosize</property> <property name="yalign">0</property>
<child> <property name="wrap_mode">word</property>
<object class="GtkCellRendererText" id="cellrenderertext6">
<property name="yalign">0</property>
<property name="wrap_mode">word</property>
</object>
<attributes>
<attribute name="markup">0</attribute>
</attributes>
</child>
</object> </object>
<attributes>
<attribute name="markup">0</attribute>
</attributes>
</child> </child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="info">
<property name="sizing">autosize</property>
<child> <child>
<object class="GtkTreeViewColumn" id="info"> <object class="GtkCellRendererText" id="cellrenderertext7">
<property name="sizing">autosize</property> <property name="wrap_mode">word</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext7">
<property name="wrap_mode">word</property>
</object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object> </object>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child> </child>
</object> </object>
</child> </child>
</object> </object>
<packing>
<property name="name">details</property>
<property name="title" translatable="yes">Details</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="deps_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="deps_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="show_expanders">False</property>
<property name="activate_on_single_click">True</property>
<signal name="row-activated" handler="on_deps_treeview_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="deps_treeview_selection"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="dep_type_treeview_column">
<property name="sizing">autosize</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext3">
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="markup">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="deps_treeview_column">
<property name="sizing">autosize</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext5"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="name">deps</property>
<property name="title" translatable="yes">Dependencies</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="files_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="files_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="pixels_above_lines">3</property>
<property name="editable">False</property>
<property name="left_margin">6</property>
<property name="right_margin">6</property>
<property name="cursor_visible">False</property>
<property name="input_purpose">name</property>
</object>
</child>
</object>
<packing>
<property name="name">files</property>
<property name="title" translatable="yes">Files</property>
<property name="position">2</property>
</packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="name">details</property>
<property name="fill">True</property> <property name="title" translatable="yes">Details</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="deps_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTreeView" id="deps_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="show_expanders">False</property>
<property name="activate_on_single_click">True</property>
<signal name="row-activated" handler="on_deps_treeview_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="deps_treeview_selection"/>
</child>
<child>
<object class="GtkTreeViewColumn" id="dep_type_treeview_column">
<property name="sizing">autosize</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext3">
<property name="yalign">0</property>
</object>
<attributes>
<attribute name="markup">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="deps_treeview_column">
<property name="sizing">autosize</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext5"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="name">deps</property>
<property name="title" translatable="yes">Dependencies</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="files_scrolledwindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="shadow_type">in</property>
<child>
<object class="GtkTextView" id="files_textview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="pixels_above_lines">3</property>
<property name="editable">False</property>
<property name="left_margin">6</property>
<property name="right_margin">6</property>
<property name="cursor_visible">False</property>
<property name="input_purpose">name</property>
</object>
</child>
</object>
<packing>
<property name="name">files</property>
<property name="title" translatable="yes">Files</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
@ -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;