mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05:00
Minesweeper: Fix UI layout and focus behavior
Click-to-focus was visually annoying. Switch to tab-to-focus.
This commit is contained in:
parent
ec1a72b759
commit
a7ad0f14bf
2 changed files with 6 additions and 3 deletions
|
@ -33,7 +33,6 @@
|
|||
#include <LibGUI/Painter.h>
|
||||
#include <LibGfx/Palette.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
class SquareButton final : public GUI::Button {
|
||||
C_OBJECT(SquareButton);
|
||||
|
@ -56,7 +55,10 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
SquareButton() { }
|
||||
SquareButton()
|
||||
{
|
||||
set_focus_policy(GUI::FocusPolicy::TabFocus);
|
||||
}
|
||||
};
|
||||
|
||||
class SquareLabel final : public GUI::Label {
|
||||
|
|
|
@ -91,8 +91,9 @@ int main(int argc, char** argv)
|
|||
|
||||
auto& flag_label = container.add<GUI::Label>();
|
||||
auto& face_button = container.add<GUI::Button>();
|
||||
face_button.set_focus_policy(GUI::FocusPolicy::TabFocus);
|
||||
face_button.set_button_style(Gfx::ButtonStyle::CoolBar);
|
||||
face_button.set_fixed_width(36);
|
||||
face_button.set_fixed_size(36, 36);
|
||||
|
||||
auto& time_image = container.add<GUI::ImageWidget>();
|
||||
time_image.load_from_file("/res/icons/minesweeper/timer.png");
|
||||
|
|
Loading…
Add table
Reference in a new issue