cursor-size-dialog: Port to AdwDialog

This commit is contained in:
Automeris naranja 2024-04-12 02:57:38 -03:00 committed by Felipe Borges
parent 99ab03fd45
commit c9dedb82e6
4 changed files with 9 additions and 20 deletions

View file

@ -23,14 +23,14 @@
struct _CcCursorSizeDialog
{
AdwWindow parent;
AdwDialog parent;
GtkBox *cursor_box;
GSettings *interface_settings;
};
G_DEFINE_TYPE (CcCursorSizeDialog, cc_cursor_size_dialog, ADW_TYPE_WINDOW);
G_DEFINE_TYPE (CcCursorSizeDialog, cc_cursor_size_dialog, ADW_TYPE_DIALOG);
static void
cursor_size_toggled (CcCursorSizeDialog *self, GtkWidget *button)
@ -63,8 +63,6 @@ cc_cursor_size_dialog_class_init (CcCursorSizeDialogClass *klass)
object_class->dispose = cc_cursor_size_dialog_dispose;
gtk_widget_class_add_binding_action (widget_class, GDK_KEY_Escape, 0, "window.close", NULL);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/universal-access/cc-cursor-size-dialog.ui");
gtk_widget_class_bind_template_child (widget_class, CcCursorSizeDialog, cursor_box);

View file

@ -22,7 +22,7 @@
G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (CcCursorSizeDialog, cc_cursor_size_dialog, CC, CURSOR_SIZE_DIALOG, AdwWindow)
G_DECLARE_FINAL_TYPE (CcCursorSizeDialog, cc_cursor_size_dialog, CC, CURSOR_SIZE_DIALOG, AdwDialog)
CcCursorSizeDialog *cc_cursor_size_dialog_new (void);

View file

@ -1,19 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="CcCursorSizeDialog" parent="AdwWindow">
<template class="CcCursorSizeDialog" parent="AdwDialog">
<property name="title" translatable="yes">Cursor Size</property>
<property name="resizable">False</property>
<property name="modal">True</property>
<property name="width-request">360</property>
<property name="height-request">294</property>
<property name="default-width">500</property>
<property name="default-height">294</property>
<property name="content">
<property name="content-width">500</property>
<property name="child">
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar"/>
</child>
<property name="content">
<object class="AdwPreferencesPage">
<property name="description" translatable="yes">Cursor size can be combined with Zoom to make it easier to see the cursor</property>

View file

@ -137,16 +137,13 @@ ua_seeing_interface_cursor_size_changed_cb (CcUaSeeingPage *self)
static void
ua_cursor_row_activated_cb (CcUaSeeingPage *self)
{
GtkWindow *dialog;
GtkNative *native;
AdwDialog *dialog;
g_assert (CC_IS_UA_SEEING_PAGE (self));
dialog = GTK_WINDOW (cc_cursor_size_dialog_new ());
native = gtk_widget_get_native (GTK_WIDGET (self));
dialog = ADW_DIALOG (cc_cursor_size_dialog_new ());
gtk_window_set_transient_for (dialog, GTK_WINDOW (native));
gtk_window_present (dialog);
adw_dialog_present (dialog, GTK_WIDGET (self));
}
static void