Skip to content

Commit

Permalink
refactor: Replace deprecated AdwPreferencesWindow with AdwApplication…
Browse files Browse the repository at this point in the history
…Window
  • Loading branch information
kanru committed Jul 20, 2024
1 parent 9ec4331 commit 35354ed
Show file tree
Hide file tree
Showing 3 changed files with 231 additions and 220 deletions.
7 changes: 5 additions & 2 deletions src/setup/ibus-setup-chewing-window.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@

#include "ibus-setup-chewing-window.h"
#include "ibus-setup-chewing-about.h"
#include <gdk/gdkkeysyms.h>

struct _IbusSetupChewingWindow {
AdwPreferencesWindow parent_instance;
AdwApplicationWindow parent_instance;

/* Template widgets */
AdwComboRow *kb_type;
Expand All @@ -45,7 +46,7 @@ struct _IbusSetupChewingWindow {
};

G_DEFINE_FINAL_TYPE(IbusSetupChewingWindow, ibus_setup_chewing_window,
ADW_TYPE_PREFERENCES_WINDOW)
ADW_TYPE_APPLICATION_WINDOW)

#define bind_child(child_id) \
gtk_widget_class_bind_template_child(widget_class, IbusSetupChewingWindow, \
Expand Down Expand Up @@ -85,6 +86,8 @@ ibus_setup_chewing_window_class_init(IbusSetupChewingWindowClass *klass) {

gtk_widget_class_install_action(widget_class, "about", NULL,
action_adaptor_show_about);
gtk_widget_class_add_binding_action(widget_class, GDK_KEY_Escape, 0,
"window.close", NULL);
}

const gchar *kb_type_ids[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/setup/ibus-setup-chewing-window.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
G_BEGIN_DECLS
#define IBUS_SETUP_CHEWING_TYPE_WINDOW (ibus_setup_chewing_window_get_type())
G_DECLARE_FINAL_TYPE(IbusSetupChewingWindow, ibus_setup_chewing_window,
IBUS_SETUP_CHEWING, WINDOW, AdwPreferencesWindow)
IBUS_SETUP_CHEWING, WINDOW, AdwApplicationWindow)
G_END_DECLS
Loading

0 comments on commit 35354ed

Please sign in to comment.