From 0c2b8261c2de801f7c5065d03507111180fa2aa9 Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 17 Jun 2023 19:30:51 -0400 Subject: [PATCH] event-editor-dialog: Use AdwWindow instead of GtkDialog GtkDialog is being deprecated. Instead of using it, we want to subclass AdwWindow. As part of this change the content and headerbar are put together in one box. --- .../event-editor/gcal-event-editor-dialog.c | 7 +- .../event-editor/gcal-event-editor-dialog.h | 4 +- .../event-editor/gcal-event-editor-dialog.ui | 134 +++++++++--------- 3 files changed, 72 insertions(+), 73 deletions(-) diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c index e53e1aa7..6a6ddf20 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 { - GtkDialog parent; + AdwWindow parent; GtkWidget *cancel_button; GtkWidget *delete_button; @@ -89,7 +89,7 @@ static void on_calendar_selected_action_cb (GSimpleAction GVariant *value, gpointer user_data); -G_DEFINE_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, GTK_TYPE_DIALOG) +G_DEFINE_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, ADW_TYPE_WINDOW) enum { @@ -559,9 +559,6 @@ gcal_event_editor_dialog_constructed (GObject* object) gtk_window_set_title (GTK_WINDOW (object), ""); - /* titlebar */ - gtk_window_set_titlebar (GTK_WINDOW (object), self->titlebar); - /* Actions */ self->action_group = g_simple_action_group_new (); g_action_map_add_action_entries (G_ACTION_MAP (self->action_group), diff --git a/src/gui/event-editor/gcal-event-editor-dialog.h b/src/gui/event-editor/gcal-event-editor-dialog.h index 3b574b7f..9bffa1f0 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.h +++ b/src/gui/event-editor/gcal-event-editor-dialog.h @@ -19,6 +19,8 @@ #pragma once +#include + #include "gcal-event.h" #include "gcal-manager.h" @@ -26,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, GtkDialog); +G_DECLARE_FINAL_TYPE (GcalEventEditorDialog, gcal_event_editor_dialog, GCAL, EVENT_EDITOR_DIALOG, AdwWindow); 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 dcdef67c..41be6e11 100644 --- a/src/gui/event-editor/gcal-event-editor-dialog.ui +++ b/src/gui/event-editor/gcal-event-editor-dialog.ui @@ -1,99 +1,99 @@ -