calendars-page: Port Add Calendar button to AdwButtonRow

This commit is contained in:
Alice Mikhaylenko
2024-05-01 13:47:16 +00:00
committed by Georges Basile Stavracas Neto
parent 0228df3bc9
commit eb8ee25f6a
2 changed files with 49 additions and 44 deletions
@@ -258,7 +258,7 @@ on_listbox_row_activated_cb (GtkListBox *listbox,
} }
static void static void
on_new_calendar_button_clicked_cb (GtkButton *button, on_new_calendar_row_activated_cb (AdwButtonRow *button,
GcalCalendarsPage *self) GcalCalendarsPage *self)
{ {
GcalCalendarManagementPage *page = GCAL_CALENDAR_MANAGEMENT_PAGE (self); GcalCalendarManagementPage *page = GCAL_CALENDAR_MANAGEMENT_PAGE (self);
@@ -463,7 +463,7 @@ gcal_calendars_page_class_init (GcalCalendarsPageClass *klass)
gtk_widget_class_bind_template_child (widget_class, GcalCalendarsPage, toast_overlay); gtk_widget_class_bind_template_child (widget_class, GcalCalendarsPage, toast_overlay);
gtk_widget_class_bind_template_callback (widget_class, on_listbox_row_activated_cb); gtk_widget_class_bind_template_callback (widget_class, on_listbox_row_activated_cb);
gtk_widget_class_bind_template_callback (widget_class, on_new_calendar_button_clicked_cb); gtk_widget_class_bind_template_callback (widget_class, on_new_calendar_row_activated_cb);
} }
static void static void
@@ -25,12 +25,16 @@
<object class="AdwClamp"> <object class="AdwClamp">
<property name="child"> <property name="child">
<object class="GtkListBox" id="listbox"> <object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">24</property>
<property name="margin-top">24</property> <property name="margin-top">24</property>
<property name="margin-bottom">24</property> <property name="margin-bottom">24</property>
<property name="margin-start">24</property> <property name="margin-start">12</property>
<property name="margin-end">24</property> <property name="margin-end">12</property>
<property name="valign">start</property> <property name="valign">start</property>
<child>
<object class="GtkListBox" id="listbox">
<property name="selection-mode">none</property> <property name="selection-mode">none</property>
<signal name="row-activated" handler="on_listbox_row_activated_cb" object="GcalCalendarsPage" swapped="no" /> <signal name="row-activated" handler="on_listbox_row_activated_cb" object="GcalCalendarsPage" swapped="no" />
<style> <style>
@@ -38,28 +42,17 @@
<class name="boxed-list"/> <class name="boxed-list"/>
</style> </style>
</object> </object>
</child>
</property>
</object>
</property>
</object>
</property>
<child type="bottom">
<object class="GtkBox">
<property name="hexpand">true</property>
<property name="halign">center</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
<child> <child>
<object class="GtkButton"> <object class="GtkListBox">
<property name="label" translatable="yes">_Add Calendar…</property> <property name="selection-mode">none</property>
<child>
<object class="AdwButtonRow">
<property name="title" translatable="yes">_Add Calendar</property>
<property name="use-underline">true</property> <property name="use-underline">true</property>
<signal name="clicked" handler="on_new_calendar_button_clicked_cb" object="GcalCalendarsPage" swapped="no" /> <property name="end-icon-name">go-next-symbolic</property>
<signal name="activated" handler="on_new_calendar_row_activated_cb" object="GcalCalendarsPage" swapped="no" />
<style> <style>
<class name="pill"/>
<class name="suggested-action"/> <class name="suggested-action"/>
</style> </style>
@@ -76,8 +69,20 @@
</child> </child>
</object> </object>
</child> </child>
<style>
<class name="boxed-list-separate"/>
</style>
</object> </object>
</child> </child>
</object>
</property>
</object>
</property>
</object>
</property>
</object> </object>
</child> </child>