mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
GamesSettings: Rename Preview
-> CardGamePreview
This commit is contained in:
parent
286e3e6872
commit
66f2f4d647
Notes:
sideshowbarker
2024-07-17 00:52:51 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/66f2f4d647 Pull-request: https://github.com/SerenityOS/serenity/pull/17275
3 changed files with 10 additions and 10 deletions
|
@ -18,13 +18,13 @@ namespace GamesSettings {
|
|||
|
||||
static constexpr StringView default_card_back_image_path = "/res/icons/cards/buggie-deck.png"sv;
|
||||
|
||||
class Preview final : public Cards::CardGame {
|
||||
C_OBJECT_ABSTRACT(Preview)
|
||||
class CardGamePreview final : public Cards::CardGame {
|
||||
C_OBJECT_ABSTRACT(CardGamePreview)
|
||||
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<Preview>> try_create()
|
||||
static ErrorOr<NonnullRefPtr<CardGamePreview>> try_create()
|
||||
{
|
||||
auto preview = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) Preview()));
|
||||
auto preview = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) CardGamePreview()));
|
||||
|
||||
Gfx::IntPoint point { 25, 30 };
|
||||
TRY(preview->add_stack(point, Cards::CardStack::Type::Stock));
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
Preview() = default;
|
||||
CardGamePreview() = default;
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent& event) override
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ CardSettingsWidget::CardSettingsWidget()
|
|||
|
||||
auto background_color = Gfx::Color::from_string(Config::read_string("Games"sv, "Cards"sv, "BackgroundColor"sv)).value_or(Gfx::Color::from_rgb(0x008000));
|
||||
|
||||
m_preview_frame = find_descendant_of_type_named<Preview>("cards_preview");
|
||||
m_preview_frame = find_descendant_of_type_named<CardGamePreview>("cards_preview");
|
||||
m_preview_frame->set_background_color(background_color);
|
||||
|
||||
m_background_color_input = find_descendant_of_type_named<GUI::ColorInput>("cards_background_color");
|
||||
|
@ -136,4 +136,4 @@ DeprecatedString CardSettingsWidget::card_back_image_path() const
|
|||
|
||||
}
|
||||
|
||||
REGISTER_WIDGET(GamesSettings, Preview);
|
||||
REGISTER_WIDGET(GamesSettings, CardGamePreview);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
margins: [8]
|
||||
}
|
||||
|
||||
@GamesSettings::Preview {
|
||||
@GamesSettings::CardGamePreview {
|
||||
name: "cards_preview"
|
||||
fill_with_background_color: true
|
||||
fixed_height: 160
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace GamesSettings {
|
||||
|
||||
class Preview;
|
||||
class CardGamePreview;
|
||||
|
||||
class CardSettingsWidget final : public GUI::SettingsWindow::Tab {
|
||||
C_OBJECT(CardSettingsWidget)
|
||||
|
@ -31,7 +31,7 @@ private:
|
|||
bool set_card_back_image_path(DeprecatedString const&);
|
||||
DeprecatedString card_back_image_path() const;
|
||||
|
||||
RefPtr<Preview> m_preview_frame;
|
||||
RefPtr<CardGamePreview> m_preview_frame;
|
||||
RefPtr<GUI::ColorInput> m_background_color_input;
|
||||
RefPtr<GUI::IconView> m_card_back_image_view;
|
||||
|
||||
|
|
Loading…
Reference in a new issue