13#include "layouting/Item_p.h"
14#include "layouting/LayoutingSeparator_p.h"
36bool rubberBandIsTopLevel()
44struct Separator::Private :
public LayoutingSeparator
50 : LayoutingSeparator(host, orientation, parentContainer)
58 Rect geometry()
const override
63 void setGeometry(Rect r)
override
76 View *lazyResizeRubberBand =
nullptr;
81Core::View *viewForLayoutingHost(LayoutingHost *host)
85 return layout->view();
91Separator::Separator(LayoutingHost *host,
Qt::Orientation orientation, Core::ItemBoxContainer *parentContainer)
93 , d(new Private(this, host, orientation, parentContainer))
98 rubberBandIsTopLevel() ?
nullptr :
view())
110 return d->isVertical();
115 return d->position();
123 Rect geo = d->m_geometry;
142 if (r == d->m_geometry)
157 d->LayoutingSeparator::setGeometry(
pos, pos2, length);
162 return d->m_orientation;
165void Separator::setLazyPosition(
int pos)
167 if (
pos == d->lazyPosition)
172 d->lazyPosition =
pos;
183 d->lazyResizeRubberBand->setGeometry(geo);
186bool Separator::usesLazyResize()
const
188 return d->usesLazyResize;
195 KDDW_DEBUG(
"Drag started");
197 if (d->lazyResizeRubberBand) {
199 d->lazyResizeRubberBand->show();
201 d->lazyResizeRubberBand->raise();
207 if (d->lazyResizeRubberBand) {
208 d->lazyResizeRubberBand->hide();
209 d->m_parentContainer->requestSeparatorMove(d, d->lazyPosition -
position());
219 d->m_parentContainer->requestEqualSize(d);
224 if (!d->isBeingDragged())
232 "Separator::onMouseMove: Ignoring spurious mouse event. Someone ate our ReleaseEvent");
237#ifdef KDDW_FRONTEND_QT_WINDOWS
239 const bool mouseButtonIsReallyDown =
240 (GetKeyState(VK_LBUTTON) & 0x8000) || (GetKeyState(VK_RBUTTON) & 0x8000);
241 if (!mouseButtonIsReallyDown) {
243 "Separator::onMouseMove: Ignoring spurious mouse event. Someone ate our ReleaseEvent");
250 if (d->lazyResizeRubberBand) {
251 const int positionToGoTo = d->onMouseMove(
pos,
false);
252 if (positionToGoTo != -1)
253 setLazyPosition(positionToGoTo);
255 d->onMouseMove(
pos,
true);
261 return d->m_parentContainer;
272 return LayoutingSeparator::s_separatorBeingDragged !=
nullptr;
281Separator::Private::~Private()
Application-wide config to tune certain behaviours of the framework.
A widget that supports an arbitrary number of splitters (called Separators) in any combination of ver...
static int s_numSeparators
internal counter just for unit-tests