From fa7f0a8f6723dd2d7e00be20516bc8f6b7b8bfa7 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 4 Apr 2025 21:23:36 +0200 Subject: adw: fix class derivations --- adw/include/adwaitamm/dialog.hpp | 4 +++- adw/include/adwaitamm/stylemanager.hpp | 4 ++-- adw/src/breakpoint.cpp | 2 +- adw/src/dialog.cpp | 2 ++ adw/src/stylemanager.cpp | 2 +- adw/src/toast.cpp | 2 +- adw/src/toastoverlay.cpp | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/adw/include/adwaitamm/dialog.hpp b/adw/include/adwaitamm/dialog.hpp index 23a864c..44dde25 100644 --- a/adw/include/adwaitamm/dialog.hpp +++ b/adw/include/adwaitamm/dialog.hpp @@ -1,8 +1,8 @@ #ifndef LIBADWAITAMM_DIALOG_HPP #define LIBADWAITAMM_DIALOG_HPP -#include "helpers/gobj_mixin.hpp" #include "adwaitamm/breakpoint.hpp" +#include "helpers/gobj_mixin.hpp" #include #include @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -22,6 +23,7 @@ namespace Adwaita struct Dialog_Class; struct Dialog : Gtk::Widget, + Gtk::ShortcutManager, helpers::gobj_mixin { struct Class : Glib::Class diff --git a/adw/include/adwaitamm/stylemanager.hpp b/adw/include/adwaitamm/stylemanager.hpp index 8a365f9..3d370c3 100644 --- a/adw/include/adwaitamm/stylemanager.hpp +++ b/adw/include/adwaitamm/stylemanager.hpp @@ -28,8 +28,8 @@ namespace Adwaita enum struct AccentColor; enum struct ColorScheme; - struct StyleManager : Glib::Object, - helpers::gobj_mixin + struct StyleManager final : Glib::Object, + helpers::gobj_mixin { struct Class : Glib::Class { diff --git a/adw/src/breakpoint.cpp b/adw/src/breakpoint.cpp index 3907a15..a1b20f9 100644 --- a/adw/src/breakpoint.cpp +++ b/adw/src/breakpoint.cpp @@ -97,7 +97,7 @@ namespace Adwaita if (!gtype_) { class_init_func_ = &class_init_function; - register_derived_type(adw_breakpoint_get_type()); + gtype_ = adw_breakpoint_get_type(); Gtk::Buildable::add_interface(get_type()); } return *this; diff --git a/adw/src/dialog.cpp b/adw/src/dialog.cpp index 2634002..e240d7f 100644 --- a/adw/src/dialog.cpp +++ b/adw/src/dialog.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -33,6 +34,7 @@ namespace Adwaita { class_init_func_ = &class_init_function; register_derived_type(adw_dialog_get_type()); + Gtk::ShortcutManager::add_interface(get_type()); } return *this; } diff --git a/adw/src/stylemanager.cpp b/adw/src/stylemanager.cpp index 1b7817a..09a966c 100644 --- a/adw/src/stylemanager.cpp +++ b/adw/src/stylemanager.cpp @@ -33,7 +33,7 @@ namespace Adwaita if (!gtype_) { class_init_func_ = &StyleManager::Class::class_init_function; - register_derived_type(adw_style_manager_get_type()); + gtype_ = adw_style_manager_get_type(); } return *this; } diff --git a/adw/src/toast.cpp b/adw/src/toast.cpp index 205e69f..d5b372e 100644 --- a/adw/src/toast.cpp +++ b/adw/src/toast.cpp @@ -43,7 +43,7 @@ namespace Adwaita if (!gtype_) { class_init_func_ = &class_init_function; - register_derived_type(adw_toast_get_type()); + gtype_= adw_toast_get_type(); } return *this; } diff --git a/adw/src/toastoverlay.cpp b/adw/src/toastoverlay.cpp index af24649..7d1493c 100644 --- a/adw/src/toastoverlay.cpp +++ b/adw/src/toastoverlay.cpp @@ -32,7 +32,7 @@ namespace Adwaita if (!gtype_) { class_init_func_ = &class_init_function; - register_derived_type(adw_toast_overlay_get_type()); + gtype_ = adw_toast_overlay_get_type(); } return *this; } -- cgit v1.2.3