From 3303de18cdb4c2c267a670fee4e2c2382b2fdd21 Mon Sep 17 00:00:00 2001 From: fourtf Date: Wed, 4 Jul 2018 19:52:11 +0200 Subject: [PATCH] added double click to resize handle --- src/widgets/splits/SplitContainer.cpp | 12 ++++++++++++ src/widgets/splits/SplitContainer.hpp | 1 + 2 files changed, 13 insertions(+) diff --git a/src/widgets/splits/SplitContainer.cpp b/src/widgets/splits/SplitContainer.cpp index 6a250204d..af3ef1c0c 100644 --- a/src/widgets/splits/SplitContainer.cpp +++ b/src/widgets/splits/SplitContainer.cpp @@ -1148,4 +1148,16 @@ void SplitContainer::ResizeHandle::mouseMoveEvent(QMouseEvent *event) } } +void SplitContainer::ResizeHandle::mouseDoubleClickEvent(QMouseEvent *event) +{ + event->accept(); + + for (auto &sibling : this->node->getParent()->getChildren()) { + sibling->flexH = 1; + sibling->flexV = 1; + } + + this->parent->layout(); +} + } // namespace chatterino diff --git a/src/widgets/splits/SplitContainer.hpp b/src/widgets/splits/SplitContainer.hpp index 900cb619d..5a80d1b0f 100644 --- a/src/widgets/splits/SplitContainer.hpp +++ b/src/widgets/splits/SplitContainer.hpp @@ -156,6 +156,7 @@ private: void mousePressEvent(QMouseEvent *event) override; void mouseReleaseEvent(QMouseEvent *event) override; void mouseMoveEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; friend class SplitContainer;