summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Splitter.h
diff options
context:
space:
mode:
authorthankyouverycool <66646555+thankyouverycool@users.noreply.github.com>2022-02-20 08:07:31 -0500
committerIdan Horowitz <idan.horowitz@gmail.com>2022-02-23 18:56:22 +0200
commitc3ce56224021eb138de7cf000894220dbe9293be (patch)
treecab0dec13127dc5fec26591e0dd11a5eec722995 /Userland/Libraries/LibGUI/Splitter.h
parent495fd1d2c4ebce338a3bc2b231eea7bc4f7001bd (diff)
downloadserenity-c3ce56224021eb138de7cf000894220dbe9293be.zip
LibGUI+Apps: Let Splitters select which resizee to set fixed
This gives Splitters more versatility when the right resizee is intended to remain fixed or be toggled on and off.
Diffstat (limited to 'Userland/Libraries/LibGUI/Splitter.h')
-rw-r--r--Userland/Libraries/LibGUI/Splitter.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Splitter.h b/Userland/Libraries/LibGUI/Splitter.h
index 5661492ecf..911c6b5029 100644
--- a/Userland/Libraries/LibGUI/Splitter.h
+++ b/Userland/Libraries/LibGUI/Splitter.h
@@ -14,6 +14,11 @@ class Splitter : public Widget {
C_OBJECT(Splitter);
public:
+ enum class FixedResizee {
+ First,
+ Second
+ };
+
virtual ~Splitter() override;
int first_resizee_minimum_size() { return m_first_resizee_minimum_size; }
@@ -33,6 +38,9 @@ protected:
virtual void did_layout() override;
+ FixedResizee fixed_resizee() const { return m_fixed_resizee; }
+ void set_fixed_resizee(FixedResizee resizee) { m_fixed_resizee = resizee; }
+
private:
void override_cursor(bool do_override);
Gfx::IntRect rect_between_widgets(GUI::Widget const& first_widget, GUI::Widget const& second_widget, bool honor_grabbable_margins) const;
@@ -47,6 +55,7 @@ private:
Gfx::IntSize m_second_resizee_start_size;
int m_first_resizee_minimum_size { 0 };
int m_second_resizee_minimum_size { 0 };
+ FixedResizee m_fixed_resizee { FixedResizee::First };
void recompute_grabbables();