summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/Splitter.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-11 11:33:01 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-11 11:53:38 +0100
commit1fc887c5767cfced4df3af10d1f0d15685c1022f (patch)
tree0fe32a7ca3ad1209d17dc3bb36e1892f9418218e /Libraries/LibGUI/Splitter.h
parent3f58f0e87ca5fbecfd5b14446fe6f3f9ac8750b8 (diff)
downloadserenity-1fc887c5767cfced4df3af10d1f0d15685c1022f.zip
LibGUI: Only highlight grabbable area between a Splitter's children
We were previously cheating by setting the entire splitter's background color to the hover highlight color. This looked goofy whenever there were transparent widgets inside a splitter, since the highlighted color would shine through when hovering. This was especially noticeable in SystemMonitor, which now looks much better. :^)
Diffstat (limited to 'Libraries/LibGUI/Splitter.h')
-rw-r--r--Libraries/LibGUI/Splitter.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/Splitter.h b/Libraries/LibGUI/Splitter.h
index 4cf876648c..1cf946b608 100644
--- a/Libraries/LibGUI/Splitter.h
+++ b/Libraries/LibGUI/Splitter.h
@@ -38,13 +38,18 @@ public:
protected:
Splitter(Orientation, Widget* parent);
+ virtual void paint_event(PaintEvent&) override;
+ virtual void resize_event(ResizeEvent&) override;
virtual void mousedown_event(MouseEvent&) override;
virtual void mousemove_event(MouseEvent&) override;
virtual void mouseup_event(MouseEvent&) override;
virtual void enter_event(Core::Event&) override;
virtual void leave_event(Core::Event&) override;
+ virtual void did_layout() override;
+
private:
+ void recompute_grabbable_rect(const Widget&, const Widget&);
void get_resize_candidates_at(const Gfx::Point&, Widget*&, Widget*&);
Orientation m_orientation;
@@ -54,6 +59,7 @@ private:
WeakPtr<Widget> m_second_resizee;
Gfx::Size m_first_resizee_start_size;
Gfx::Size m_second_resizee_start_size;
+ Gfx::Rect m_grabbable_rect;
};
class VerticalSplitter final : public Splitter {