1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-12-11 23:27:35 +00:00

main-window: Make it a HdyApplicationWindow

This gives the window some nice rounded corners, and gives us more
freedom in how to implement the UI.

This purposefully leaves the indentation broken to ease code review, it
will be fixed in the next commit.
This commit is contained in:
Adrien Plazas 2021-07-15 09:35:32 +02:00 committed by Evangelos Ribeiro Tzaras
parent c90d01405d
commit f4f41d9db5
3 changed files with 26 additions and 20 deletions

View file

@ -42,7 +42,7 @@
struct _CallsMainWindow
{
GtkApplicationWindow parent_instance;
HdyApplicationWindow parent_instance;
GListModel *record_store;
@ -67,7 +67,7 @@ struct _CallsMainWindow
GtkButton *ussd_reply_button;
};
G_DEFINE_TYPE (CallsMainWindow, calls_main_window, GTK_TYPE_APPLICATION_WINDOW);
G_DEFINE_TYPE (CallsMainWindow, calls_main_window, HDY_TYPE_APPLICATION_WINDOW);
enum {
PROP_0,

View file

@ -25,13 +25,13 @@
#ifndef CALLS_MAIN_WINDOW_H__
#define CALLS_MAIN_WINDOW_H__
#include <gtk/gtk.h>
#include <handy.h>
G_BEGIN_DECLS
#define CALLS_TYPE_MAIN_WINDOW (calls_main_window_get_type ())
G_DECLARE_FINAL_TYPE (CallsMainWindow, calls_main_window, CALLS, MAIN_WINDOW, GtkApplicationWindow);
G_DECLARE_FINAL_TYPE (CallsMainWindow, calls_main_window, CALLS, MAIN_WINDOW, HdyApplicationWindow);
CallsMainWindow *calls_main_window_new (GtkApplication *application,
GListModel *record_store);

View file

@ -3,12 +3,33 @@
<interface>
<requires lib="gtk+" version="3.20"/>
<requires lib="libhandy" version="1.0"/>
<template class="CallsMainWindow" parent="GtkApplicationWindow">
<template class="CallsMainWindow" parent="HdyApplicationWindow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Calls</property>
<property name="hide_titlebar_when_maximized">True</property>
<property name="show_menubar">False</property>
<signal name="delete-event" handler="gtk_widget_hide_on_delete"/>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
<child>
<object class="HdyHeaderBar">
<property name="visible">True</property>
<property name="centering_policy">strict</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
<child type="title">
<object class="HdyViewSwitcherTitle" id="title_switcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">main_stack</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkOverlay">
<property name="visible">True</property>
@ -63,21 +84,6 @@
</child>
</object>
</child>
<child type="titlebar">
<object class="HdyHeaderBar">
<property name="visible">True</property>
<property name="centering_policy">strict</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
<child type="title">
<object class="HdyViewSwitcherTitle" id="title_switcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stack">main_stack</property>
<property name="title" bind-source="CallsMainWindow" bind-property="title" bind-flags="sync-create"/>
</object>
</child>
</object>
</child>
</template>