Fixes and improvements to the graphics module
This commit is contained in:
parent
2fb319840c
commit
e3757770c8
19 changed files with 161 additions and 55 deletions
|
|
@ -37,6 +37,8 @@ void FloatingWidget::eventUpdateConfiguration(WidgetManager& wm) {
|
|||
}
|
||||
|
||||
void FloatingWidget::checkFloating(const Events& events) {
|
||||
mDropped = false;
|
||||
|
||||
if (this->mHeader.isHolding() && events.getPointerDelta().length2() > 4) {
|
||||
mFloating = true;
|
||||
}
|
||||
|
|
@ -44,6 +46,7 @@ void FloatingWidget::checkFloating(const Events& events) {
|
|||
if (mFloating && this->mHeader.isReleased()) {
|
||||
mFloating = false;
|
||||
this->mHeader.clearEvents();
|
||||
mDropped = true;
|
||||
}
|
||||
|
||||
if (mFloating) {
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ void Widget::procWrapper(const Events& events, const RectF& parentArea) {
|
|||
|
||||
if (mHandlesEvents) {
|
||||
|
||||
eventProcess(events);
|
||||
|
||||
for (auto child : mChildWidgets) {
|
||||
child->procWrapper(events, mVisibleArea);
|
||||
}
|
||||
|
||||
eventProcess(events);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,17 +17,18 @@ void WorkspaceWidget::eventProcess(const Events& events) {
|
|||
for (auto floatingChild : mFloatingLayer.mChildWidgets) {
|
||||
auto widget = dynamic_cast<FloatingWidget*>(floatingChild.data());
|
||||
if (!widget) continue;
|
||||
if (widget->isFloating()) {
|
||||
if (widget->isReleased()) {
|
||||
auto side = mDockSpace.getPreviewSide();
|
||||
if (side != GridLayoutWidget::NONE) {
|
||||
mFloatingLayer.mChildWidgets.removeNode(mFloatingLayer.mChildWidgets.find(widget));
|
||||
widget->setCollapsed(false);
|
||||
widget->stopFloating();
|
||||
mDockSpace.addSideWidget(widget, side);
|
||||
}
|
||||
}
|
||||
|
||||
if (widget->mDropped) {
|
||||
auto side = mDockSpace.getPreviewSide();
|
||||
if (side != GridLayoutWidget::NONE) {
|
||||
mFloatingLayer.mChildWidgets.removeNode(mFloatingLayer.mChildWidgets.find(widget));
|
||||
widget->setCollapsed(false);
|
||||
widget->stopFloating();
|
||||
mDockSpace.addSideWidget(widget, side);
|
||||
}
|
||||
}
|
||||
|
||||
if (widget->isFloating()) {
|
||||
mDockSpace.mHandlesEvents = true;
|
||||
mDockSpace.mPreview = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue