mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 00:47:36 +00:00
GamesSettings: Move classes into the GamesSettings namespace
This is to allow registering future classes as with GML.
This commit is contained in:
parent
e241b47fee
commit
208653a93c
3 changed files with 9 additions and 1 deletions
|
@ -11,6 +11,8 @@
|
||||||
#include <LibGUI/FileSystemModel.h>
|
#include <LibGUI/FileSystemModel.h>
|
||||||
#include <LibGfx/Palette.h>
|
#include <LibGfx/Palette.h>
|
||||||
|
|
||||||
|
namespace GamesSettings {
|
||||||
|
|
||||||
static constexpr StringView default_card_back_image_path = "/res/icons/cards/buggie-deck.png"sv;
|
static constexpr StringView default_card_back_image_path = "/res/icons/cards/buggie-deck.png"sv;
|
||||||
|
|
||||||
CardSettingsWidget::CardSettingsWidget()
|
CardSettingsWidget::CardSettingsWidget()
|
||||||
|
@ -94,3 +96,5 @@ DeprecatedString CardSettingsWidget::card_back_image_path() const
|
||||||
card_back_image_index = card_back_selection.first();
|
card_back_image_index = card_back_selection.first();
|
||||||
return static_cast<GUI::FileSystemModel const*>(m_card_back_image_view->model())->full_path(card_back_image_index);
|
return static_cast<GUI::FileSystemModel const*>(m_card_back_image_view->model())->full_path(card_back_image_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#include <LibGUI/ModelIndex.h>
|
#include <LibGUI/ModelIndex.h>
|
||||||
#include <LibGUI/SettingsWindow.h>
|
#include <LibGUI/SettingsWindow.h>
|
||||||
|
|
||||||
|
namespace GamesSettings {
|
||||||
|
|
||||||
class CardSettingsWidget final : public GUI::SettingsWindow::Tab {
|
class CardSettingsWidget final : public GUI::SettingsWindow::Tab {
|
||||||
C_OBJECT(CardSettingsWidget)
|
C_OBJECT(CardSettingsWidget)
|
||||||
public:
|
public:
|
||||||
|
@ -38,3 +40,5 @@ private:
|
||||||
|
|
||||||
GUI::ModelIndex m_last_selected_card_back;
|
GUI::ModelIndex m_last_selected_card_back;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
|
|
||||||
auto window = TRY(GUI::SettingsWindow::create("Games Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
|
auto window = TRY(GUI::SettingsWindow::create("Games Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
|
||||||
window->set_icon(app_icon.bitmap_for_size(16));
|
window->set_icon(app_icon.bitmap_for_size(16));
|
||||||
(void)TRY(window->add_tab<CardSettingsWidget>("Cards"sv, "cards"sv));
|
(void)TRY(window->add_tab<GamesSettings::CardSettingsWidget>("Cards"sv, "cards"sv));
|
||||||
window->set_active_tab(selected_tab);
|
window->set_active_tab(selected_tab);
|
||||||
|
|
||||||
window->show();
|
window->show();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue