From b52b27eace1d8192c8bf3e559a64cbf71c721ccf Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 27 Jan 2024 12:38:35 -0300 Subject: [PATCH] event-editor: Turn into an AdwDialog --- .../event-editor/gcal-event-editor-dialog.c | 8 ++++---- .../event-editor/gcal-event-editor-dialog.h | 2 +- .../event-editor/gcal-event-editor-dialog.ui | 19 +++---------------- src/gui/gcal-window.c | 4 ++-- src/gui/gcal-window.ui | 2 -- 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c index cc23b933..ff967a42 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.c +++ b/src/gui/event-editor/gcal-event-editor-dialog.c @@ -48,7 +48,7 @@ struct _GcalEventEditorDialog { - AdwWindow parent; + AdwDialog parent; GtkWidget *cancel_button; GtkWidget *delete_button; @@ -85,7 +85,7 @@ struct _GcalEventEditorDialog gboolean writable; }; -G_DEFINE_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, ADW_TYPE_WINDOW) +G_DEFINE_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, ADW_TYPE_DIALOG) enum { @@ -542,7 +542,7 @@ gcal_event_editor_dialog_finalize (GObject *object) } static void -gcal_event_editor_dialog_constructed (GObject* object) +gcal_event_editor_dialog_constructed (GObject *object) { const GActionEntry action_entries[] = { @@ -556,7 +556,7 @@ gcal_event_editor_dialog_constructed (GObject* object) /* chaining up */ G_OBJECT_CLASS (gcal_event_editor_dialog_parent_class)->constructed (object); - gtk_window_set_title (GTK_WINDOW (object), ""); + adw_dialog_set_title (ADW_DIALOG (object), ""); /* Actions */ self->action_group = g_simple_action_group_new (); diff --git a/src/gui/event-editor/gcal-event-editor-dialog.h b/src/gui/event-editor/gcal-event-editor-dialog.h index 9bffa1f0..fcc50e3d 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.h +++ b/src/gui/event-editor/gcal-event-editor-dialog.h @@ -28,7 +28,7 @@ G_BEGIN_DECLS #define GCAL_TYPE_EVENT_EDITOR_DIALOG (gcal_event_editor_dialog_get_type ()) -G_DECLARE_FINAL_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, GCAL, EVENT_EDITOR_DIALOG, AdwWindow); +G_DECLARE_FINAL_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, GCAL, EVENT_EDITOR_DIALOG, AdwDialog); GtkWidget* gcal_event_editor_dialog_new (void); diff --git a/src/gui/event-editor/gcal-event-editor-dialog.ui b/src/gui/event-editor/gcal-event-editor-dialog.ui index b5505fa3..381c8015 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.ui +++ b/src/gui/event-editor/gcal-event-editor-dialog.ui @@ -1,21 +1,8 @@ -