diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2025-04-04 20:26:02 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2025-04-04 20:26:02 +0200 |
| commit | 51babee1fc579cd99d32d1b7156ee553ed847339 (patch) | |
| tree | e009f952487e556e15a65355538b65f051f5b068 /adw/src | |
| parent | cfa7e877aba0dc9dcd4db9d46052d58a3c4db4b6 (diff) | |
| download | turns-51babee1fc579cd99d32d1b7156ee553ed847339.tar.xz turns-51babee1fc579cd99d32d1b7156ee553ed847339.zip | |
adw: move ToastPriority
Diffstat (limited to 'adw/src')
| -rw-r--r-- | adw/src/enums.cpp | 4 | ||||
| -rw-r--r-- | adw/src/toast.cpp | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/adw/src/enums.cpp b/adw/src/enums.cpp index 9891845..9261387 100644 --- a/adw/src/enums.cpp +++ b/adw/src/enums.cpp @@ -45,6 +45,9 @@ namespace Adwaita static_assert(matches<ResponseAppearance::Suggested, ADW_RESPONSE_SUGGESTED>); static_assert(matches<ResponseAppearance::Destructive, ADW_RESPONSE_DESTRUCTIVE>); + static_assert(matches<ToastPriority::Normal, ADW_TOAST_PRIORITY_NORMAL>); + static_assert(matches<ToastPriority::High, ADW_TOAST_PRIORITY_HIGH>); + } // namespace Adwaita namespace Glib @@ -60,6 +63,7 @@ namespace Glib VALUE_SPECIALIZATION(LengthType, breakpoint_condition) VALUE_SPECIALIZATION(RatioType, breakpoint_condition) VALUE_SPECIALIZATION(ResponseAppearance, response_appearance) + VALUE_SPECIALIZATION(ToastPriority, toast_priority) #undef VALUE_SPECIALIZATION } // namespace Glib
\ No newline at end of file diff --git a/adw/src/toast.cpp b/adw/src/toast.cpp index 9ec0a5b..205e69f 100644 --- a/adw/src/toast.cpp +++ b/adw/src/toast.cpp @@ -1,5 +1,6 @@ #include "adwaitamm/toast.hpp" +#include "adwaitamm/enums.hpp" #include "adwaitamm/helpers/properties.hpp" #include <glibmm/class.h> @@ -23,9 +24,6 @@ namespace Adwaita { - static_assert(static_cast<int>(Toast::Priority::NORMAL) == ADW_TOAST_PRIORITY_NORMAL); - static_assert(static_cast<int>(Toast::Priority::HIGH) == ADW_TOAST_PRIORITY_HIGH); - namespace { auto constinit _class = Toast::Class{}; @@ -118,9 +116,9 @@ namespace Adwaita return Glib::wrap(adw_toast_get_custom_title(const_cast<BaseObjectType *>(Glib::unwrap(this)))); } - auto Toast::get_priority() const -> Priority + auto Toast::get_priority() const -> ToastPriority { - return static_cast<Priority>(adw_toast_get_priority(const_cast<BaseObjectType *>(Glib::unwrap(this)))); + return static_cast<ToastPriority>(adw_toast_get_priority(const_cast<BaseObjectType *>(Glib::unwrap(this)))); } auto Toast::get_timeout() const -> unsigned @@ -163,7 +161,7 @@ namespace Adwaita adw_toast_set_detailed_action_name(Glib::unwrap(this), Glib::c_str_or_nullptr(value)); } - auto Toast::set_priority(Priority value) -> void + auto Toast::set_priority(ToastPriority value) -> void { adw_toast_set_priority(Glib::unwrap(this), static_cast<AdwToastPriority>(value)); } @@ -203,9 +201,9 @@ namespace Adwaita return helpers::make_property_proxy<Gtk::Widget *>(*this, "custom-title"); } - auto Toast::property_priority() -> Glib::PropertyProxy<Priority> + auto Toast::property_priority() -> Glib::PropertyProxy<ToastPriority> { - return helpers::make_property_proxy<Priority>(*this, "priority"); + return helpers::make_property_proxy<ToastPriority>(*this, "priority"); } auto Toast::property_timeout() -> Glib::PropertyProxy<unsigned> |
