From b15df34cc40948afee46035c822aee7384c7bb94 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Mon, 4 Mar 2019 18:21:28 +0200 Subject: [PATCH] livemode:enable parabolic effect for editMode --first commit to restructure editMode in order to support livemode under editing. Live mode means that all options changes during editMode will be available to be tested directly --- app/view/settings/primaryconfigview.cpp | 2 +- app/view/settings/secondaryconfigview.cpp | 2 +- containment/package/contents/ui/ConfigOverlay.qml | 15 ++++++++------- .../package/contents/ui/applet/AppletItem.qml | 6 +++--- .../package/contents/ui/applet/ItemWrapper.qml | 2 +- plasmoid/package/contents/ui/task/TaskItem.qml | 10 +++------- plasmoid/package/contents/ui/task/Wrapper.qml | 2 +- 7 files changed, 18 insertions(+), 21 deletions(-) diff --git a/app/view/settings/primaryconfigview.cpp b/app/view/settings/primaryconfigview.cpp index 1304b1ff9..6139e109f 100644 --- a/app/view/settings/primaryconfigview.cpp +++ b/app/view/settings/primaryconfigview.cpp @@ -152,7 +152,7 @@ void PrimaryConfigView::init() inline Qt::WindowFlags PrimaryConfigView::wFlags() const { - return (flags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) & ~Qt::WindowDoesNotAcceptFocus; + return (flags() | Qt::FramelessWindowHint) & ~Qt::WindowDoesNotAcceptFocus; } QWindow *PrimaryConfigView::secondaryWindow() diff --git a/app/view/settings/secondaryconfigview.cpp b/app/view/settings/secondaryconfigview.cpp index d1491d06d..a95aa68e6 100644 --- a/app/view/settings/secondaryconfigview.cpp +++ b/app/view/settings/secondaryconfigview.cpp @@ -133,7 +133,7 @@ void SecondaryConfigView::init() inline Qt::WindowFlags SecondaryConfigView::wFlags() const { - return (flags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) & ~Qt::WindowDoesNotAcceptFocus; + return (flags() | Qt::FramelessWindowHint) & ~Qt::WindowDoesNotAcceptFocus; } QRect SecondaryConfigView::geometryWhenVisible() const diff --git a/containment/package/contents/ui/ConfigOverlay.qml b/containment/package/contents/ui/ConfigOverlay.qml index 671cd2d62..593b2804f 100644 --- a/containment/package/contents/ui/ConfigOverlay.qml +++ b/containment/package/contents/ui/ConfigOverlay.qml @@ -31,7 +31,8 @@ MouseArea { z: 1000 anchors.fill: parent - hoverEnabled: true + enabled: false + // hoverEnabled: true cursorShape: { if (currentApplet && tooltip.visible && currentApplet.applet @@ -146,9 +147,9 @@ MouseArea { var relevantLayout = mapFromItem(layoutsContainer.mainLayout, 0, 0); handle.x = relevantLayout.x + currentApplet.x; - handle.y = relevantLayout.y + currentApplet.y; + handle.y = relevantLayout.y + currentApplet.y + currentApplet.height / 2; handle.width = currentApplet.width; - handle.height = currentApplet.height; + handle.height = currentApplet.height / 2; lockButton.checked = currentApplet.lockZoom; colorizingButton.checked = !currentApplet.userBlocksColorizing; @@ -294,9 +295,9 @@ MouseArea { var transformChoords = root.mapFromItem(currentApplet, 0, 0) handle.x = transformChoords.x; - handle.y = transformChoords.y; + handle.y = transformChoords.y + currentApplet.height / 2; handle.width = currentApplet.width; - handle.height = currentApplet.height; + handle.height = currentApplet.height / 2; repositionHandler.restart(); } @@ -416,14 +417,14 @@ MouseArea { label.text = currentApplet.isInternalViewSplitter ? i18n("Justify Splitter") : currentApplet.applet.title; } else { - if (currentApplet === ruler) { + /* if (currentApplet === ruler) { configureButton.visible = false; closeButton.visible = false; lockButton.visible = false; colorizingButton.visible = false; label.text = ruler.tooltip; - tooltip.visible = true; + tooltip.visible = true; */ } } } diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index 701b23a72..a9169cb7d 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -609,8 +609,8 @@ Item { id: appletMouseArea anchors.fill: parent - enabled: applet && !latteApplet && canBeHovered && !root.editMode && !lockZoom && communicator.parabolicEffectEnabled - hoverEnabled: !root.editMode && (!latteApplet) ? true : false + enabled: applet && !latteApplet && canBeHovered && !lockZoom && communicator.parabolicEffectEnabled + hoverEnabled: latteApplet ? false : true propagateComposedEvents: true //! a way must be found in order for this be enabled @@ -618,7 +618,7 @@ Item { //! also on this is based the tooltips behavior by enabling it //! plasma tooltips are disabled visible: applet && !appletItem.latteApplet && !lockZoom && communicator.parabolicEffectEnabled - && canBeHovered && !(appletItem.isSeparator && !root.editMode) + && canBeHovered && !appletItem.isSeparator property bool blockWheel: false property bool pressed: false diff --git a/containment/package/contents/ui/applet/ItemWrapper.qml b/containment/package/contents/ui/applet/ItemWrapper.qml index c961f3918..77e589198 100644 --- a/containment/package/contents/ui/applet/ItemWrapper.qml +++ b/containment/package/contents/ui/applet/ItemWrapper.qml @@ -621,7 +621,7 @@ Item{ } function calculateScales( currentMousePosition ){ - if (root.editMode || root.zoomFactor===1 || root.durationTime===0) { + if (root.zoomFactor===1 || root.durationTime===0) { return; } diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 2e9344c34..7ccfc1622 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -78,7 +78,7 @@ MouseArea{ acceptedButtons: Qt.LeftButton | Qt.MidButton | Qt.RightButton hoverEnabled: visible && (!inAnimation) && (!IsStartup) && (!root.taskInAnimation) - && (!root.editMode || root.debugLocation)&&(!inBouncingAnimation) && !isSeparator + &&(!inBouncingAnimation) && !isSeparator // hoverEnabled: false //opacity : isSeparator && (hiddenSpacerLeft.neighbourSeparator || hiddenSpacerRight.neighbourSeparator) ? 0 : 1 @@ -545,9 +545,6 @@ MouseArea{ ///////////////// Mouse Area Events /////////////////// onEntered: { - if (root.editMode) - return; - root.stopCheckRestoreZoomTimer(); if (restoreAnimation.running) { @@ -620,7 +617,7 @@ MouseArea{ //! onPositionChanged signal may be delayed. we can fix this by don't delay at all //! when mouseX-Y is updated based on the plasmoid formFactor function mousePosChanged(mousePos) { - if (root.editMode || mousePos<0 || + if (mousePos<0 || (inBlockingAnimation && !(inAttentionAnimation||inFastRestoreAnimation||inMimicParabolicAnimation))) return; @@ -672,7 +669,7 @@ MouseArea{ onPositionChanged: { - if (root.editMode || (inBlockingAnimation && !(inAttentionAnimation||inFastRestoreAnimation||inMimicParabolicAnimation))) + if ((inBlockingAnimation && !(inAttentionAnimation||inFastRestoreAnimation||inMimicParabolicAnimation))) return; if (root.latteView && root.latteView.isHalfShown) { @@ -683,7 +680,6 @@ MouseArea{ // mouse.button is always 0 here, hence checking with mouse.buttons if (pressX != -1 && mouse.buttons == Qt.LeftButton && isDragged - && !root.editMode && dragHelper.isDrag(pressX, pressY, mouse.x, mouse.y) ) { root.dragSource = taskItem; dragHelper.startDrag(taskItem, model.MimeType, model.MimeData, diff --git a/plasmoid/package/contents/ui/task/Wrapper.qml b/plasmoid/package/contents/ui/task/Wrapper.qml index 517bd24a2..702f8a51e 100644 --- a/plasmoid/package/contents/ui/task/Wrapper.qml +++ b/plasmoid/package/contents/ui/task/Wrapper.qml @@ -142,7 +142,7 @@ Item{ } function calculateScales( currentMousePosition ){ - if (root.editMode || root.zoomFactor===1 || root.durationTime===0) { + if (root.zoomFactor===1 || root.durationTime===0) { return; }