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

Add concept of size increments to windowing system.

Use this to implement incremental resizing for Terminal so that we only
ever resize to fit a perfect number of rows and columns.

This is very nice. :^)
This commit is contained in:
Andreas Kling 2019-02-21 00:21:23 +01:00
parent fd575055c2
commit 6084cd0c56
12 changed files with 47 additions and 4 deletions

View file

@ -61,6 +61,8 @@ void GWindow::show()
request.window.rect = m_rect_when_windowless;
request.window.has_alpha_channel = m_has_alpha_channel;
request.window.opacity = m_opacity_when_windowless;
request.window.size_increment = m_size_increment;
request.window.base_size = m_base_size;
ASSERT(m_title_when_windowless.length() < sizeof(request.text));
strcpy(request.text, m_title_when_windowless.characters());
request.text_length = m_title_when_windowless.length();

View file

@ -70,6 +70,11 @@ public:
GraphicsBitmap* backing() { return m_backing.ptr(); }
Size size_increment() const { return m_size_increment; }
void set_size_increment(const Size& increment) { m_size_increment = increment; }
Size base_size() const { return m_base_size; }
void set_base_size(const Size& size) { m_base_size = size; }
private:
virtual const char* class_name() const override { return "GWindow"; }
@ -83,6 +88,8 @@ private:
Rect m_rect_when_windowless;
String m_title_when_windowless;
Vector<Rect> m_pending_paint_event_rects;
Size m_size_increment;
Size m_base_size;
bool m_is_active { false };
bool m_should_exit_app_on_close { false };
bool m_has_alpha_channel { false };