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.
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <adwaita.h>
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<template class="GcalEventEditorDialog" parent="GtkDialog">
|
||||
<template class="GcalEventEditorDialog" parent="AdwWindow">
|
||||
<property name="modal">True</property>
|
||||
<property name="default-width">700</property>
|
||||
<property name="default-height">1000</property>
|
||||
<property name="use_header_bar">1</property>
|
||||
<property name="destroy_with_parent">True</property>
|
||||
<property name="destroy-with-parent">True</property>
|
||||
<property name="hide-on-close">True</property>
|
||||
<child type="titlebar">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkHeaderBar" id="titlebar">
|
||||
<property name="show-title-buttons">False</property>
|
||||
<child>
|
||||
@@ -92,8 +94,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="AdwPreferencesPage">
|
||||
<property name="vexpand">True</property>
|
||||
|
||||
Reference in New Issue
Block a user