From fb917713e55147c6b0de514924c4867d9e8d5894 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Sat, 17 Aug 2024 11:41:43 +0200 Subject: ui: add participant shading color preferences --- adw/src/preferencesrow.cpp | 107 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 adw/src/preferencesrow.cpp (limited to 'adw/src/preferencesrow.cpp') diff --git a/adw/src/preferencesrow.cpp b/adw/src/preferencesrow.cpp new file mode 100644 index 0000000..ef9b281 --- /dev/null +++ b/adw/src/preferencesrow.cpp @@ -0,0 +1,107 @@ +#include "turns/adw/preferencesrow.hpp" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +namespace turns::adw +{ + namespace + { + auto constinit _class = PreferencesRow::Class{}; + } + + auto PreferencesRow::Class::init() -> Glib::Class const & + { + if (!gtype_) + { + class_init_func_ = &PreferencesRow::Class::class_init_function; + register_derived_type(adw_preferences_row_get_type()); + } + return *this; + } + + auto PreferencesRow::Class::class_init_function(void * gclass, void * data) -> void + { + auto const klass = static_cast(gclass); + Gtk::Widget_Class::class_init_function(klass, data); + } + + auto PreferencesRow::Class::wrap_new(GObject * object) -> Glib::ObjectBase * + { + return new PreferencesRow(ADW_PREFERENCES_ROW(object)); + } + + auto PreferencesRow::get_type() -> GType + { + return _class.init().get_type(); + } + + auto PreferencesRow::get_base_type() -> GType + { + return adw_preferences_row_get_type(); + } + + PreferencesRow::PreferencesRow() + : Glib::ObjectBase{nullptr} + , Gtk::ListBoxRow{Glib::ConstructParams{_class.init()}} + { + } + + auto PreferencesRow::set_title(Glib::ustring const & title) -> CppObjectType & + { + adw_preferences_row_set_title(Glib::unwrap(this), title.c_str()); + return *this; + } + + auto PreferencesRow::set_title_selectable(bool selectable) noexcept -> CppObjectType & + { + adw_preferences_row_set_title_selectable(Glib::unwrap(this), selectable); + return *this; + } + + auto PreferencesRow::set_use_markup(bool use) noexcept -> CppObjectType & + { + adw_preferences_row_set_use_markup(Glib::unwrap(this), use); + return *this; + } + + auto PreferencesRow::set_use_underline(bool use) noexcept -> CppObjectType & + { + adw_preferences_row_set_use_underline(Glib::unwrap(this), use); + return *this; + } + + PreferencesRow::PreferencesRow(Glib::ConstructParams const & params) + : Gtk::ListBoxRow{params} + { + } + + PreferencesRow::PreferencesRow(BaseObjectType * gobj) + : Glib::ObjectBase{nullptr} + , Gtk::ListBoxRow(GTK_LIST_BOX_ROW(gobj)) + { + } + +} // namespace turns::adw + +namespace Glib +{ + auto wrap(AdwPreferencesRow * object, bool copy) -> Glib::RefPtr + { + return Glib::make_refptr_for_instance( + dynamic_cast(Glib::wrap_auto(G_OBJECT(object), copy))); + } +} // namespace Glib \ No newline at end of file -- cgit v1.2.3