/* * SPDX-FileCopyrightText: 2025 Felix Morgner * SPDX-License-Identifier: LGPL-2.1-only */ #ifndef TURNS_GUI_PREFERENCES_HPP #define TURNS_GUI_PREFERENCES_HPP #include "template_widget.hpp" #include #include #include #include #include #include #include #include namespace Turns::gui { struct Preferences : template_widget { auto constexpr inline static children = std::array{ "friendly_reset_button", "hostile_reset_button", "secret_reset_button", "friendly_color_button", "hostile_color_button", "secret_color_button", "skip_defeated", }; explicit Preferences(Glib::RefPtr settings = {}); private: auto bind_reset(Glib::ustring const & key, Gtk::Button * button) -> void; auto bind_setting(Glib::ustring const & key, Gtk::ColorDialogButton * button) -> void; auto update_sensitive(Glib::ustring const & key, Gtk::Button * button) -> void; Glib::RefPtr m_settings; Gtk::Button * m_friendly_reset_button{}; Gtk::Button * m_hostile_reset_button{}; Gtk::Button * m_secret_reset_button{}; Gtk::ColorDialogButton * m_friendly_color_button{}; Gtk::ColorDialogButton * m_hostile_color_button{}; Gtk::ColorDialogButton * m_secret_color_button{}; Adwaita::SwitchRow * m_skip_defeated{}; }; } // namespace Turns::gui #endif