Chess: Allow resizing Chess using resize_aspect_ratio(1,1)

This commit is contained in:
Peter Elliott 2020-08-21 14:20:49 -06:00 committed by Andreas Kling
parent 45ed58865e
commit 274be68102
Notes: sideshowbarker 2024-07-19 03:16:30 +09:00
3 changed files with 2 additions and 7 deletions

View file

@ -102,11 +102,6 @@ void ChessWidget::paint_event(GUI::PaintEvent& event)
}
}
void ChessWidget::resize_event(GUI::ResizeEvent& event)
{
GUI::Widget::resize_event(event);
}
void ChessWidget::mousedown_event(GUI::MouseEvent& event)
{
GUI::Widget::mousedown_event(event);

View file

@ -43,7 +43,6 @@ public:
virtual ~ChessWidget() override;
virtual void paint_event(GUI::PaintEvent&) override;
virtual void resize_event(GUI::ResizeEvent&) override;
virtual void mousedown_event(GUI::MouseEvent&) override;
virtual void mouseup_event(GUI::MouseEvent&) override;
virtual void mousemove_event(GUI::MouseEvent&) override;

View file

@ -46,7 +46,8 @@ int main(int argc, char** argv)
auto size = config->read_num_entry("Display", "size", 512);
window->set_title("Chess");
window->resize(size, size);
window->set_resizable(false);
window->set_size_increment({ 8, 8 });
window->set_resize_aspect_ratio(1, 1);
auto icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/app-chess.png");
window->set_icon(icon);