1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-05-21 20:49:29 +00:00
Anton Lazarev 2024-01-12 17:44:02 -08:00
parent 001d599495
commit a3a193b77f
2 changed files with 12 additions and 23 deletions

View file

@ -417,21 +417,6 @@ dispose (GObject *object)
}
static void
size_allocate (GtkWidget *widget,
int width,
int height,
int baseline)
{
CallsMainWindow *self = CALLS_MAIN_WINDOW (widget);
adw_view_switcher_title_set_view_switcher_enabled (self->title_switcher,
width > 400);
GTK_WIDGET_CLASS (calls_main_window_parent_class)->size_allocate (widget, width, height, baseline);
}
static void
calls_main_window_class_init (CallsMainWindowClass *klass)
{
@ -452,11 +437,8 @@ calls_main_window_class_init (CallsMainWindowClass *klass)
g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
widget_class->size_allocate = size_allocate;
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Calls/ui/main-window.ui");
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, toast_overlay);
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, title_switcher);
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, main_stack);
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, permanent_error_revealer);
gtk_widget_class_bind_template_child (widget_class, CallsMainWindow, permanent_error_label);

View file

@ -6,15 +6,23 @@
<property name="title" translatable="yes">Calls</property>
<property name="show_menubar">False</property>
<property name="hide-on-close">True</property>
<property name="width-request">360</property>
<property name="height-request">294</property>
<child>
<object class="AdwBreakpoint">
<condition>max-width: 450sp</condition>
<setter object="header_bar" property="title-widget"/>
<setter object="switcher_bar" property="reveal">True</setter>
</object>
</child>
<child>
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar">
<property name="centering_policy">strict</property>
<object class="AdwHeaderBar" id="header_bar">
<child type="title">
<object class="AdwViewSwitcherTitle" id="title_switcher">
<object class="AdwViewSwitcher" id="title_switcher">
<property name="policy">wide</property>
<property name="stack">main_stack</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
</object>
</child>
<child type="end">
@ -55,7 +63,6 @@
<child>
<object class="AdwViewSwitcherBar" id="switcher_bar">
<property name="stack">main_stack</property>
<property name="reveal" bind-source="title_switcher" bind-property="title-visible" bind-flags="sync-create"/>
</object>
</child>
</object>