1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:47:45 +00:00

LibGUI+WindowServer: Add resize_aspect_ratio()

When a resize_aspect_ratio is specified, and window will only be resized
to a multiple of that ratio. When resize_aspect_ratio is set, windows
cannot be tiled.
This commit is contained in:
Peter Elliott 2020-08-21 14:19:10 -06:00 committed by Andreas Kling
parent c68537271c
commit 45ed58865e
8 changed files with 51 additions and 1 deletions

View file

@ -179,6 +179,10 @@ public:
void set_size_increment(const Gfx::IntSize&);
Gfx::IntSize base_size() const { return m_base_size; }
void set_base_size(const Gfx::IntSize&);
const Optional<Gfx::IntSize>& resize_aspect_ratio() const { return m_resize_aspect_ratio; }
void set_resize_aspect_ratio(int width, int height) { set_resize_aspect_ratio(Gfx::IntSize(width, height)); }
void set_no_resize_aspect_ratio() { set_resize_aspect_ratio({}); }
void set_resize_aspect_ratio(const Optional<Gfx::IntSize>& ratio);
void set_override_cursor(StandardCursor);
void set_override_cursor(const Gfx::Bitmap&);
@ -260,6 +264,7 @@ private:
bool m_double_buffering_enabled { true };
bool m_modal { false };
bool m_resizable { true };
Optional<Gfx::IntSize> m_resize_aspect_ratio {};
bool m_minimizable { true };
bool m_fullscreen { false };
bool m_frameless { false };