1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:57:35 +00:00

GamesSettings: Paint the card preview frame using a CardGame subclass

We currently paint the 3 previewed cards using ImageWidget. This works
fine, but in order to preview a card hovering over a valid target card,
it will be easier to use the already-existing CardGame paint logic. So
this patch changes GamesSettings to display the preview as-is using a
CardGame.
This commit is contained in:
Timothy Flynn 2023-01-12 15:07:47 -05:00 committed by Sam Atkins
parent 208653a93c
commit c0756d8e55
3 changed files with 58 additions and 49 deletions

View file

@ -4,31 +4,10 @@
margins: [8]
}
@GUI::Frame {
@GamesSettings::Preview {
name: "cards_preview"
max_height: "shrink"
background_color: "green"
fill_with_background_color: true
layout: @GUI::HorizontalBoxLayout {
margins: [8]
spacing: 8
}
@GUI::Layout::Spacer {}
@GUI::ImageWidget {
name: "cards_preview_card_back"
}
@GUI::ImageWidget {
name: "cards_preview_card_front_ace"
}
@GUI::ImageWidget {
name: "cards_preview_card_front_queen"
}
@GUI::Layout::Spacer {}
fixed_height: 160
}
@GUI::GroupBox {