Add responsive libhandy HdyViewSwitcherBar (#176)

This commit is contained in:
ranfdev 2020-06-20 12:07:16 +02:00 committed by GitHub
parent 7e97ca1c54
commit 8d203996a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 10 deletions

View File

@ -2,30 +2,50 @@
<!-- Generated with glade 3.36.0 -->
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="0.0"/>
<requires lib="libhandy" version="1.0"/>
<template class="TootleDialogsMainWindow" parent="GtkWindow">
<property name="width_request">450</property>
<property name="height_request">600</property>
<property name="can_focus">False</property>
<child>
<object class="GtkStack" id="view_stack">
<object class="GtkBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition_type">slide-left-right</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkStack" id="timeline_stack">
<object class="GtkStack" id="view_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition_type">slide-left-right</property>
<child>
<placeholder/>
<object class="GtkStack" id="timeline_stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition_type">slide-left-right</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="name">0</property>
<property name="title" translatable="yes">0</property>
</packing>
</child>
</object>
<packing>
<property name="name">0</property>
<property name="title" translatable="yes">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="HdyViewSwitcherBar" id="switcher_navbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">timeline_stack</property>
<property name="reveal" bind-source="timeline_switcher" bind-property="title_visible" bind-flags="sync-create"></property>
</object>
</child>
</object>
</child>
<child type="titlebar">
@ -34,8 +54,9 @@
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<child type="title">
<object class="HdyViewSwitcher" id="timeline_switcher">
<object class="HdyViewSwitcherTitle" id="timeline_switcher">
<property name="visible">True</property>
<property name="title">Tootle</property>
</object>
</child>
<child>
@ -81,3 +102,4 @@
</child>
</template>
</interface>

View File

@ -10,6 +10,16 @@ add_global_arguments([
language: 'c',
)
# This is needed to make libhandy 1.0 work with vala.
# Without this, vala will complain:
# "X is not available in libhandy-1 0.81.0. Use libhandy-1 >= 1.0"
# FIXME Disable --disable-since-check after libhandy 1.0 is released
add_project_arguments (
'--disable-since-check',
language: 'vala'
)
asresources = gnome.compile_resources(
'as-resources', 'data/gresource.xml',
source_dir: 'data',

View File

@ -18,7 +18,7 @@ public class Tootle.Dialogs.MainWindow: Gtk.Window, ISavedWindow {
[GtkChild]
protected Button compose_button;
[GtkChild]
protected Hdy.ViewSwitcher timeline_switcher;
protected Hdy.ViewSwitcherTitle timeline_switcher;
[GtkChild]
protected Widgets.AccountsButton accounts_button;