window: Use a HdyLeaflet
This allows the window to be folded to show either the sidebar or the panel when not enough space is available. This reverts commit 2854669f5c8280a32d0b5fa6c5399cc391ef06f3.
This commit is contained in:
parent
39ed06188a
commit
638dc94a8d
2 changed files with 128 additions and 5 deletions
|
@ -10,9 +10,11 @@
|
|||
<signal name="map-event" handler="window_map_event_cb" object="CcWindow" swapped="no" />
|
||||
<signal name="key-press-event" handler="window_key_press_event_cb" object="CcWindow" swapped="no" after="yes" />
|
||||
<child>
|
||||
<object class="GtkBox" id="main_hbox">
|
||||
<object class="HdyLeaflet" id="main_leaflet">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="mode-transition-type">slide</property>
|
||||
<property name="child-transition-type">slide</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="sidebar_box">
|
||||
<property name="visible">True</property>
|
||||
|
@ -73,6 +75,9 @@
|
|||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">sidebar</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator" id="panel_separator">
|
||||
|
@ -96,6 +101,9 @@
|
|||
<class name="background"/>
|
||||
</style>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">panel</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
@ -104,10 +112,17 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="header_box">
|
||||
<object class="HdyLeaflet" id="header_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="mode-transition-type" bind-source="main_leaflet" bind-property="mode-transition-type" bind-flags="bidirectional|sync-create"/>
|
||||
<property name="mode-transition-duration" bind-source="main_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
|
||||
<property name="child-transition-type" bind-source="main_leaflet" bind-property="child-transition-type" bind-flags="bidirectional|sync-create"/>
|
||||
<property name="child-transition-duration" bind-source="main_leaflet" bind-property="child-transition-duration" bind-flags="bidirectional|sync-create"/>
|
||||
<property name="visible-child-name" bind-source="main_leaflet" bind-property="visible-child-name" bind-flags="bidirectional|sync-create"/>
|
||||
<signal name="notify::visible-child" handler="notify_header_visible_child_cb" swapped="no"/>
|
||||
<signal name="notify::fold" handler="notify_fold_cb" object="CcWindow" after="yes" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<property name="visible">True</property>
|
||||
|
@ -185,6 +200,9 @@
|
|||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">sidebar</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparator" id="header_separator">
|
||||
|
@ -202,6 +220,40 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="show_close_button">True</property>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="back_revealer">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<property name="transition-duration" bind-source="main_leaflet" bind-property="mode-transition-duration" bind-flags="bidirectional|sync-create"/>
|
||||
<child>
|
||||
<object class="GtkButton" id="back">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="use-underline">True</property>
|
||||
<signal name="clicked" handler="back_button_clicked_cb" object="CcWindow" swapped="no" />
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-back">
|
||||
<property name="accessible-name" translatable="yes">Back</property>
|
||||
</object>
|
||||
</child>
|
||||
<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>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="top_right_box">
|
||||
<property name="visible">True</property>
|
||||
|
@ -212,6 +264,9 @@
|
|||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="name">panel</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue