calls-main-window: Use HdyViewSwitcher and friends

Use HdyViewSwitcher to navigate between the dial pad, call history and
a contacts list.

Closes #56
This commit is contained in:
Bob Ham
2019-07-03 13:34:48 +01:00
parent dbebc17dbd
commit 251e3b0076
2 changed files with 149 additions and 73 deletions

View File

@@ -67,45 +67,91 @@
</object>
</child>
<child>
<object class="GtkStack" id="main_stack">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="CallsHistoryBox" id="history_view">
<object class="GtkStack" id="main_stack">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_focus">False</property>
<property name="expand">True</property>
<child>
<object class="CallsHistoryBox" id="history_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="name">recent</property>
<property name="title" translatable="yes">Recent</property>
<property name="icon_name">document-open-recent</property>
</packing>
</child>
<child>
<object class="GtkBox" id="contacts">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="name">contacts</property>
<property name="title" translatable="yes">Contacts</property>
<property name="icon_name">system-users</property>
</packing>
</child>
</object>
</child>
<child>
<object class="HdyViewSwitcherBar" id="switcher_bar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">main_stack</property>
<property name="reveal">True</property>
</object>
<packing>
<property name="name">history</property>
<property name="title" translatable="yes">History</property>
</packing>
</child>
</object>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkStack" id="header_bar_stack">
<property name="can_focus">False</property>
<object class="HdyHeaderBar">
<property name="visible">True</property>
<property name="visible_child_name" bind-source="main_stack" bind-property="visible_child_name" bind-flags="bidirectional|sync-create"/>
<child>
<object class="CallsHistoryHeaderBar" id="history_header_bar">
<property name="can_focus">False</property>
<property name="centering_policy">strict</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<property name="title">Calls</property>
<child type="title">
<object class="HdySqueezer" id="squeezer">
<property name="visible">True</property>
<property name="transition-type">crossfade</property>
<child>
<object class="HdyViewSwitcher" id="wide_switcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="policy">wide</property>
<property name="stack">main_stack</property>
</object>
</child>
<child>
<object class="HdyViewSwitcher" id="narrow_switcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="policy">narrow</property>
<property name="stack">main_stack</property>
</object>
</child>
<child>
<object class="GtkLabel" id="title_label">
<property name="visible">True</property>
<property name="halign">center</property>
<property name="label">Calls</property>
<style>
<class name="title"/>
</style>
</object>
</child>
</object>
<packing>
<property name="name">history</property>
</packing>
</child>
<child>
<object class="CallsNewCallHeaderBar" id="new_call_header_bar">
<property name="can_focus">False</property>
<property name="visible">True</property>
</object>
<packing>
<property name="name">new-call</property>
</packing>
</child>
</object>
</child>