calendar-management: Replace bottom button with menu

The new menu allows opening either the new-local-calendar or the
new-online-calendar page. As of this commit both pages still show
the same content, this will be fixed in the following commits.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/850>
This commit is contained in:
Titouan Real
2026-09-26 00:04:12 +00:00
committed by Marge Bot
parent 736b724d24
commit 8a21b82e42
5 changed files with 41 additions and 44 deletions
@@ -213,6 +213,22 @@ clear_toast_and_delete_calendar (GcalCalendarsPage *self,
* Callbacks
*/
static void
on_new_local_calendar_action_activated (GtkWidget *widget)
{
GcalCalendarManagementPage *page = GCAL_CALENDAR_MANAGEMENT_PAGE (widget);
gcal_calendar_management_page_switch_page (page, "new-local-calendar", NULL);
}
static void
on_new_online_calendar_action_activated (GtkWidget *widget)
{
GcalCalendarManagementPage *page = GCAL_CALENDAR_MANAGEMENT_PAGE (widget);
gcal_calendar_management_page_switch_page (page, "new-online-calendar", NULL);
}
static gint
listbox_sort_func (GtkListBoxRow *row1,
GtkListBoxRow *row2,
@@ -264,15 +280,6 @@ on_listbox_row_activated_cb (GtkListBox *listbox,
gcal_calendar_management_page_switch_page (page, "edit-calendar", calendar);
}
static void
on_new_calendar_row_activated_cb (AdwButtonRow *button,
GcalCalendarsPage *self)
{
GcalCalendarManagementPage *page = GCAL_CALENDAR_MANAGEMENT_PAGE (self);
gcal_calendar_management_page_switch_page (page, "new-local-calendar", NULL);
}
static void
on_manager_calendar_added_cb (GcalManager *manager,
GcalCalendar *calendar,
@@ -417,7 +424,11 @@ gcal_calendars_page_class_init (GcalCalendarsPageClass *klass)
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_new_calendar_row_activated_cb);
gtk_widget_class_install_action (widget_class, "calendar-management.new-local-calendar", NULL,
(GtkWidgetActionActivateFunc) on_new_local_calendar_action_activated);
gtk_widget_class_install_action (widget_class, "calendar-management.new-online-calendar", NULL,
(GtkWidgetActionActivateFunc) on_new_online_calendar_action_activated);
}
static void