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
70#ifdef KDDW_FRONTEND_QT
87 View *lazyResizeRubberBand =
nullptr;
92Core::View *viewForLayoutingHost(LayoutingHost *host)
96 return layout->view();
102Separator::Separator(LayoutingHost *host,
Qt::Orientation orientation, Core::ItemBoxContainer *parentContainer)
104 , d(new Private(this, host, orientation, parentContainer))
109 rubberBandIsTopLevel() ?
nullptr :
view())
121 return d->isVertical();
126 return d->position();
131 if (r == d->m_geometry)
143void Separator::setLazyPosition(
int pos)
145 if (
pos == d->lazyPosition)
150 d->lazyPosition =
pos;
161 d->lazyResizeRubberBand->setGeometry(geo);
164bool Separator::usesLazyResize()
const
166 return d->usesLazyResize;
173 KDDW_DEBUG(
"Drag started");
175 if (d->lazyResizeRubberBand) {
177 d->lazyResizeRubberBand->show();
179 d->lazyResizeRubberBand->raise();
185 if (d->lazyResizeRubberBand) {
186 d->lazyResizeRubberBand->hide();
187 d->m_parentContainer->requestSeparatorMove(d, d->lazyPosition -
position());
197 d->m_parentContainer->requestEqualSize(d);
202 if (!d->isBeingDragged())
210 "Separator::onMouseMove: Ignoring spurious mouse event. Someone ate our ReleaseEvent");
215#ifdef KDDW_FRONTEND_QT_WINDOWS
217 const bool mouseButtonIsReallyDown =
218 (GetKeyState(VK_LBUTTON) & 0x8000) || (GetKeyState(VK_RBUTTON) & 0x8000);
219 if (!mouseButtonIsReallyDown) {
221 "Separator::onMouseMove: Ignoring spurious mouse event. Someone ate our ReleaseEvent");
228 if (d->lazyResizeRubberBand) {
229 const int positionToGoTo = d->onMouseMove(
pos,
false);
230 if (positionToGoTo != -1)
231 setLazyPosition(positionToGoTo);
233 d->onMouseMove(
pos,
true);
245 return LayoutingSeparator::s_separatorBeingDragged !=
nullptr;
254Separator::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