diff options
author | Linus Groh <mail@linusgroh.de> | 2021-02-18 00:07:10 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-18 07:34:47 +0100 |
commit | b55c9f6bbac562215fa5c078757de8fd235f82d0 (patch) | |
tree | 67ecd4aeac187edeef0f26311de7c754a4cc10a2 /Userland/Games | |
parent | cfb0f3309d86d01bd4aa4cd026cf5f4f21db495a (diff) | |
download | serenity-b55c9f6bbac562215fa5c078757de8fd235f82d0.zip |
Conway: Set minumum window size to game columns x rows
The game renders no cells when the game widget height is < rows or width
is < columns, so let's set a minimum window size here.
Diffstat (limited to 'Userland/Games')
-rw-r--r-- | Userland/Games/Conway/Game.h | 3 | ||||
-rw-r--r-- | Userland/Games/Conway/main.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Games/Conway/Game.h b/Userland/Games/Conway/Game.h index effaca315f..29ff2ed56c 100644 --- a/Userland/Games/Conway/Game.h +++ b/Userland/Games/Conway/Game.h @@ -34,6 +34,9 @@ public: virtual ~Game() override; void reset(); + int rows() const { return m_rows; }; + int columns() const { return m_columns; }; + private: Game(); virtual void paint_event(GUI::PaintEvent&) override; diff --git a/Userland/Games/Conway/main.cpp b/Userland/Games/Conway/main.cpp index 317674b86a..d266d3bfdb 100644 --- a/Userland/Games/Conway/main.cpp +++ b/Userland/Games/Conway/main.cpp @@ -66,6 +66,7 @@ int main(int argc, char** argv) window->set_icon(app_icon.bitmap_for_size(16)); auto& game = window->set_main_widget<Game>(); + window->set_minimum_size(game.columns(), game.rows()); auto menubar = GUI::MenuBar::construct(); |