summaryrefslogtreecommitdiff
path: root/Userland/Games/Solitaire/Solitaire.gml
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-05-05 12:19:10 -0400
committerAndreas Kling <kling@serenityos.org>2021-05-05 21:38:45 +0200
commit4fc9c1d710636a0376313b20eb5544f490452edf (patch)
tree13ad6696dda63e744f64251861b03c710e6e99fa /Userland/Games/Solitaire/Solitaire.gml
parentbb7b76e505c8861e98e71bc4d8d5f3f4dd4c5d1a (diff)
downloadserenity-4fc9c1d710636a0376313b20eb5544f490452edf.zip
Solitaire: Refactor painting logic to accomodate to-be-added widgets
A series of events led to this change: The goal is to add more widgets to the Solitaire GML, such as a GUI::Statusbar. To do so without this change, the window ends up with some black artifacts between the main Solitaire frame and the added elements, because the GML specifies the main widget to have fill_with_background_color=false. However, setting that property to true results in the background color of the widget interferring with the Solitaire frame trying to manually paint its background green. This results in flickering and some elements in the Solitaire frame being painted over by the main background color. To avoid all of that behavior, this sets fill_with_background_color=true and the Solitaire frame's background color to green in the GML. Further, the frame now only queues a paint update on the specific Gfx::Rect areas that need to be updated. This also means we no longer need to track if a stack of cards is dirty, because we only trigger a paint event for dirty stacks.
Diffstat (limited to 'Userland/Games/Solitaire/Solitaire.gml')
-rw-r--r--Userland/Games/Solitaire/Solitaire.gml4
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Games/Solitaire/Solitaire.gml b/Userland/Games/Solitaire/Solitaire.gml
index e588ef1d58..d72f90c547 100644
--- a/Userland/Games/Solitaire/Solitaire.gml
+++ b/Userland/Games/Solitaire/Solitaire.gml
@@ -1,10 +1,12 @@
@GUI::Widget {
- fill_with_background_color: false
+ fill_with_background_color: true
layout: @GUI::VerticalBoxLayout {
}
@Solitaire::Game {
name: "game"
+ fill_with_background_color: true
+ background_color: "green"
}
}