From 1f4edcf8d1ce507d7b45d3ef33511634154ab48a Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 29 Apr 2025 17:04:29 +0200 Subject: ui: rename preferences to Preferences --- ui/include/turns/ui/preferences.hpp | 4 ++-- ui/src/init.cpp | 2 +- ui/src/preferences.cpp | 10 +++++----- ui/src/preferences.ui | 2 +- ui/src/tracker/actions.cpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'ui') diff --git a/ui/include/turns/ui/preferences.hpp b/ui/include/turns/ui/preferences.hpp index bf24274..b68b91c 100644 --- a/ui/include/turns/ui/preferences.hpp +++ b/ui/include/turns/ui/preferences.hpp @@ -18,7 +18,7 @@ namespace turns::ui { - struct preferences : template_widget + struct Preferences : template_widget { auto constexpr inline static children = std::array{ @@ -31,7 +31,7 @@ namespace turns::ui "skip_defeated", }; - explicit preferences(Glib::RefPtr settings = {}); + explicit Preferences(Glib::RefPtr settings = {}); private: auto bind_reset(Glib::ustring const & key, Gtk::Button * button) -> void; diff --git a/ui/src/init.cpp b/ui/src/init.cpp index 0e7e96d..22440f4 100644 --- a/ui/src/init.cpp +++ b/ui/src/init.cpp @@ -12,7 +12,7 @@ namespace turns::ui { static_cast(ParticipantEditor{{}}); static_cast(ParticipantRow{{}}); - static_cast(preferences{{}}); + static_cast(Preferences{{}}); static_cast(turn_order_view{{}}); } diff --git a/ui/src/preferences.cpp b/ui/src/preferences.cpp index b521a25..88e6d0f 100644 --- a/ui/src/preferences.cpp +++ b/ui/src/preferences.cpp @@ -27,11 +27,11 @@ namespace turns::ui { namespace { - auto constexpr static TYPE_NAME = "preferences"; + auto constexpr static TYPE_NAME = "Preferences"; auto constexpr static TEMPLATE = "/ch/arknet/Turns/preferences.ui"; } // namespace - preferences::preferences(Glib::RefPtr settings) + Preferences::Preferences(Glib::RefPtr settings) : Glib::ObjectBase{TYPE_NAME} , template_widget{TEMPLATE} , m_settings{settings} @@ -58,21 +58,21 @@ namespace turns::ui m_settings->bind(core::settings::key::skip_defeated, m_skip_defeated->property_active()); } - auto preferences::bind_reset(Glib::ustring const & key, Gtk::Button * button) -> void + auto Preferences::bind_reset(Glib::ustring const & key, Gtk::Button * button) -> void { m_settings->signal_changed(key).connect([=, this](auto) { update_sensitive(key, button); }); update_sensitive(key, button); button->signal_clicked().connect(sigc::bind(sigc::mem_fun(*m_settings, &Gio::Settings::reset), key)); } - auto preferences::bind_setting(Glib::ustring const & key, Gtk::ColorDialogButton * button) -> void + auto Preferences::bind_setting(Glib::ustring const & key, Gtk::ColorDialogButton * button) -> void { m_settings->bind(key, button->property_rgba(), Gio::Settings::BindFlags::DEFAULT, [](auto value) { return Gdk::RGBA{value}; }, [](auto color) { return color.to_string(); }); } - auto preferences::update_sensitive(Glib::ustring const & key, Gtk::Button * button) -> void + auto Preferences::update_sensitive(Glib::ustring const & key, Gtk::Button * button) -> void { auto v = Glib::Variant{}; button->set_sensitive(m_settings->get_user_value(key, v)); diff --git a/ui/src/preferences.ui b/ui/src/preferences.ui index 3831274..0ee2699 100644 --- a/ui/src/preferences.ui +++ b/ui/src/preferences.ui @@ -4,7 +4,7 @@ -