From f84043d28ecf6e94be31d949af97116274ab936d Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 8 Dec 2018 18:35:32 +0200 Subject: [PATCH] REFACTOR:change dock in containment to latteView --- app/view/view.cpp | 2 +- .../package/contents/ui/ConfigOverlay.qml | 2 +- .../package/contents/ui/DebugWindow.qml | 40 ++-- .../package/contents/ui/EditModeVisual.qml | 16 +- .../package/contents/ui/LayoutsContainer.qml | 14 +- containment/package/contents/ui/PanelBox.qml | 10 +- .../package/contents/ui/RootMouseArea.qml | 14 +- containment/package/contents/ui/Ruler.qml | 2 +- .../package/contents/ui/RulerMouseArea.qml | 2 +- .../package/contents/ui/VisibilityManager.qml | 186 +++++++++--------- .../package/contents/ui/applet/AppletItem.qml | 16 +- .../contents/ui/applet/AppletItemWrapper.qml | 2 +- .../ui/applet/communicator/LatteBridge.qml | 2 +- .../ui/colorizer/BackgroundTracker.qml | 8 +- .../ui/colorizer/CustomBackground.qml | 16 +- .../package/contents/ui/colorizer/Manager.qml | 4 +- containment/package/contents/ui/main.qml | 178 ++++++++--------- plasmoid/package/contents/ui/main.qml | 14 +- shell/package/contents/views/Panel.qml | 24 +-- 19 files changed, 276 insertions(+), 276 deletions(-) diff --git a/app/view/view.cpp b/app/view/view.cpp index 7f48e2f64..b43a6ab37 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -192,7 +192,7 @@ void View::init() connect(m_contextMenu, &ViewPart::ContextMenu::menuChanged, this, &View::contextMenuIsShownChanged); ///!!!!! - rootContext()->setContextProperty(QStringLiteral("dock"), this); + rootContext()->setContextProperty(QStringLiteral("latteView"), this); auto *latteCorona = qobject_cast(this->corona()); diff --git a/containment/package/contents/ui/ConfigOverlay.qml b/containment/package/contents/ui/ConfigOverlay.qml index 0766b7035..ce2cfc9b1 100644 --- a/containment/package/contents/ui/ConfigOverlay.qml +++ b/containment/package/contents/ui/ConfigOverlay.qml @@ -407,7 +407,7 @@ MouseArea { configureButton.visible = !currentApplet.isInternalViewSplitter && (currentApplet.applet.pluginName !== root.plasmoidName) && currentApplet.applet.action("configure") && currentApplet.applet.action("configure").enabled; closeButton.visible = !currentApplet.isInternalViewSplitter && currentApplet.applet.action("remove") && currentApplet.applet.action("remove").enabled - && !(currentApplet.applet.pluginName===root.plasmoidName && dock && dock.managedLayout.viewsWithTasks()===1 && dock.tasksPresent()); + && !(currentApplet.applet.pluginName===root.plasmoidName && latteView && latteView.managedLayout.viewsWithTasks()===1 && latteView.tasksPresent()); lockButton.visible = !currentApplet.isInternalViewSplitter && (currentApplet.applet.pluginName !== "org.kde.plasma.systemtray") && (currentApplet.applet.pluginName !== root.plasmoidName) && !currentApplet.isSeparator diff --git a/containment/package/contents/ui/DebugWindow.qml b/containment/package/contents/ui/DebugWindow.qml index e54ddcb0a..a644b188f 100644 --- a/containment/package/contents/ui/DebugWindow.qml +++ b/containment/package/contents/ui/DebugWindow.qml @@ -51,7 +51,7 @@ Window{ } Text{ - text: dock && dock.positioner ? dock.positioner.currentScreenName : "___" + text: latteView && latteView.positioner ? latteView.positioner.currentScreenName : "___" } Text{ @@ -60,8 +60,8 @@ Window{ Text{ text: { - if (dock && dock.screenGeometry){ - return dock.screenGeometry.x+","+dock.screenGeometry.y+ " "+dock.screenGeometry.width+"x"+dock.screenGeometry.height; + if (latteView && latteView.screenGeometry){ + return latteView.screenGeometry.x+","+dock.screenGeometry.y+ " "+dock.screenGeometry.width+"x"+dock.screenGeometry.height; } else { return "_,_ _x_"; } @@ -74,8 +74,8 @@ Window{ Text{ text: { - if (dock) { - return dock.x + "," + dock.y + " "+dock.width+ "x"+dock.height; + if (latteView) { + return latteView.x + "," + latteView.y + " "+dock.width+ "x"+dock.height; } else { return "_,_ _x_"; } @@ -88,7 +88,7 @@ Window{ Text{ text: { - if (dock && dock.onPrimary) + if (latteView && latteView.onPrimary) return "Yes"; else return "No"; @@ -149,8 +149,8 @@ Window{ Text{ text: { - if (dock && dock.effects && dock.effects.mask) { - return dock.effects.mask.x +", "+ dock.effects.mask.y+" "+dock.effects.mask.width+"x"+dock.effects.mask.height; + if (latteView && latteView.effects && latteView.effects.mask) { + return latteView.effects.mask.x +", "+ latteView.effects.mask.y+" "+dock.effects.mask.width+"x"+dock.effects.mask.height; } else { return "_,_ _x_"; } @@ -163,8 +163,8 @@ Window{ Text{ text: { - if (dock && dock.absoluteGeometry) { - return dock.absoluteGeometry.x + ", " + dock.absoluteGeometry.y + " " + dock.absoluteGeometry.width + "x" + dock.absoluteGeometry.height; + if (latteView && latteView.absoluteGeometry) { + return latteView.absoluteGeometry.x + ", " + latteView.absoluteGeometry.y + " " + latteView.absoluteGeometry.width + "x" + latteView.absoluteGeometry.height; } else { return "_,_ _x_"; } @@ -177,8 +177,8 @@ Window{ Text{ text: { - if (dock && dock.localGeometry) { - return dock.localGeometry.x + ", " + dock.localGeometry.y + " " + dock.localGeometry.width + "x" + dock.localGeometry.height; + if (latteView && latteView.localGeometry) { + return latteView.localGeometry.x + ", " + latteView.localGeometry.y + " " + latteView.localGeometry.width + "x" + latteView.localGeometry.height; } else { return "_,_ _x_"; } @@ -191,7 +191,7 @@ Window{ Text{ text: { - if (dock && dock.effects && dock.effects.drawEffects) + if (latteView && latteView.effects && latteView.effects.drawEffects) return "Yes"; else return "No"; @@ -204,8 +204,8 @@ Window{ Text{ text: { - if (dock && dock.effects && dock.effects.rect) { - return dock.effects.rect.x + ", " + dock.effects.rect.y + " " +dock.effects.rect.width + "x" + dock.effects.rect.height; + if (latteView && latteView.effects && latteView.effects.rect) { + return latteView.effects.rect.x + ", " + latteView.effects.rect.y + " " +dock.effects.rect.width + "x" + latteView.effects.rect.height; } else { return "_,_ _x_"; } @@ -226,7 +226,7 @@ Window{ Text{ text: { - if (dock && dock.visibility && dock.visibility.isHidden) + if (latteView && latteView.visibility && latteView.visibility.isHidden) return "Yes"; else return "No"; @@ -247,7 +247,7 @@ Window{ Text{ text: { - if (dock && dock.visibility && dock.visibility.containsMouse) + if (latteView && latteView.visibility && latteView.visibility.containsMouse) return "Yes"; else return "No"; @@ -337,10 +337,10 @@ Window{ Text{ text: { - if (!dock || !dock.visibility) + if (!latteView || !latteView.visibility) return ""; - switch(dock.visibility.mode){ + switch(latteView.visibility.mode){ case Latte.Types.AlwaysVisible: return "Always Visible"; break; @@ -361,7 +361,7 @@ Window{ break; } - return " : " + dock.visibility.mode; + return " : " + latteView.visibility.mode; } } diff --git a/containment/package/contents/ui/EditModeVisual.qml b/containment/package/contents/ui/EditModeVisual.qml index 92f802645..6afb884af 100644 --- a/containment/package/contents/ui/EditModeVisual.qml +++ b/containment/package/contents/ui/EditModeVisual.qml @@ -28,9 +28,9 @@ import org.kde.latte 0.2 as Latte Item{ id: editVisual - width: root.isHorizontal ? (dock ? dock.width : root.width) : + width: root.isHorizontal ? (latteView ? latteView.width : root.width) : visibilityManager.thicknessNormalOriginal + theme.defaultFont.pixelSize - height: root.isVertical ? (dock ? dock.height : root.height) : + height: root.isVertical ? (latteView ? latteView.height : root.height) : visibilityManager.thicknessNormalOriginal + theme.defaultFont.pixelSize opacity: 0 @@ -51,7 +51,7 @@ Item{ property rect efGeometry - property string layoutColor: root.dockManagedLayout ? root.dockManagedLayout.color : "blue" + property string layoutColor: root.latteViewManagedLayout ? root.latteViewManagedLayout.color : "blue" Item{ @@ -158,9 +158,9 @@ Item{ opacity: editVisual.editStateOpacity fillMode: Image.Tile - source: hasBackground ? dock.managedLayout.background : "../icons/"+editVisual.layoutColor+"print.jpg" + source: hasBackground ? latteView.managedLayout.background : "../icons/"+editVisual.layoutColor+"print.jpg" - readonly property bool hasBackground: (dock && dock.managedLayout && dock.managedLayout.background.startsWith("/")) ? + readonly property bool hasBackground: (latteView && latteView.managedLayout && latteView.managedLayout.background.startsWith("/")) ? true : false } @@ -197,7 +197,7 @@ Item{ } function updateEffectsArea(){ - if (!dock || state !== "edit" || !editAnimationEnded) + if (!latteView || state !== "edit" || !editAnimationEnded) return; var rootGeometry = mapToItem(root, 0, 0); @@ -207,7 +207,7 @@ Item{ efGeometry.width = width; efGeometry.height = height; - dock.effects.rect = efGeometry; + latteView.effects.rect = efGeometry; } @@ -317,7 +317,7 @@ Item{ ScriptAction{ script: { //! remove kwin effects when starting the animation - dock.effects.rect = Qt.rect(-1, -1, 0, 0); + latteView.effects.rect = Qt.rect(-1, -1, 0, 0); } } diff --git a/containment/package/contents/ui/LayoutsContainer.qml b/containment/package/contents/ui/LayoutsContainer.qml index 842a9bcc7..6d978a219 100644 --- a/containment/package/contents/ui/LayoutsContainer.qml +++ b/containment/package/contents/ui/LayoutsContainer.qml @@ -31,7 +31,7 @@ import "../code/HeuristicTools.js" as HeuristicTools Item{ id: layoutsContainer - readonly property bool isHidden: root.inStartup || (dock && dock.visibility && dock.visibility.isHidden) + readonly property bool isHidden: root.inStartup || (latteView && latteView.visibility && latteView.visibility.isHidden) readonly property bool useMaxLength: (plasmoid.configuration.panelPosition === Latte.Types.Justify) && ((!root.editMode && !root.behaveAsPlasmaPanel ) || (behaveAsPlasmaPanel && root.editMode)) @@ -50,8 +50,8 @@ Item{ target: layoutsContainer property: "x" value: { - if ( dock && root.isHorizontal && useMaxLength ){ - return ((dock.width/2) - (root.maxLength/2)); // + root.offset) + if ( latteView && root.isHorizontal && useMaxLength ){ + return ((latteView.width/2) - (root.maxLength/2)); // + root.offset) } else { if ((visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) && root.isVertical){ return; @@ -78,8 +78,8 @@ Item{ target: layoutsContainer property: "y" value: { - if ( dock && root.isVertical && useMaxLength ) { - return ((dock.height/2) - (root.maxLength/2));// + root.offset); + if ( latteView && root.isVertical && useMaxLength ) { + return ((latteView.height/2) - (root.maxLength/2));// + root.offset); } else { if ((visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) && root.isHorizontal){ return; @@ -122,7 +122,7 @@ Item{ secondHalfExited = ( (_endLayout.width + _mainLayout.width/2) >= root.maxLength/2 ); } - if (dock && ((contentsWidth >= root.maxLength) || firstHalfExited || secondHalfExited)) { + if (latteView && ((contentsWidth >= root.maxLength) || firstHalfExited || secondHalfExited)) { updateAutomaticIconSize(); } @@ -147,7 +147,7 @@ Item{ secondHalfExited = ( (_endLayout.height + _mainLayout.height/2) >= root.maxLength/2 ); } - if (dock && ((contentsHeight >= root.maxLength) || firstHalfExited || secondHalfExited)) { + if (latteView && ((contentsHeight >= root.maxLength) || firstHalfExited || secondHalfExited)) { updateAutomaticIconSize(); } diff --git a/containment/package/contents/ui/PanelBox.qml b/containment/package/contents/ui/PanelBox.qml index bf67a5b0e..13292f975 100644 --- a/containment/package/contents/ui/PanelBox.qml +++ b/containment/package/contents/ui/PanelBox.qml @@ -153,7 +153,7 @@ Item{ return 1; } - enabledBorders: dock && dock.effects ? dock.effects.enabledBorders : PlasmaCore.FrameSvg.NoBorder + enabledBorders: latteView && latteView.effects ? latteView.effects.enabledBorders : PlasmaCore.FrameSvg.NoBorder //! set true by default in order to avoid crash on startup because imagePath is set to "" readonly property bool themeHasShadow: themeExtended ? themeExtended.hasShadow : true @@ -361,7 +361,7 @@ Item{ } function updateEffectsArea(){ - if (!dock || root.editMode) + if (!latteView || root.editMode) return; var rootGeometry = mapToItem(root, 0, 0); @@ -371,7 +371,7 @@ Item{ efGeometry.width = width; efGeometry.height = height; - dock.effects.rect = efGeometry; + latteView.effects.rect = efGeometry; if (!Latte.WindowSystem.compositingActive) { visibilityManager.updateMaskArea(); @@ -438,7 +438,7 @@ Item{ adjustPrefix(); } - enabledBorders: dock && dock.effects ? dock.effects.enabledBorders : PlasmaCore.FrameSvg.NoBorder + enabledBorders: latteView && latteView.effects ? latteView.effects.enabledBorders : PlasmaCore.FrameSvg.NoBorder Behavior on opacity{ enabled: Latte.WindowSystem.compositingActive @@ -479,7 +479,7 @@ Item{ Colorizer.CustomBackground { anchors.fill: solidBackground opacity: root.forceColorizeFromActiveWindowScheme ? solidBackground.opacity : 0 - backgroundColor: root.forceColorizeFromActiveWindowScheme ? dock.visibility.touchingWindowScheme.backgroundColor : "transparent" + backgroundColor: root.forceColorizeFromActiveWindowScheme ? latteView.visibility.touchingWindowScheme.backgroundColor : "transparent" roundness: { if (themeExtended) { switch(plasmoid.location) { diff --git a/containment/package/contents/ui/RootMouseArea.qml b/containment/package/contents/ui/RootMouseArea.qml index 6435bcd6d..b5900640e 100644 --- a/containment/package/contents/ui/RootMouseArea.qml +++ b/containment/package/contents/ui/RootMouseArea.qml @@ -41,7 +41,7 @@ MouseArea{ } onPressed: { - if (dock.visibility.activeWindowCanBeDragged()) { + if (latteView.visibility.activeWindowCanBeDragged()) { lastPressX = mouse.x; lastPressY = mouse.y; drawWindowTimer.start(); @@ -60,7 +60,7 @@ MouseArea{ var tryDrag = mainArea.pressed && (stepX>threshold || stepY>threshold); - if ( tryDrag && dock.visibility.activeWindowCanBeDragged()) { + if ( tryDrag && latteView.visibility.activeWindowCanBeDragged()) { drawWindowTimer.stop(); activateDragging(); } @@ -69,13 +69,13 @@ MouseArea{ onDoubleClicked: { drawWindowTimer.stop(); restoreGrabberTimer.stop(); - dock.visibility.requestToggleMaximizeForActiveWindow(); + latteView.visibility.requestToggleMaximizeForActiveWindow(); //tasksModel.requestToggleMaximized(tasksModel.activeTask); } function activateDragging(){ - dock.disableGrabItemBehavior(); - dock.visibility.requestMoveActiveWindow(mainArea.mouseX, mainArea.mouseY); + latteView.disableGrabItemBehavior(); + latteView.visibility.requestMoveActiveWindow(mainArea.mouseX, mainArea.mouseY); restoreGrabberTimer.start(); } @@ -83,7 +83,7 @@ MouseArea{ id: drawWindowTimer interval: 500 onTriggered: { - if (mainArea.pressed && dock.visibility.activeWindowCanBeDragged()) { + if (mainArea.pressed && latteView.visibility.activeWindowCanBeDragged()) { mainArea.activateDragging(); } } @@ -93,7 +93,7 @@ MouseArea{ id: restoreGrabberTimer interval: 50 onTriggered: { - dock.restoreGrabItemBehavior(); + latteView.restoreGrabItemBehavior(); mainArea.lastPressX = -1; mainArea.lastPressY = -1; } diff --git a/containment/package/contents/ui/Ruler.qml b/containment/package/contents/ui/Ruler.qml index 6a2b89d34..235176677 100644 --- a/containment/package/contents/ui/Ruler.qml +++ b/containment/package/contents/ui/Ruler.qml @@ -155,7 +155,7 @@ Item{ readonly property real textColorLuma: 0.2126*textColorRs + 0.7152*textColorGs + 0.0722*textColorBs readonly property bool textColorIsDark: textColorLuma < 0.6 - readonly property color textColor: dock && dock.managedLayout ? dock.managedLayout.textColor : "#D7E3FF" + readonly property color textColor: latteView && latteView.managedLayout ? latteView.managedLayout.textColor : "#D7E3FF" Behavior on width { NumberAnimation { diff --git a/containment/package/contents/ui/RulerMouseArea.qml b/containment/package/contents/ui/RulerMouseArea.qml index 852835d25..097aa3b2b 100644 --- a/containment/package/contents/ui/RulerMouseArea.qml +++ b/containment/package/contents/ui/RulerMouseArea.qml @@ -25,7 +25,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.latte 0.2 as Latte MouseArea{ - enabled: root.editMode && !dock.visibility.isHidden + enabled: root.editMode && !latteView.visibility.isHidden cursorShape: { if (enabled) { diff --git a/containment/package/contents/ui/VisibilityManager.qml b/containment/package/contents/ui/VisibilityManager.qml index e648de2ca..504409f51 100644 --- a/containment/package/contents/ui/VisibilityManager.qml +++ b/containment/package/contents/ui/VisibilityManager.qml @@ -74,97 +74,97 @@ Item{ property int thicknessEditMode: thicknessNormalOriginalValue + theme.defaultFont.pixelSize + root.editShadow Binding{ - target: dock + target: latteView property:"maxThickness" //! prevents updating window geometry during closing window in wayland and such fixes a crash - when: dock && !inTempHiding && !inForceHiding + when: latteView && !inTempHiding && !inForceHiding value: thicknessZoomOriginal } Binding{ - target: dock + target: latteView property:"normalThickness" - when: dock + when: latteView value: thicknessNormalOriginal } Binding{ - target: dock + target: latteView property: "behaveAsPlasmaPanel" - when: dock + when: latteView value: root.editMode ? false : root.behaveAsPlasmaPanel } Binding{ - target: dock + target: latteView property: "fontPixelSize" when: theme value: theme.defaultFont.pixelSize } Binding{ - target: dock + target: latteView property:"inEditMode" - when: dock + when: latteView value: root.editMode } Binding{ - target: dock + target: latteView property: "maxLength" - when: dock + when: latteView value: root.editMode ? 1 : plasmoid.configuration.maxLength/100 } Binding{ - target: dock + target: latteView property: "offset" - when: dock + when: latteView value: plasmoid.configuration.offset } Binding{ - target: dock + target: latteView property: "alignment" - when: dock + when: latteView value: root.panelAlignment } Binding{ - target: dock && dock.effects ? dock.effects : null + target: latteView && latteView.effects ? latteView.effects : null property: "backgroundOpacity" - when: dock && dock.effects + when: latteView && latteView.effects value: root.currentPanelTransparency } Binding{ - target: dock && dock.effects ? dock.effects : null + target: latteView && latteView.effects ? latteView.effects : null property: "colorizerEnabled" - when: dock && dock.effects + when: latteView && latteView.effects value: root.forceColorizer && plasmoid.configuration.solidBackgroundForMaximized } Binding{ - target: dock && dock.effects ? dock.effects : null + target: latteView && latteView.effects ? latteView.effects : null property: "drawEffects" - when: dock && dock.effects + when: latteView && latteView.effects value: Latte.WindowSystem.compositingActive && (((root.blurEnabled && root.useThemePanel) - || (root.blurEnabled && root.forceSolidPanel && dock.visibility.existsWindowMaximized && Latte.WindowSystem.compositingActive)) + || (root.blurEnabled && root.forceSolidPanel && latteView.visibility.existsWindowMaximized && Latte.WindowSystem.compositingActive)) && (!root.inStartup || inForceHiding || inTempHiding)) } Binding{ - target: dock && dock.effects ? dock.effects : null + target: latteView && latteView.effects ? latteView.effects : null property: "drawShadows" - when: dock && dock.effects + when: latteView && latteView.effects value: root.drawShadowsExternal && (!root.inStartup || inForceHiding || inTempHiding) } Binding{ - target: dock && dock.effects ? dock.effects : null + target: latteView && latteView.effects ? latteView.effects : null property:"innerShadow" - when: dock && dock.effects + when: latteView && latteView.effects value: { if (editModeVisual.editAnimationEnded && !root.behaveAsPlasmaPanel) { return root.editShadow; @@ -175,9 +175,9 @@ Item{ } Binding{ - target: dock && dock.visibility ? dock.visibility : null + target: latteView && latteView.visibility ? latteView.visibility : null property: "enabledDynamicBackground" - when: dock && dock.visibility + when: latteView && latteView.visibility value: (root.backgroundOnlyOnMaximized || plasmoid.configuration.solidBackgroundForMaximized || root.disablePanelShadowMaximized) @@ -193,7 +193,7 @@ Item{ Connections{ target: universalLayoutManager onCurrentLayoutIsSwitching: { - if (Latte.WindowSystem.compositingActive && root.dockManagedLayout && root.dockManagedLayout.name === layoutName) { + if (Latte.WindowSystem.compositingActive && root.latteViewManagedLayout && root.latteViewManagedLayout.name === layoutName) { manager.inTempHiding = true; manager.inForceHiding = true; root.clearZoom(); @@ -214,7 +214,7 @@ Item{ } function slotContainsMouseChanged() { - if(dock.visibility.containsMouse) { + if(latteView.visibility.containsMouse) { updateMaskArea(); } } @@ -233,8 +233,8 @@ Item{ } // console.log("hide...."); - if((!slidingAnimationAutoHiddenOut.running && !dock.visibility.blockHiding - && !dock.visibility.containsMouse) || inForceHiding) { + if((!slidingAnimationAutoHiddenOut.running && !latteView.visibility.blockHiding + && !latteView.visibility.containsMouse) || inForceHiding) { slidingAnimationAutoHiddenOut.init(); } } @@ -252,12 +252,12 @@ Item{ function sendHideDockDuringLocationChangeFinished(){ blockUpdateMask = false; - dock.positioner.hideDockDuringLocationChangeFinished(); + latteView.positioner.hideDockDuringLocationChangeFinished(); } ///test maskArea function updateMaskArea() { - if (!dock || blockUpdateMask) { + if (!latteView || blockUpdateMask) { return; } @@ -265,12 +265,12 @@ Item{ var localY = 0; normalState = ((root.animationsNeedBothAxis === 0) && (root.animationsNeedLength === 0)) - || (dock.visibility.isHidden && !dock.visibility.containsMouse && root.animationsNeedThickness == 0); + || (latteView.visibility.isHidden && !latteView.visibility.containsMouse && root.animationsNeedThickness == 0); // debug maskArea criteria if (debugMagager) { console.log(root.animationsNeedBothAxis + ", " + root.animationsNeedLength + ", " + - root.animationsNeedThickness + ", " + dock.visibility.isHidden); + root.animationsNeedThickness + ", " + latteView.visibility.isHidden); if (previousNormalState !== normalState) { console.log("normal state changed to:" + normalState); @@ -318,50 +318,50 @@ Item{ tempThickness = Latte.WindowSystem.compositingActive ? thicknessZoom : thicknessNormal; } - if (dock.visibility.isHidden && !slidingAnimationAutoHiddenOut.running ) { + if (latteView.visibility.isHidden && !slidingAnimationAutoHiddenOut.running ) { tempThickness = thicknessAutoHidden; } //configure x,y based on plasmoid position and root.panelAlignment(Alignment) if ((plasmoid.location === PlasmaCore.Types.BottomEdge) || (plasmoid.location === PlasmaCore.Types.TopEdge)) { if (plasmoid.location === PlasmaCore.Types.BottomEdge) { - localY = dock.visibility.isHidden && dock.visibility.supportsKWinEdges ? - dock.height + tempThickness : dock.height - tempThickness; + localY = latteView.visibility.isHidden && latteView.visibility.supportsKWinEdges ? + latteView.height + tempThickness : latteView.height - tempThickness; } else if (plasmoid.location === PlasmaCore.Types.TopEdge) { - localY = dock.visibility.isHidden && dock.visibility.supportsKWinEdges ? + localY = latteView.visibility.isHidden && latteView.visibility.supportsKWinEdges ? -tempThickness : 0; } if (noCompositingEdit) { localX = 0; } else if (plasmoid.configuration.panelPosition === Latte.Types.Justify) { - localX = (dock.width/2) - tempLength/2 + root.offset; + localX = (latteView.width/2) - tempLength/2 + root.offset; } else if (root.panelAlignment === Latte.Types.Left) { localX = root.offset; } else if (root.panelAlignment === Latte.Types.Center) { - localX = (dock.width/2) - tempLength/2 + root.offset; + localX = (latteView.width/2) - tempLength/2 + root.offset; } else if (root.panelAlignment === Latte.Types.Right) { - localX = dock.width - layoutsContainer.mainLayout.width - space - root.offset; + localX = latteView.width - layoutsContainer.mainLayout.width - space - root.offset; } } else if ((plasmoid.location === PlasmaCore.Types.LeftEdge) || (plasmoid.location === PlasmaCore.Types.RightEdge)){ if (plasmoid.location === PlasmaCore.Types.LeftEdge) { - localX = dock.visibility.isHidden && dock.visibility.supportsKWinEdges ? + localX = latteView.visibility.isHidden && latteView.visibility.supportsKWinEdges ? -tempThickness : 0; } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { - localX = dock.visibility.isHidden && dock.visibility.supportsKWinEdges ? - dock.width + tempThickness : dock.width - tempThickness; + localX = latteView.visibility.isHidden && latteView.visibility.supportsKWinEdges ? + latteView.width + tempThickness : latteView.width - tempThickness; } if (noCompositingEdit) { localY = 0; } else if (plasmoid.configuration.panelPosition === Latte.Types.Justify) { - localY = (dock.height/2) - tempLength/2 + root.offset; + localY = (latteView.height/2) - tempLength/2 + root.offset; } else if (root.panelAlignment === Latte.Types.Top) { localY = root.offset; } else if (root.panelAlignment === Latte.Types.Center) { - localY = (dock.height/2) - tempLength/2 + root.offset; + localY = (latteView.height/2) - tempLength/2 + root.offset; } else if (root.panelAlignment === Latte.Types.Bottom) { - localY = dock.height - layoutsContainer.mainLayout.height - space - root.offset; + localY = latteView.height - layoutsContainer.mainLayout.height - space - root.offset; } } } else { @@ -378,14 +378,14 @@ Item{ tempThickness = editModeVisual.editAnimationEnded ? thicknessNormalOriginal + theme.defaultFont.pixelSize + root.editShadow : thicknessNormalOriginal + theme.defaultFont.pixelSize - if (dock.visibility.isHidden && !slidingAnimationAutoHiddenOut.running ) { + if (latteView.visibility.isHidden && !slidingAnimationAutoHiddenOut.running ) { tempThickness = thicknessAutoHidden; } else if (root.animationsNeedThickness > 0) { tempThickness = thicknessZoomOriginal; } } else{ //use all thickness space - if (dock.visibility.isHidden && !slidingAnimationAutoHiddenOut.running ) { + if (latteView.visibility.isHidden && !slidingAnimationAutoHiddenOut.running ) { tempThickness = Latte.WindowSystem.compositingActive ? thicknessAutoHidden : thicknessNormalOriginal; } else { tempThickness = thicknessZoomOriginal; @@ -394,13 +394,13 @@ Item{ //configure the x,y position based on thickness if(plasmoid.location === PlasmaCore.Types.RightEdge) - localX = Math.max(0,dock.width - tempThickness); + localX = Math.max(0,latteView.width - tempThickness); else if(plasmoid.location === PlasmaCore.Types.BottomEdge) - localY = Math.max(0,dock.height - tempThickness); + localY = Math.max(0,latteView.height - tempThickness); } } // end of compositing calculations - var maskArea = dock.effects.mask; + var maskArea = latteView.effects.mask; if (Latte.WindowSystem.compositingActive) { var maskLength = maskArea.width; //in Horizontal @@ -414,31 +414,31 @@ Item{ } } else { //! no compositing case - if (!dock.visibility.isHidden || !dock.visibility.supportsKWinEdges) { - localX = dock.effects.rect.x; - localY = dock.effects.rect.y; + if (!latteView.visibility.isHidden || !latteView.visibility.supportsKWinEdges) { + localX = latteView.effects.rect.x; + localY = latteView.effects.rect.y; } else { if (plasmoid.location === PlasmaCore.Types.BottomEdge) { - localX = dock.effects.rect.x; - localY = dock.effects.rect.y+dock.effects.rect.height+thicknessAutoHidden; + localX = latteView.effects.rect.x; + localY = latteView.effects.rect.y+dock.effects.rect.height+thicknessAutoHidden; } else if (plasmoid.location === PlasmaCore.Types.TopEdge) { - localX = dock.effects.rect.x; - localY = dock.effects.rect.y - thicknessAutoHidden; + localX = latteView.effects.rect.x; + localY = latteView.effects.rect.y - thicknessAutoHidden; } else if (plasmoid.location === PlasmaCore.Types.LeftEdge) { - localX = dock.effects.rect.x - thicknessAutoHidden; - localY = dock.effects.rect.y; + localX = latteView.effects.rect.x - thicknessAutoHidden; + localY = latteView.effects.rect.y; } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { - localX = dock.effects.rect.x + dock.effects.rect.width + 1; - localY = dock.effects.rect.y; + localX = latteView.effects.rect.x + latteView.effects.rect.width + 1; + localY = latteView.effects.rect.y; } } if (root.isHorizontal) { - tempThickness = dock.effects.rect.height; - tempLength = dock.effects.rect.width; + tempThickness = latteView.effects.rect.height; + tempLength = latteView.effects.rect.width; } else { - tempThickness = dock.effects.rect.width; - tempLength = dock.effects.rect.height; + tempThickness = latteView.effects.rect.width; + tempLength = latteView.effects.rect.height; } } @@ -460,12 +460,12 @@ Item{ } if (!Latte.WindowSystem.compositingActive) { - dock.effects.mask = newMaskArea; + latteView.effects.mask = newMaskArea; } else { - if (dock.behaveAsPlasmaPanel && !root.editMode) { - dock.effects.mask = Qt.rect(0,0,root.width,root.height); + if (latteView.behaveAsPlasmaPanel && !root.editMode) { + latteView.effects.mask = Qt.rect(0,0,root.width,root.height); } else { - dock.effects.mask = newMaskArea; + latteView.effects.mask = newMaskArea; } } } @@ -473,11 +473,11 @@ Item{ //console.log("reached updating geometry ::: "+dock.maskArea); if(normalState){ - var tempGeometry = Qt.rect(dock.effects.mask.x, dock.effects.mask.y, dock.effects.mask.width, dock.effects.mask.height); + var tempGeometry = Qt.rect(latteView.effects.mask.x, latteView.effects.mask.y, latteView.effects.mask.width, latteView.effects.mask.height); //the shadows size must be removed from the maskArea //before updating the localDockGeometry - if ((!dock.behaveAsPlasmaPanel || root.editMode) + if ((!latteView.behaveAsPlasmaPanel || root.editMode) && Latte.WindowSystem.compositingActive) { var fixedThickness = root.realPanelThickness; @@ -488,24 +488,24 @@ Item{ } if (plasmoid.location === PlasmaCore.Types.BottomEdge) { - tempGeometry.y = dock.height - fixedThickness; + tempGeometry.y = latteView.height - fixedThickness; } else if (plasmoid.location === PlasmaCore.Types.RightEdge) { - tempGeometry.x = dock.width - fixedThickness; + tempGeometry.x = latteView.width - fixedThickness; } - //set the boundaries for dock local geometry + //set the boundaries for latteView local geometry //qBound = qMax(min, qMin(value, max)). - tempGeometry.x = Math.max(0, Math.min(tempGeometry.x, dock.width)); - tempGeometry.y = Math.max(0, Math.min(tempGeometry.y, dock.height)); - tempGeometry.width = Math.min(tempGeometry.width, dock.width); - tempGeometry.height = Math.min(tempGeometry.height, dock.height); + tempGeometry.x = Math.max(0, Math.min(tempGeometry.x, latteView.width)); + tempGeometry.y = Math.max(0, Math.min(tempGeometry.y, latteView.height)); + tempGeometry.width = Math.min(tempGeometry.width, latteView.width); + tempGeometry.height = Math.min(tempGeometry.height, latteView.height); } //console.log("update geometry ::: "+tempGeometry); if (!Latte.WindowSystem.compositingActive) { - dock.localGeometry = dock.effects.rect; + latteView.localGeometry = latteView.effects.rect; } else { - dock.localGeometry = tempGeometry; + latteView.localGeometry = tempGeometry; } } @@ -527,10 +527,10 @@ Item{ } Rectangle{ - x: dock ? dock.effects.mask.x : -1 - y: dock ? dock.effects.mask.y : -1 - height: dock ? dock.effects.mask.height : 0 - width: dock ? dock.effects.mask.width : 0 + x: latteView ? latteView.effects.mask.x : -1 + y: latteView ? latteView.effects.mask.y : -1 + height: latteView ? latteView.effects.mask.height : 0 + width: latteView ? latteView.effects.mask.width : 0 border.color: "green" border.width: 1 @@ -571,7 +571,7 @@ Item{ ScriptAction{ script: { - dock.visibility.isHidden = true; + latteView.visibility.isHidden = true; } } @@ -582,7 +582,7 @@ Item{ } onStopped: { - dock.visibility.isHidden = true; + latteView.visibility.isHidden = true; if (manager.debugMagager) { console.log("hiding animation ended..."); @@ -596,7 +596,7 @@ Item{ } function init() { - if (!dock.visibility.blockHiding) + if (!latteView.visibility.blockHiding) start(); } } @@ -646,14 +646,14 @@ Item{ } function init() { - // if (!dock.visibility.blockHiding) + // if (!latteView.visibility.blockHiding) inSlidingIn = true; if (slidingAnimationAutoHiddenOut.running) { slidingAnimationAutoHiddenOut.stop(); } - dock.visibility.isHidden = false; + latteView.visibility.isHidden = false; updateMaskArea(); start(); diff --git a/containment/package/contents/ui/applet/AppletItem.qml b/containment/package/contents/ui/applet/AppletItem.qml index 5cb195e58..841097ba9 100644 --- a/containment/package/contents/ui/applet/AppletItem.qml +++ b/containment/package/contents/ui/applet/AppletItem.qml @@ -133,7 +133,7 @@ Item { //for example the icon-only applets var choords = mapToItem(container.appletWrapper, mouse.x, mouse.y); if (choords.x<0 || choords.y<0 || choords.x>=container.appletWrapper.width || choords.y>=container.appletWrapper.height) { - dock.toggleAppletExpanded(applet.id); + latteView.toggleAppletExpanded(applet.id); } } @@ -375,7 +375,7 @@ Item { if (parabolicManager.pseudoIndexBelongsToLatteApplet(entryIndex) && container.isLattePlasmoid) { latteApplet.activateTaskAtIndex(entryIndex - latteApplet.tasksNumbersBase); } else if (root.unifiedGlobalShortcuts && (entryIndex === parabolicManager.pseudoAppletIndex(container.index))) { - dock.toggleAppletExpanded(applet.id); + latteView.toggleAppletExpanded(applet.id); } } @@ -383,7 +383,7 @@ Item { if (parabolicManager.pseudoIndexBelongsToLatteApplet(entryIndex) && container.isLattePlasmoid) { latteApplet.newInstanceForTaskAtIndex(entryIndex - latteApplet.tasksNumbersBase); } else if (root.unifiedGlobalShortcuts && (entryIndex === parabolicManager.pseudoAppletIndex(container.index))) { - dock.toggleAppletExpanded(applet.id); + latteView.toggleAppletExpanded(applet.id); } } } @@ -617,7 +617,7 @@ Item { root.startDirectRenderDelayerDuringEntering(); } - if (!(root.dockIsHidden || root.inSlidingIn || root.inSlidingOut)){ + if (!(root.latteViewIsHidden || root.inSlidingIn || root.inSlidingOut)){ layoutsContainer.hoveredIndex = index; } @@ -668,7 +668,7 @@ Item { root.startDirectRenderDelayerDuringEntering(); } - if (!(root.dockIsHidden || root.inSlidingIn || root.inSlidingOut)){ + if (!(root.latteViewIsHidden || root.inSlidingIn || root.inSlidingOut)){ layoutsContainer.hoveredIndex = index; } @@ -714,7 +714,7 @@ Item { onWheel: { if (isSeparator || !root.mouseWheelActions || blockWheel - || (root.dockIsHidden || root.inSlidingIn || root.inSlidingOut)){ + || (root.latteViewIsHidden || root.inSlidingIn || root.inSlidingOut)){ wheel.accepted = false; return; } @@ -727,12 +727,12 @@ Item { if (angle > 12) { //positive direction if (!isExpanded) { - dock.toggleAppletExpanded(applet.id); + latteView.toggleAppletExpanded(applet.id); } } else if (angle < -12) { //negative direction if (isExpanded) { - dock.toggleAppletExpanded(applet.id); + latteView.toggleAppletExpanded(applet.id); } } } diff --git a/containment/package/contents/ui/applet/AppletItemWrapper.qml b/containment/package/contents/ui/applet/AppletItemWrapper.qml index 889422342..73a1f599f 100644 --- a/containment/package/contents/ui/applet/AppletItemWrapper.qml +++ b/containment/package/contents/ui/applet/AppletItemWrapper.qml @@ -468,7 +468,7 @@ Item{ anchors.fill: parent active: communicator.overlayLatteIconIsActive && applet.pluginName === "org.kde.plasma.folder" sourceComponent: MouseArea{ - onClicked: dock.toggleAppletExpanded(applet.id); + onClicked: latteView.toggleAppletExpanded(applet.id); } } diff --git a/containment/package/contents/ui/applet/communicator/LatteBridge.qml b/containment/package/contents/ui/applet/communicator/LatteBridge.qml index 9d7be0c35..e4ffb6d95 100644 --- a/containment/package/contents/ui/applet/communicator/LatteBridge.qml +++ b/containment/package/contents/ui/applet/communicator/LatteBridge.qml @@ -32,7 +32,7 @@ Item{ // NAME: inEditMode // USAGE: read-only // EXPLANATION: Latte sets it to true when this applet is in a Latte containment and Latte - // is also in EditMode, that means when the user is altering applets and Latte dock settings + // is also in EditMode, that means when the user is altering applets and Latte latteView settings // @since: 0.9 readonly property bool inEditMode: root.editMode diff --git a/containment/package/contents/ui/colorizer/BackgroundTracker.qml b/containment/package/contents/ui/colorizer/BackgroundTracker.qml index 4d10c9590..faf72cc6b 100644 --- a/containment/package/contents/ui/colorizer/BackgroundTracker.qml +++ b/containment/package/contents/ui/colorizer/BackgroundTracker.qml @@ -56,22 +56,22 @@ Item{ property bool current: model.isCurrent Component.onCompleted: { - if (dockManagedLayout && forceColorizer && dockManagedLayout.lastUsedActivity === activityId) { + if (managedLayout && forceColorizer && managedLayout.lastUsedActivity === activityId) { activitiesList.currentLayoutBackground = background; } } onBackgroundChanged: { - if (dockManagedLayout && forceColorizer && dockManagedLayout.lastUsedActivity === activityId) { + if (managedLayout && forceColorizer && managedLayout.lastUsedActivity === activityId) { activitiesList.currentLayoutBackground = background; } } Connections{ - target: dockManagedLayout + target: managedLayout onLastUsedActivityChanged:{ - if (dockManagedLayout && forceColorizer && dockManagedLayout.lastUsedActivity === activityItem.activityId) { + if (managedLayout && forceColorizer && managedLayout.lastUsedActivity === activityItem.activityId) { activitiesList.currentLayoutBackground = activityItem.background; } } diff --git a/containment/package/contents/ui/colorizer/CustomBackground.qml b/containment/package/contents/ui/colorizer/CustomBackground.qml index d3a448728..57601063b 100644 --- a/containment/package/contents/ui/colorizer/CustomBackground.qml +++ b/containment/package/contents/ui/colorizer/CustomBackground.qml @@ -61,36 +61,36 @@ Item{ Binding{ target: main property: "topBorder" - when: dock + when: latteView value: { - return ((dock && dock.effects && (dock.effects.enabledBorders & PlasmaCore.FrameSvg.TopBorder)) > 0); + return ((latteView && latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.TopBorder)) > 0); } } Binding{ target: main property: "leftBorder" - when: dock + when: latteView value: { - return ((dock && dock.effects && (dock.effects.enabledBorders & PlasmaCore.FrameSvg.LeftBorder)) > 0); + return ((latteView && latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.LeftBorder)) > 0); } } Binding{ target: main property: "bottomBorder" - when: dock + when: latteView value: { - return ((dock && dock.effects && (dock.effects.enabledBorders & PlasmaCore.FrameSvg.BottomBorder)) > 0); + return ((latteView && latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.BottomBorder)) > 0); } } Binding{ target: main property: "rightBorder" - when: dock + when: latteView value: { - return ((dock && dock.effects && (dock.effects.enabledBorders & PlasmaCore.FrameSvg.RightBorder)) > 0); + return ((latteView && latteView.effects && (latteView.effects.enabledBorders & PlasmaCore.FrameSvg.RightBorder)) > 0); } } diff --git a/containment/package/contents/ui/colorizer/Manager.qml b/containment/package/contents/ui/colorizer/Manager.qml index 5f414d81a..b94657a4c 100644 --- a/containment/package/contents/ui/colorizer/Manager.qml +++ b/containment/package/contents/ui/colorizer/Manager.qml @@ -50,8 +50,8 @@ Loader{ property real currentBackgroundLuminas: item ? item.currentBackgroundLuminas : -1000 property QtObject applyTheme: { - if (forceSolidnessAndColorize && dock.visibility.touchingWindowScheme) { - return dock.visibility.touchingWindowScheme; + if (forceSolidnessAndColorize && latteView.visibility.touchingWindowScheme) { + return latteView.visibility.touchingWindowScheme; } if (themeExtended) { diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index 0ec1a75ab..b007fd702 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -38,7 +38,7 @@ import "../code/LayoutManager.js" as LayoutManager DragDrop.DropArea { id: root - objectName: "dockLayoutView" + objectName: "containmentViewLayout" LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft && !root.isVertical LayoutMirroring.childrenInherit: true @@ -69,11 +69,11 @@ DragDrop.DropArea { property bool autoDecreaseIconSize: plasmoid.configuration.autoDecreaseIconSize && !containsOnlyPlasmaTasks && layoutsContainer.fillApplets<=0 property bool backgroundOnlyOnMaximized: plasmoid.configuration.backgroundOnlyOnMaximized property bool behaveAsPlasmaPanel: { - if (!dock || !dock.visibility) + if (!latteView || !latteView.visibility) return false; return (visibilityManager.panelIsBiggerFromIconSize && (zoomFactor === 1.0) - && (dock.visibility.mode === Latte.Types.AlwaysVisible || dock.visibility.mode === Latte.Types.WindowsGoBelow) + && (latteView.visibility.mode === Latte.Types.AlwaysVisible || latteView.visibility.mode === Latte.Types.WindowsGoBelow) && (plasmoid.configuration.panelPosition === Latte.Types.Justify) && !(root.solidPanel && panelShadowsActive)); } @@ -82,40 +82,40 @@ DragDrop.DropArea { property bool confirmedDragEntered: false property bool containsOnlyPlasmaTasks: false //this is flag to indicate when from tasks only a plasma based one is found - property bool dockContainsMouse: dock && dock.visibility ? dock.visibility.containsMouse : false + property bool dockContainsMouse: latteView && latteView.visibility ? latteView.visibility.containsMouse : false property bool disablePanelShadowMaximized: plasmoid.configuration.disablePanelShadowForMaximized && Latte.WindowSystem.compositingActive property bool drawShadowsExternal: panelShadowsActive && behaveAsPlasmaPanel && !visibilityManager.inTempHiding property bool editMode: editModeVisual.inEditMode - property bool windowIsTouching: dock && dock.visibility && (dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped || hasExpandedApplet) + property bool windowIsTouching: latteView && latteView.visibility && (latteView.visibility.existsWindowMaximized || latteView.visibility.existsWindowSnapped || hasExpandedApplet) property bool forceSemiTransparentPanel: ((!plasmoid.configuration.solidBackgroundForMaximized && plasmoid.configuration.backgroundOnlyOnMaximized && windowIsTouching) || (plasmoid.configuration.solidBackgroundForMaximized && !plasmoid.configuration.backgroundOnlyOnMaximized && !windowIsTouching)) && Latte.WindowSystem.compositingActive - property bool forceSolidPanel: plasmoid.configuration.solidBackgroundForMaximized && dock && dock.visibility + property bool forceSolidPanel: plasmoid.configuration.solidBackgroundForMaximized && latteView && latteView.visibility && Latte.WindowSystem.compositingActive - &&(dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped || hasExpandedApplet + &&(latteView.visibility.existsWindowMaximized || latteView.visibility.existsWindowSnapped || hasExpandedApplet || showAppletsNumbers || showMetaBadge) property bool forceTransparentPanel: root.backgroundOnlyOnMaximized - && dock && dock.visibility - && !(dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped) + && latteView && latteView.visibility + && !(latteView.visibility.existsWindowMaximized || latteView.visibility.existsWindowSnapped) && Latte.WindowSystem.compositingActive && !(hasExpandedApplet && zoomFactor===1 && plasmoid.configuration.panelSize===100) property bool forceColorizer: Latte.WindowSystem.compositingActive && plasmoid.configuration.colorizeTransparentPanels property bool forceColorizeFromActiveWindowScheme: plasmoid.configuration.colorizeFromActiveWindowScheme && !editMode - && (dock && dock.visibility && dock.visibility.touchingWindowScheme - && (dock.visibility.existsWindowMaximized || dock.visibility.existsWindowSnapped) + && (latteView && latteView.visibility && latteView.visibility.touchingWindowScheme + && (latteView.visibility.existsWindowMaximized || latteView.visibility.existsWindowSnapped) && !hasExpandedApplet) - property bool maximizedWindowTitleBarBehavesAsPanelBackground: dock && dock.visibility + property bool maximizedWindowTitleBarBehavesAsPanelBackground: latteView && latteView.visibility && (!plasmoid.configuration.solidBackgroundForMaximized && plasmoid.configuration.backgroundOnlyOnMaximized) - && (dock.visibility.mode === Latte.Types.WindowsGoBelow) + && (latteView.visibility.mode === Latte.Types.WindowsGoBelow) && (plasmoid.location === PlasmaCore.Types.TopEdge) && (!useThemePanel || panelTransparency<40) - && dock.visibility.existsWindowMaximized + && latteView.visibility.existsWindowMaximized readonly property bool hasExpandedApplet: plasmoid.applets.some(function (item) { return (item.status >= PlasmaCore.Types.NeedsAttentionStatus && item.status !== PlasmaCore.Types.HiddenStatus @@ -123,7 +123,7 @@ DragDrop.DropArea { && item.pluginName !== "org.kde.activeWindowControl"); }) - readonly property bool hasUserSpecifiedBackground: (dock && dock.managedLayout && dock.managedLayout.background.startsWith("/")) ? + readonly property bool hasUserSpecifiedBackground: (latteView && latteView.managedLayout && latteView.managedLayout.background.startsWith("/")) ? true : false property bool dockIsShownCompletely: !(dockIsHidden || inSlidingIn || inSlidingOut) && !root.editMode @@ -179,10 +179,10 @@ DragDrop.DropArea { root.maxIconSize property int proportionIconSize: { //icon size based on screen height - if ((plasmoid.configuration.proportionIconSize===-1) || !dock) + if ((plasmoid.configuration.proportionIconSize===-1) || !latteView) return -1; - return Math.max(16,Math.round(dock.screenGeometry.height * plasmoid.configuration.proportionIconSize/100/8)*8); + return Math.max(16,Math.round(latteView.screenGeometry.height * plasmoid.configuration.proportionIconSize/100/8)*8); } property int iconStep: 8 @@ -211,7 +211,7 @@ DragDrop.DropArea { if (( (plasmoid.configuration.panelShadows && !root.backgroundOnlyOnMaximized) || (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && !root.forceTransparentPanel)) - && !(disablePanelShadowMaximized && dock.visibility.existsWindowMaximized)) { + && !(disablePanelShadowMaximized && latteView.visibility.existsWindowMaximized)) { return true; } @@ -260,8 +260,8 @@ DragDrop.DropArea { property int editShadow: { if (!Latte.WindowSystem.compositingActive) { return 0; - } else if (dock && dock.screenGeometry) { - return (dock.screenGeometry.height/90); + } else if (latteView && latteView.screenGeometry) { + return (latteView.screenGeometry.height/90); } else { return 7; } @@ -346,18 +346,18 @@ DragDrop.DropArea { property Item latteApplet property Item parabolicManager: _parabolicManager - property QtObject dock: null + property QtObject latteView: null property QtObject themeExtended: null property QtObject universalSettings: null property QtObject universalLayoutManager: null - property QtObject dockManagedLayout: dock && dock.managedLayout ? dock.managedLayout : null + property QtObject managedLayout: latteView && latteView.managedLayout ? latteView.managedLayout : null // TO BE DELETED, if not needed: property int counter:0; ///BEGIN properties provided to Latte Plasmoid //shadows for applets, it should be removed as the appleitems don't need it any more property bool enableShadows: plasmoid.configuration.shadows || (root.forceTransparentPanel && plasmoid.configuration.shadows>0) - property bool dockIsHidden: dock ? dock.visibility.isHidden : true + property bool dockIsHidden: latteView ? latteView.visibility.isHidden : true property bool groupTasksByDefault: plasmoid.configuration.groupTasksByDefault property bool dotsOnActive: plasmoid.configuration.dotsOnActive property bool highlightWindows: plasmoid.configuration.highlightWindows @@ -397,7 +397,7 @@ DragDrop.DropArea { property int tasksCount: latteApplet ? latteApplet.tasksCount : 0 property real durationTime: { - if ((dock && dock.effects && dock.effects.animationsBlocked) || !Latte.WindowSystem.compositingActive) { + if ((latteView && latteView.effects && latteView.effects.animationsBlocked) || !Latte.WindowSystem.compositingActive) { return 0; } @@ -412,7 +412,7 @@ DragDrop.DropArea { return 2; } - property rect screenGeometry: dock ? dock.screenGeometry : plasmoid.screenGeometry + property rect screenGeometry: latteView ? latteView.screenGeometry : plasmoid.screenGeometry readonly property color minimizedDotColor: colorizerManager.minimizedDotColor ///END properties from latteApplet @@ -524,27 +524,27 @@ DragDrop.DropArea { } } - onDockChanged: { - if (dock) { - dock.onAddInternalViewSplitter.connect(addInternalViewSplitters); - dock.onRemoveInternalViewSplitter.connect(removeInternalViewSplitters); + onLatteViewChanged: { + if (latteView) { + latteView.onAddInternalViewSplitter.connect(addInternalViewSplitters); + latteView.onRemoveInternalViewSplitter.connect(removeInternalViewSplitters); - dock.onXChanged.connect(visibilityManager.updateMaskArea); - dock.onYChanged.connect(visibilityManager.updateMaskArea); - dock.onWidthChanged.connect(visibilityManager.updateMaskArea); - dock.onHeightChanged.connect(visibilityManager.updateMaskArea); + latteView.onXChanged.connect(visibilityManager.updateMaskArea); + latteView.onYChanged.connect(visibilityManager.updateMaskArea); + latteView.onWidthChanged.connect(visibilityManager.updateMaskArea); + latteView.onHeightChanged.connect(visibilityManager.updateMaskArea); - dock.positioner.hideDockDuringLocationChangeStarted.connect(visibilityManager.slotHideDockDuringLocationChange); - dock.positioner.showDockAfterLocationChangeFinished.connect(visibilityManager.slotShowDockAfterLocationChange); - dock.positioner.hideDockDuringScreenChangeStarted.connect(visibilityManager.slotHideDockDuringLocationChange); - dock.positioner.showDockAfterScreenChangeFinished.connect(visibilityManager.slotShowDockAfterLocationChange); - dock.positioner.hideDockDuringMovingToLayoutStarted.connect(visibilityManager.slotHideDockDuringLocationChange); - dock.positioner.showDockAfterMovingToLayoutFinished.connect(visibilityManager.slotShowDockAfterLocationChange); + latteView.positioner.hideDockDuringLocationChangeStarted.connect(visibilityManager.slotHideDockDuringLocationChange); + latteView.positioner.showDockAfterLocationChangeFinished.connect(visibilityManager.slotShowDockAfterLocationChange); + latteView.positioner.hideDockDuringScreenChangeStarted.connect(visibilityManager.slotHideDockDuringLocationChange); + latteView.positioner.showDockAfterScreenChangeFinished.connect(visibilityManager.slotShowDockAfterLocationChange); + latteView.positioner.hideDockDuringMovingToLayoutStarted.connect(visibilityManager.slotHideDockDuringLocationChange); + latteView.positioner.showDockAfterMovingToLayoutFinished.connect(visibilityManager.slotShowDockAfterLocationChange); - dock.visibility.onContainsMouseChanged.connect(visibilityManager.slotContainsMouseChanged); - dock.visibility.onMustBeHide.connect(visibilityManager.slotMustBeHide); - dock.visibility.onMustBeShown.connect(visibilityManager.slotMustBeShown); + latteView.visibility.onContainsMouseChanged.connect(visibilityManager.slotContainsMouseChanged); + latteView.visibility.onMustBeHide.connect(visibilityManager.slotMustBeHide); + latteView.visibility.onMustBeShown.connect(visibilityManager.slotMustBeShown); updateContainsOnlyPlasmaTasks(); } @@ -572,7 +572,7 @@ DragDrop.DropArea { if (root.addLaunchersInTaskManager) { return; } - } else if (dock.mimeContainsPlasmoid(event.mimeData, "audoban.applet.separator") + } else if (latteView.mimeContainsPlasmoid(event.mimeData, "audoban.applet.separator") && root.latteAppletContainer.containsPos(event)) { confirmedDragEntered = true dndSpacer.opacity = 0; @@ -586,7 +586,7 @@ DragDrop.DropArea { slotAnimationsNeedLength(1); } - if (!latteApplet || (latteApplet && !dock.mimeContainsPlasmoid(event.mimeData, "org.kde.latte.plasmoid"))) { + if (!latteApplet || (latteApplet && !latteView.mimeContainsPlasmoid(event.mimeData, "org.kde.latte.plasmoid"))) { LayoutManager.insertAtCoordinates2(dndSpacer, event.x, event.y) dndSpacer.opacity = 1; } @@ -604,7 +604,7 @@ DragDrop.DropArea { if (root.addLaunchersInTaskManager) { return; } - } else if (dock.mimeContainsPlasmoid(event.mimeData, "audoban.applet.separator") + } else if (latteView.mimeContainsPlasmoid(event.mimeData, "audoban.applet.separator") && root.latteAppletContainer.containsPos(event)) { confirmedDragEntered = true dndSpacer.opacity = 0; @@ -613,7 +613,7 @@ DragDrop.DropArea { } } - if (!latteApplet || (latteApplet && !dock.mimeContainsPlasmoid(event.mimeData, "org.kde.latte.plasmoid"))) { + if (!latteApplet || (latteApplet && !latteView.mimeContainsPlasmoid(event.mimeData, "org.kde.latte.plasmoid"))) { LayoutManager.insertAtCoordinates2(dndSpacer, event.x, event.y) dndSpacer.opacity = 1; } @@ -639,7 +639,7 @@ DragDrop.DropArea { if (event.mimeData.formats.indexOf("application/x-orgkdeplasmataskmanager_taskbuttonitem") < 0) { if (latteApplet && latteApplet.launchersDrop(event) && root.addLaunchersInTaskManager) { latteApplet.launchersDropped(event.mimeData.urls); - } else if (!latteApplet || (latteApplet && !dock.mimeContainsPlasmoid(event.mimeData, "org.kde.latte.plasmoid"))) { + } else if (!latteApplet || (latteApplet && !latteView.mimeContainsPlasmoid(event.mimeData, "org.kde.latte.plasmoid"))) { plasmoid.processMimeData(event.mimeData, event.x, event.y); event.accept(event.proposedAction); } @@ -729,26 +729,26 @@ DragDrop.DropArea { Component.onDestruction: { console.debug("Destroying Latte Dock Containment ui..."); - if (dock) { - dock.onAddInternalViewSplitter.disconnect(addInternalViewSplitters); - dock.onRemoveInternalViewSplitter.disconnect(removeInternalViewSplitters); - - dock.onXChanged.disconnect(visibilityManager.updateMaskArea); - dock.onYChanged.disconnect(visibilityManager.updateMaskArea); - dock.onWidthChanged.disconnect(visibilityManager.updateMaskArea); - dock.onHeightChanged.disconnect(visibilityManager.updateMaskArea); - - dock.positioner.hideDockDuringLocationChangeStarted.disconnect(visibilityManager.slotHideDockDuringLocationChange); - dock.positioner.showDockAfterLocationChangeFinished.disconnect(visibilityManager.slotShowDockAfterLocationChange); - dock.positioner.hideDockDuringScreenChangeStarted.disconnect(visibilityManager.slotHideDockDuringLocationChange); - dock.positioner.showDockAfterScreenChangeFinished.disconnect(visibilityManager.slotShowDockAfterLocationChange); - dock.positioner.hideDockDuringMovingToLayoutStarted.disconnect(visibilityManager.slotHideDockDuringLocationChange); - dock.positioner.showDockAfterMovingToLayoutFinished.disconnect(visibilityManager.slotShowDockAfterLocationChange); - - if (dock.visibility) { - dock.visibility.onContainsMouseChanged.disconnect(visibilityManager.slotContainsMouseChanged); - dock.visibility.onMustBeHide.disconnect(visibilityManager.slotMustBeHide); - dock.visibility.onMustBeShown.disconnect(visibilityManager.slotMustBeShown); + if (latteView) { + latteView.onAddInternalViewSplitter.disconnect(addInternalViewSplitters); + latteView.onRemoveInternalViewSplitter.disconnect(removeInternalViewSplitters); + + latteView.onXChanged.disconnect(visibilityManager.updateMaskArea); + latteView.onYChanged.disconnect(visibilityManager.updateMaskArea); + latteView.onWidthChanged.disconnect(visibilityManager.updateMaskArea); + latteView.onHeightChanged.disconnect(visibilityManager.updateMaskArea); + + latteView.positioner.hideDockDuringLocationChangeStarted.disconnect(visibilityManager.slotHideDockDuringLocationChange); + latteView.positioner.showDockAfterLocationChangeFinished.disconnect(visibilityManager.slotShowDockAfterLocationChange); + latteView.positioner.hideDockDuringScreenChangeStarted.disconnect(visibilityManager.slotHideDockDuringLocationChange); + latteView.positioner.showDockAfterScreenChangeFinished.disconnect(visibilityManager.slotShowDockAfterLocationChange); + latteView.positioner.hideDockDuringMovingToLayoutStarted.disconnect(visibilityManager.slotHideDockDuringLocationChange); + latteView.positioner.showDockAfterMovingToLayoutFinished.disconnect(visibilityManager.slotShowDockAfterLocationChange); + + if (latteView.visibility) { + latteView.visibility.onContainsMouseChanged.disconnect(visibilityManager.slotContainsMouseChanged); + latteView.visibility.onMustBeHide.disconnect(visibilityManager.slotMustBeHide); + latteView.visibility.onMustBeShown.disconnect(visibilityManager.slotMustBeShown); } } } @@ -792,7 +792,7 @@ DragDrop.DropArea { // console.debug("user configuring", plasmoid.userConfiguring) if (plasmoid.userConfiguring) { - dock.setBlockHiding(true); + latteView.setBlockHiding(true); // console.log("applets------"); for (var i = 0; i < plasmoid.applets.length; ++i) { @@ -812,10 +812,10 @@ DragDrop.DropArea { dragOverlay.visible = true; } } else { - dock.setBlockHiding(false); + latteView.setBlockHiding(false); - if (dock.visibility.isHidden) { - dock.visibility.mustBeShown(); + if (latteView.visibility.isHidden) { + latteView.visibility.mustBeShown(); } if (dragOverlay) { @@ -831,7 +831,7 @@ DragDrop.DropArea { ///Set Preferred Sizes/// ///Notice: they are set here because if they are set with a binding - ///they break the !immutable experience, the dock becomes too small + ///they break the !immutable experience, the latteView becomes too small ///to add applets if (plasmoid.immutable) { if(root.isHorizontal) { @@ -1018,7 +1018,7 @@ DragDrop.DropArea { } function containmentActions(){ - return dock.containmentActions(); + return latteView.containmentActions(); } function decimalToHex(d, padding) { @@ -1110,7 +1110,7 @@ DragDrop.DropArea { } function mouseInHoverableArea() { - return (dock.visibility.containsMouse && !rootMouseArea.containsMouse && mouseInCanBeHoveredApplet()); + return (latteView.visibility.containsMouse && !rootMouseArea.containsMouse && mouseInCanBeHoveredApplet()); } function removeInternalViewSplitters(){ @@ -1231,23 +1231,23 @@ DragDrop.DropArea { // return; // } - if ((step === 0) || (!dock)) { + if ((step === 0) || (!latteView)) { return; } actionsBlockHiding = Math.max(actionsBlockHiding + step, 0); if (actionsBlockHiding > 0){ - dock.setBlockHiding(true); + latteView.setBlockHiding(true); } else { if (!root.editMode) - dock.setBlockHiding(false); + latteView.setBlockHiding(false); } } function slotPreviewsShown(){ - if (dock) { - dock.deactivateApplets(); + if (latteView) { + latteView.deactivateApplets(); } } @@ -1349,8 +1349,8 @@ DragDrop.DropArea { } function updateContainsOnlyPlasmaTasks() { - if (dock) { - root.containsOnlyPlasmaTasks = (dock.tasksPresent() && !dock.latteTasksPresent()); + if (latteView) { + root.containsOnlyPlasmaTasks = (latteView.tasksPresent() && !latteView.latteTasksPresent()); } else { root.containsOnlyPlasmaTasks = false; } @@ -1433,7 +1433,7 @@ DragDrop.DropArea { } Connections { - target: dock + target: latteView onWidthChanged:{ if (root.isHorizontal && proportionIconSize!==-1) updateAutomaticIconSize(); @@ -1445,7 +1445,7 @@ DragDrop.DropArea { } onContextMenuIsShownChanged: { - if (!dock.contextMenuIsShown) { + if (!latteView.contextMenuIsShown) { checkRestoreZoom.start(); } else { root.setGlobalDirectRender(false); @@ -1454,7 +1454,7 @@ DragDrop.DropArea { } Connections{ - target: dock && dock.visibility ? dock.visibility : root + target: latteView && latteView.visibility ? latteView.visibility : root ignoreUnknownSignals : true @@ -1565,7 +1565,7 @@ DragDrop.DropArea { id: showTitleTooltipTimer interval: 100 onTriggered: { - if (dock && dock.visibility && dock.visibility.containsMouse) { + if (latteView && latteView.visibility && latteView.visibility.containsMouse) { titleTooltipDialog.update(); } @@ -1645,7 +1645,7 @@ DragDrop.DropArea { sourceComponent: Image{ anchors.fill: parent fillMode: Image.Tile - source: root.hasUserSpecifiedBackground ? dock.managedLayout.background : "../icons/wheatprint.jpg" + source: root.hasUserSpecifiedBackground ? latteView.managedLayout.background : "../icons/wheatprint.jpg" } } @@ -1735,7 +1735,7 @@ DragDrop.DropArea { ///////////////BEGIN TIMER elements - //Timer to check if the mouse is still outside the dock in order to restore zooms to 1.0 + //Timer to check if the mouse is still outside the latteView in order to restore zooms to 1.0 Timer{ id:checkRestoreZoom interval: 90 @@ -1744,7 +1744,7 @@ DragDrop.DropArea { if (latteApplet && (latteApplet.previewContainsMouse() || latteApplet.contextMenu)) return; - if (dock.contextMenuIsShown) + if (latteView.contextMenuIsShown) return; if (!mouseInHoverableArea()) { @@ -1798,7 +1798,7 @@ DragDrop.DropArea { onTriggered: root.updateAutomaticIconSize(); } - //! It is used in order to slide-in the dock on startup + //! It is used in order to slide-in the latteView on startup Timer{ id: inStartupTimer interval: 1500 diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 46a1fce56..ee9474dde 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -214,7 +214,7 @@ Item { property alias tasksCount: tasksModel.count property alias hoveredIndex: icList.hoveredIndex - property QtObject currentLayout : latteView && latteView.dockManagedLayout ? latteView.dockManagedLayout : null + property QtObject currentLayout : latteView && latteView.managedLayout ? latteView.managedLayout : null property var badgesForActivate: latteView ? latteView.badgesForActivate : [] property var managedLayoutName: currentLayout ? currentLayout.name : "" @@ -372,12 +372,12 @@ Item { if (currentLayout) { if (latteView && latteView.universalLayoutManager - && latteView.dockManagedLayout && latteView.universalSettings + && latteView.managedLayout && latteView.universalSettings && (latteView.launchersGroup === Latte.Types.LayoutLaunchers || latteView.launchersGroup === Latte.Types.GlobalLaunchers)) { if (latteView.launchersGroup === Latte.Types.LayoutLaunchers) { - launchersList = latteView.dockManagedLayout.launchers; + launchersList = latteView.managedLayout.launchers; } else if (latteView.launchersGroup === Latte.Types.GlobalLaunchers) { launchersList = latteView.universalSettings.launchers; } @@ -680,7 +680,7 @@ Item { && (latteView.launchersGroup === Latte.Types.LayoutLaunchers || latteView.launchersGroup === Latte.Types.GlobalLaunchers)) { if (latteView.launchersGroup === Latte.Types.LayoutLaunchers) { - tasksModel.launcherList = latteView.dockManagedLayout.launchers; + tasksModel.launcherList = latteView.managedLayout.launchers; } else if (latteView.launchersGroup === Latte.Types.GlobalLaunchers) { tasksModel.launcherList = latteView.universalSettings.launchers; } @@ -707,12 +707,12 @@ Item { onLauncherListChanged: { if (currentLayout) { if (latteView && latteView.universalLayoutManager - && latteView.dockManagedLayout && latteView.universalSettings + && latteView.managedLayout && latteView.universalSettings && (latteView.launchersGroup === Latte.Types.LayoutLaunchers || latteView.launchersGroup === Latte.Types.GlobalLaunchers)) { if (latteView.launchersGroup === Latte.Types.LayoutLaunchers) { - latteView.dockManagedLayout.launchers = launcherList; + latteView.managedLayout.launchers = launcherList; } else if (latteView.launchersGroup === Latte.Types.GlobalLaunchers) { latteView.universalSettings.launchers = launcherList; } @@ -762,7 +762,7 @@ Item { || latteView.launchersGroup === Latte.Types.GlobalLaunchers)) { if (latteView.launchersGroup === Latte.Types.LayoutLaunchers) { - launcherList = latteView.dockManagedLayout.launchers; + launcherList = latteView.managedLayout.launchers; } else if (latteView.launchersGroup === Latte.Types.GlobalLaunchers) { launcherList = latteView.universalSettings.launchers; } diff --git a/shell/package/contents/views/Panel.qml b/shell/package/contents/views/Panel.qml index b19779802..a317715f5 100644 --- a/shell/package/contents/views/Panel.qml +++ b/shell/package/contents/views/Panel.qml @@ -33,7 +33,7 @@ PlasmaCore.FrameSvgItem { // onRepaintNeeded: adjustPrefix(); property Item containment - property Item dockLayout + property Item viewLayout readonly property bool verticalPanel: containment && containment.formFactor === PlasmaCore.Types.Vertical @@ -73,7 +73,7 @@ PlasmaCore.FrameSvgItem { } Component.onDestruction: { - console.log("dock view qml source deleting..."); + console.log("latte view qml source deleting..."); if (containment) { containment.locationChanged.disconnect(adjustPrefix); @@ -81,11 +81,11 @@ PlasmaCore.FrameSvgItem { } onContainmentChanged: { - console.log("dock view qml source - containment changed 1..."); + console.log("latte view qml source - containment changed 1..."); if (!containment) { return; } - console.log("dock view qml source - containment changed 2..."); + console.log("latte view qml source - containment changed 2..."); containment.parent = containmentParent; containment.visible = true; @@ -94,12 +94,12 @@ PlasmaCore.FrameSvgItem { adjustPrefix(); for(var i=0; i