summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2025-04-29 17:04:29 +0200
committerFelix Morgner <felix.morgner@gmail.com>2025-04-29 17:04:29 +0200
commit1f4edcf8d1ce507d7b45d3ef33511634154ab48a (patch)
tree30b02e8c5f7aee826cc2dea27141dc57ad841229
parent0afcbdc28f038b38d8cd7fe3d80191dc3bf31303 (diff)
downloadturns-1f4edcf8d1ce507d7b45d3ef33511634154ab48a.tar.xz
turns-1f4edcf8d1ce507d7b45d3ef33511634154ab48a.zip
ui: rename preferences to Preferences
-rw-r--r--ui/include/turns/ui/preferences.hpp4
-rw-r--r--ui/src/init.cpp2
-rw-r--r--ui/src/preferences.cpp10
-rw-r--r--ui/src/preferences.ui2
-rw-r--r--ui/src/tracker/actions.cpp2
5 files changed, 10 insertions, 10 deletions
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<preferences, Adwaita::PreferencesPage>
+ struct Preferences : template_widget<Preferences, Adwaita::PreferencesPage>
{
auto constexpr inline static children = std::array{
@@ -31,7 +31,7 @@ namespace turns::ui
"skip_defeated",
};
- explicit preferences(Glib::RefPtr<Gio::Settings> settings = {});
+ explicit Preferences(Glib::RefPtr<Gio::Settings> 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<void>(ParticipantEditor{{}});
static_cast<void>(ParticipantRow{{}});
- static_cast<void>(preferences{{}});
+ static_cast<void>(Preferences{{}});
static_cast<void>(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<Gio::Settings> settings)
+ Preferences::Preferences(Glib::RefPtr<Gio::Settings> 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<Glib::ustring, Gdk::RGBA>(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<Glib::ustring>{};
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 @@
<!-- interface-name preferences.ui -->
<requires lib="gtk" version="4.18"/>
<requires lib="libadwaita" version="1.7"/>
- <template class="gtkmm__CustomObject_preferences" parent="AdwPreferencesPage">
+ <template class="gtkmm__CustomObject_Preferences" parent="AdwPreferencesPage">
<property name="icon-name">preferences-system-symbolic</property>
<property name="title" translatable="yes">Preferences</property>
<child>
diff --git a/ui/src/tracker/actions.cpp b/ui/src/tracker/actions.cpp
index 5f1d2e0..7367dae 100644
--- a/ui/src/tracker/actions.cpp
+++ b/ui/src/tracker/actions.cpp
@@ -81,7 +81,7 @@ namespace turns::ui
auto tracker::preferences() -> void
{
- auto preferences = Gtk::make_managed<struct preferences>(m_settings);
+ auto preferences = Gtk::make_managed<struct Preferences>(m_settings);
auto dialog = Gtk::make_managed<Adwaita::PreferencesDialog>();
dialog->add(*preferences);
dialog->set_visible_page(*preferences);