summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Window.h
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2023-04-14 08:51:46 -0400
committerAndreas Kling <kling@serenityos.org>2023-04-15 15:24:50 +0200
commitaa94b944deaece5d970c5f822ba3ab80d2ef223f (patch)
tree22d2c368de342d72e7908ccf36d1e11ff3a1f622 /Userland/Libraries/LibGUI/Window.h
parentac2f1098f7fc93d85d726238e2b899e1cc2e19b9 (diff)
downloadserenity-aa94b944deaece5d970c5f822ba3ab80d2ef223f.zip
LibGUI: Allow Windows to auto shrink
Previously Windows automatically grew to accomodate layout changes when obeying minimum widget size but would not automatically shrink if so desired. Setting auto shrink true now automatically resizes windows to their effective_min_size() every time their minimum size updates. This will be useful for making fixed size windows responsive to layout and font changes in the future.
Diffstat (limited to 'Userland/Libraries/LibGUI/Window.h')
-rw-r--r--Userland/Libraries/LibGUI/Window.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h
index 41670a9753..e3f055bd68 100644
--- a/Userland/Libraries/LibGUI/Window.h
+++ b/Userland/Libraries/LibGUI/Window.h
@@ -63,6 +63,9 @@ public:
bool is_obeying_widget_min_size() { return m_obey_widget_min_size; }
void set_obey_widget_min_size(bool);
+ bool is_auto_shrinking() const { return m_auto_shrink; }
+ void set_auto_shrink(bool);
+
bool is_minimizable() const { return m_minimizable; }
void set_minimizable(bool minimizable) { m_minimizable = minimizable; }
@@ -321,6 +324,7 @@ private:
bool m_moved_by_client { false };
bool m_blocks_emoji_input { false };
bool m_resizing { false };
+ bool m_auto_shrink { false };
};
}