summaryrefslogtreecommitdiff
path: root/Games
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-06 13:32:14 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-06 13:32:14 +0100
commitf8b00aa29010cc3a99b285d0afd88314c40be079 (patch)
tree578b042c504966843609d9c6260093d859e67306 /Games
parent9b87843af169b08f1b852da96f696004866783fe (diff)
downloadserenity-f8b00aa29010cc3a99b285d0afd88314c40be079.zip
LibGfx: Unpublish Gfx::Size from the global namespace
Diffstat (limited to 'Games')
-rw-r--r--Games/Minesweeper/Field.cpp2
-rw-r--r--Games/Minesweeper/Field.h4
-rw-r--r--Games/Minesweeper/main.cpp2
-rw-r--r--Games/Snake/SnakeGame.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/Games/Minesweeper/Field.cpp b/Games/Minesweeper/Field.cpp
index ddda972f3f..f75d697f10 100644
--- a/Games/Minesweeper/Field.cpp
+++ b/Games/Minesweeper/Field.cpp
@@ -119,7 +119,7 @@ public:
bool m_chord { false };
};
-Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, GUI::Widget* parent, Function<void(Size)> on_size_changed)
+Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, GUI::Widget* parent, Function<void(Gfx::Size)> on_size_changed)
: GUI::Frame(parent)
, m_face_button(face_button)
, m_flag_label(flag_label)
diff --git a/Games/Minesweeper/Field.h b/Games/Minesweeper/Field.h
index 5d99b0e3ec..305a3c83fa 100644
--- a/Games/Minesweeper/Field.h
+++ b/Games/Minesweeper/Field.h
@@ -65,7 +65,7 @@ class Field final : public GUI::Frame {
friend class Square;
friend class SquareLabel;
public:
- Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, GUI::Widget* parent, Function<void(Size)> on_size_changed);
+ Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_button, GUI::Widget* parent, Function<void(Gfx::Size)> on_size_changed);
virtual ~Field() override;
int rows() const { return m_rows; }
@@ -131,5 +131,5 @@ private:
bool m_chord_preview { false };
bool m_first_click { true };
bool m_single_chording { true };
- Function<void(Size)> m_on_size_changed;
+ Function<void(Gfx::Size)> m_on_size_changed;
};
diff --git a/Games/Minesweeper/main.cpp b/Games/Minesweeper/main.cpp
index c159fa9bd1..0f50ab8967 100644
--- a/Games/Minesweeper/main.cpp
+++ b/Games/Minesweeper/main.cpp
@@ -78,7 +78,7 @@ int main(int argc, char** argv)
auto time_icon_label = GUI::Label::construct(container);
time_icon_label->set_icon(Gfx::Bitmap::load_from_file("/res/icons/minesweeper/timer.png"));
auto time_label = GUI::Label::construct(container);
- auto field = Field::construct(*flag_label, *time_label, *face_button, widget, [&](Size size) {
+ auto field = Field::construct(*flag_label, *time_label, *face_button, widget, [&](auto size) {
size.set_height(size.height() + container->preferred_size().height());
window->resize(size);
});
diff --git a/Games/Snake/SnakeGame.cpp b/Games/Snake/SnakeGame.cpp
index 1c312c3485..ad32e03a73 100644
--- a/Games/Snake/SnakeGame.cpp
+++ b/Games/Snake/SnakeGame.cpp
@@ -196,7 +196,7 @@ void SnakeGame::keydown_event(GUI::KeyEvent& event)
Gfx::Rect SnakeGame::cell_rect(const Coordinate& coord) const
{
auto game_rect = rect();
- auto cell_size = Size(game_rect.width() / m_columns, game_rect.height() / m_rows);
+ auto cell_size = Gfx::Size(game_rect.width() / m_columns, game_rect.height() / m_rows);
return {
coord.column * cell_size.width(),
coord.row * cell_size.height(),