update libnowdockplugin to liblattedockplugin

v0.6
Michail Vourlakos 8 years ago
parent 418f599004
commit 79bbf20a62

@ -1,4 +1,4 @@
project(nowdock) project(lattedock)
cmake_minimum_required(VERSION 3.0 FATAL_ERROR) cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
set (CMAKE_CXX_STANDARD 11) set (CMAKE_CXX_STANDARD 11)
@ -74,7 +74,7 @@ ELSE(NOT GETTEXT_MSGFMT_EXECUTABLE)
ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE) ENDIF(NOT GETTEXT_MSGFMT_EXECUTABLE)
add_subdirectory(libnowdock) add_subdirectory(liblattedock)
add_subdirectory(containment) add_subdirectory(containment)
plasma_install_package(build/containment/release org.kde.nowdock.containment) plasma_install_package(build/containment/release org.kde.nowdock.containment)
add_subdirectory(plasmoid) add_subdirectory(plasmoid)

@ -26,7 +26,7 @@ import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0 import org.kde.kquickcontrolsaddons 2.0
import org.kde.nowdock 0.1 as NowDock import org.kde.latte.dock 0.1 as LatteDock
Item{ Item{
id:barLine id:barLine
@ -43,8 +43,8 @@ Item{
width: root.isHorizontal ? panelWidth : smallSize width: root.isHorizontal ? panelWidth : smallSize
height: root.isVertical ? panelHeight : smallSize height: root.isVertical ? panelHeight : smallSize
property int spacing: (root.panelAlignment === NowDock.PanelWindow.Center property int spacing: (root.panelAlignment === LatteDock.Types.Center
|| plasmoid.configuration.panelPosition === NowDock.PanelWindow.Double) ? || plasmoid.configuration.panelPosition === LatteDock.Types.Double) ?
root.panelEdgeSpacing : root.panelEdgeSpacing/2 root.panelEdgeSpacing : root.panelEdgeSpacing/2
property int smallSize: Math.max(3.7*root.statesLineSize, 16) property int smallSize: Math.max(3.7*root.statesLineSize, 16)
@ -133,7 +133,7 @@ Item{
///Left ///Left
State { State {
name: "leftCenter" name: "leftCenter"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.PanelWindow.Center) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -151,7 +151,7 @@ Item{
///Left ///Left
State { State {
name: "leftTop" name: "leftTop"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.PanelWindow.Top) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Top)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -169,7 +169,7 @@ Item{
///Left ///Left
State { State {
name: "leftBottom" name: "leftBottom"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.PanelWindow.Bottom) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Bottom)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -186,7 +186,7 @@ Item{
}, },
State { State {
name: "leftDouble" name: "leftDouble"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.PanelWindow.Double) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -204,7 +204,7 @@ Item{
///Right ///Right
State { State {
name: "rightCenter" name: "rightCenter"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.PanelWindow.Center) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -221,7 +221,7 @@ Item{
}, },
State { State {
name: "rightTop" name: "rightTop"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.PanelWindow.Top) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Top)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -238,7 +238,7 @@ Item{
}, },
State { State {
name: "rightBottom" name: "rightBottom"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.PanelWindow.Bottom) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Bottom)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -255,7 +255,7 @@ Item{
}, },
State { State {
name: "rightDouble" name: "rightDouble"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.PanelWindow.Double) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -273,7 +273,7 @@ Item{
///Bottom ///Bottom
State { State {
name: "bottomCenter" name: "bottomCenter"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.PanelWindow.Center) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -290,7 +290,7 @@ Item{
}, },
State { State {
name: "bottomLeft" name: "bottomLeft"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.PanelWindow.Left) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Left)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -307,7 +307,7 @@ Item{
}, },
State { State {
name: "bottomRight" name: "bottomRight"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.PanelWindow.Right) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Right)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -324,7 +324,7 @@ Item{
}, },
State { State {
name: "bottomDouble" name: "bottomDouble"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.PanelWindow.Double) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -342,7 +342,7 @@ Item{
///Top ///Top
State { State {
name: "topCenter" name: "topCenter"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.PanelWindow.Center) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -359,7 +359,7 @@ Item{
}, },
State { State {
name: "topLeft" name: "topLeft"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.PanelWindow.Left) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Left)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -376,7 +376,7 @@ Item{
}, },
State { State {
name: "topRight" name: "topRight"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.PanelWindow.Right) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Right)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -393,7 +393,7 @@ Item{
}, },
State { State {
name: "topDouble" name: "topDouble"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.PanelWindow.Double) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: barLine target: barLine

@ -6,7 +6,7 @@ import org.kde.plasma.plasmoid 2.0
import org.kde.taskmanager 0.1 as TaskManager import org.kde.taskmanager 0.1 as TaskManager
import org.kde.nowdock 0.1 as NowDock import org.kde.latte.dock 0.1 as LatteDock
Item{ Item{
id: manager id: manager
@ -90,7 +90,7 @@ Item{
function slotIsHoveredChanged() { function slotIsHoveredChanged() {
if(window.isHovered) { if(window.isHovered) {
//stop parent window timer for auto hiding //stop parent window timer for auto hiding
if ((window.visibility.panelVisibility === NowDock.PanelWindow.AutoHide)|| window.visibility.isDockWindowType) { if ((window.visibility.panelVisibility === LatteDock.Types.AutoHide)|| window.visibility.isDockWindowType) {
if(hideMagicWindowInAutoHide.forcedDisableHiding) { if(hideMagicWindowInAutoHide.forcedDisableHiding) {
hideMagicWindowInAutoHide.forcedDisableHiding = false; hideMagicWindowInAutoHide.forcedDisableHiding = false;
window.visibility.disableHiding = false; window.visibility.disableHiding = false;
@ -111,7 +111,7 @@ Item{
} }
function slotMustBeRaised() { function slotMustBeRaised() {
if ((window.visibility.panelVisibility === NowDock.PanelWindow.AutoHide) || window.visibility.isDockWindowType) { if ((window.visibility.panelVisibility === LatteDock.Types.AutoHide) || window.visibility.isDockWindowType) {
slidingAnimationAutoHiddenIn.init(); slidingAnimationAutoHiddenIn.init();
} else { } else {
slidingAnimation.init(true,false); slidingAnimation.init(true,false);
@ -123,7 +123,7 @@ Item{
} }
function slotMustBeLowered() { function slotMustBeLowered() {
if ((window.visibility.panelVisibility === NowDock.PanelWindow.AutoHide) || window.visibility.isDockWindowType ) { if ((window.visibility.panelVisibility === LatteDock.Types.AutoHide) || window.visibility.isDockWindowType ) {
slidingAnimationAutoHiddenOut.init(); slidingAnimationAutoHiddenOut.init();
} else { } else {
slidingAnimation.init(false,false); slidingAnimation.init(false,false);
@ -131,7 +131,7 @@ Item{
} }
function slotPanelVisibilityChanged() { function slotPanelVisibilityChanged() {
if (window.visibility.panelVisibility !== NowDock.PanelWindow.AutoHide) { if (window.visibility.panelVisibility !== LatteDock.Types.AutoHide) {
window.visibility.isAutoHidden = false; window.visibility.isAutoHidden = false;
} }
} }
@ -164,9 +164,9 @@ Item{
if (normalState && plasmoid.immutable) { if (normalState && plasmoid.immutable) {
//count panel length //count panel length
if(root.isHorizontal) { if(root.isHorizontal) {
tempLength = plasmoid.configuration.panelPosition === NowDock.Types.Double ? layoutsContainer.width + 0.5*space : mainLayout.width + space; tempLength = plasmoid.configuration.panelPosition === LatteDock.Types.Double ? layoutsContainer.width + 0.5*space : mainLayout.width + space;
} else { } else {
tempLength = plasmoid.configuration.panelPosition === NowDock.Types.Double ? layoutsContainer.height + 0.5*space : mainLayout.height + space; tempLength = plasmoid.configuration.panelPosition === LatteDock.Types.Double ? layoutsContainer.height + 0.5*space : mainLayout.height + space;
} }
tempThickness = thicknessNormalOriginal; tempThickness = thicknessNormalOriginal;
@ -175,7 +175,7 @@ Item{
tempThickness = thicknessMidOriginal; tempThickness = thicknessMidOriginal;
} }
if (window.visibility.isAutoHidden && ((window.visibility.panelVisibility === NowDock.Types.AutoHide) || window.visibility.isDockWindowType)) { if (window.visibility.isAutoHidden && ((window.visibility.panelVisibility === LatteDock.Types.AutoHide) || window.visibility.isDockWindowType)) {
tempThickness = thicknessAutoHidden; tempThickness = thicknessAutoHidden;
} }
@ -187,13 +187,13 @@ Item{
localY = 0; localY = 0;
} }
if (plasmoid.configuration.panelPosition === NowDock.Types.Double) { if (plasmoid.configuration.panelPosition === LatteDock.Types.Double) {
localX = (window.width/2) - (layoutsContainer.width/2) - 0.25*space; localX = (window.width/2) - (layoutsContainer.width/2) - 0.25*space;
} else if (root.panelAlignment === NowDock.Types.Left) { } else if (root.panelAlignment === LatteDock.Types.Left) {
localX = 0; localX = 0;
} else if (root.panelAlignment === NowDock.Types.Center) { } else if (root.panelAlignment === LatteDock.Types.Center) {
localX = (window.width/2) - (mainLayout.width/2) - (space/2); localX = (window.width/2) - (mainLayout.width/2) - (space/2);
} else if (root.panelAlignment === NowDock.Types.Right) { } else if (root.panelAlignment === LatteDock.Types.Right) {
localX = window.width - mainLayout.width - (space/2); localX = window.width - mainLayout.width - (space/2);
} }
} else if ((plasmoid.location === PlasmaCore.Types.LeftEdge) || (plasmoid.location === PlasmaCore.Types.RightEdge)){ } else if ((plasmoid.location === PlasmaCore.Types.LeftEdge) || (plasmoid.location === PlasmaCore.Types.RightEdge)){
@ -203,13 +203,13 @@ Item{
localX = window.width - tempThickness; localX = window.width - tempThickness;
} }
if (plasmoid.configuration.panelPosition === NowDock.Types.Double) { if (plasmoid.configuration.panelPosition === LatteDock.Types.Double) {
localY = (window.height/2) - (layoutsContainer.height/2) - 0.25*space; localY = (window.height/2) - (layoutsContainer.height/2) - 0.25*space;
} else if (root.panelAlignment === NowDock.Types.Top) { } else if (root.panelAlignment === LatteDock.Types.Top) {
localY = 0; localY = 0;
} else if (root.panelAlignment === NowDock.Types.Center) { } else if (root.panelAlignment === LatteDock.Types.Center) {
localY = (window.height/2) - (mainLayout.height/2) - (space/2); localY = (window.height/2) - (mainLayout.height/2) - (space/2);
} else if (root.panelAlignment === NowDock.Types.Bottom) { } else if (root.panelAlignment === LatteDock.Types.Bottom) {
localY = window.height - mainLayout.height - (space/2); localY = window.height - mainLayout.height - (space/2);
} }
} }
@ -435,7 +435,7 @@ Item{
interval: manager.inStartup ? 1000 : 500 interval: manager.inStartup ? 1000 : 500
onTriggered: { onTriggered: {
layoutsContainer.opacity = 1; layoutsContainer.opacity = 1;
if ((window.visibility.panelVisibility !== NowDock.PanelWindow.AutoHide) && !window.visibility.isDockWindowType) { if ((window.visibility.panelVisibility !== LatteDock.Types.AutoHide) && !window.visibility.isDockWindowType) {
slidingAnimation.init(true,false); slidingAnimation.init(true,false);
} else { } else {
slidingAnimationAutoHiddenIn.init(); slidingAnimationAutoHiddenIn.init();

@ -26,7 +26,7 @@ import org.kde.kquickcontrolsaddons 2.0
import org.kde.draganddrop 2.0 as DragDrop import org.kde.draganddrop 2.0 as DragDrop
import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.plasmoid 2.0
import org.kde.nowdock 0.1 as NowDock import org.kde.latte.dock 0.1 as LatteDock
import "LayoutManager.js" as LayoutManager import "LayoutManager.js" as LayoutManager
@ -74,11 +74,11 @@ DragDrop.DropArea {
property int themePanelSize: plasmoid.configuration.panelSize property int themePanelSize: plasmoid.configuration.panelSize
///FIXME: <delete> I can't remember why this is needed, maybe for the anchorings!!! In order for the Double Layout to not mess the anchorings... ///FIXME: <delete> I can't remember why this is needed, maybe for the anchorings!!! In order for the Double Layout to not mess the anchorings...
property int mainLayoutPosition: !plasmoid.immutable ? NowDock.Types.Center : (root.isVertical ? NowDock.Types.Top : NowDock.Types.Left) property int mainLayoutPosition: !plasmoid.immutable ? LatteDock.Types.Center : (root.isVertical ? LatteDock.Types.Top : LatteDock.Types.Left)
///FIXME: <delete> ///FIXME: <delete>
//property int panelAlignment: plasmoid.configuration.panelPosition !== NowDock.Types.Double ? plasmoid.configuration.panelPosition : mainLayoutPosition //property int panelAlignment: plasmoid.configuration.panelPosition !== LatteDock.Types.Double ? plasmoid.configuration.panelPosition : mainLayoutPosition
property int panelAlignment: plasmoid.immutable ? plasmoid.configuration.panelPosition : NowDock.Types.Center property int panelAlignment: plasmoid.immutable ? plasmoid.configuration.panelPosition : LatteDock.Types.Center
// property int panelAlignment: plasmoid.configuration.panelPosition // property int panelAlignment: plasmoid.configuration.panelPosition
@ -107,12 +107,12 @@ DragDrop.DropArea {
///END properties from nowDock ///END properties from nowDock
/* Layout.preferredWidth: plasmoid.immutable ? /* Layout.preferredWidth: plasmoid.immutable ?
(plasmoid.configuration.panelPosition === NowDock.Types.Double ? (plasmoid.configuration.panelPosition === LatteDock.Types.Double ?
layoutsContainer.width + 0.5*iconMargin : mainLayout.width + iconMargin) : layoutsContainer.width + 0.5*iconMargin : mainLayout.width + iconMargin) :
Screen.width //on unlocked state use the maximum Screen.width //on unlocked state use the maximum
Layout.preferredHeight: plasmoid.immutable ? Layout.preferredHeight: plasmoid.immutable ?
(plasmoid.configuration.panelPosition === NowDock.Types.Double ? (plasmoid.configuration.panelPosition === LatteDock.Types.Double ?
layoutsContainer.height + 0.5*iconMargin : mainLayout.height + iconMargin) : layoutsContainer.height + 0.5*iconMargin : mainLayout.height + iconMargin) :
Screen.height //on unlocked state use the maximum*/ Screen.height //on unlocked state use the maximum*/
@ -165,7 +165,7 @@ DragDrop.DropArea {
///Left Edge ///Left Edge
State { State {
name: "leftCenter" name: "leftCenter"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.Types.Center) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -178,7 +178,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "leftTop" name: "leftTop"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.Types.Top) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Top)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -191,7 +191,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "leftBottom" name: "leftBottom"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.Types.Bottom) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Bottom)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -204,7 +204,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "leftDouble" name: "leftDouble"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.Types.Double) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -218,7 +218,7 @@ DragDrop.DropArea {
///Right Edge ///Right Edge
State { State {
name: "rightCenter" name: "rightCenter"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.Types.Center) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -231,7 +231,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "rightTop" name: "rightTop"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.Types.Top) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Top)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -244,7 +244,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "rightBottom" name: "rightBottom"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.Types.Bottom) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Bottom)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -257,7 +257,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "rightDouble" name: "rightDouble"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.Types.Double) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -271,7 +271,7 @@ DragDrop.DropArea {
///Bottom Edge ///Bottom Edge
State { State {
name: "bottomCenter" name: "bottomCenter"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.Types.Center) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -284,7 +284,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "bottomLeft" name: "bottomLeft"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.Types.Left) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Left)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -297,7 +297,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "bottomRight" name: "bottomRight"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.Types.Right) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Right)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -310,7 +310,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "bottomDouble" name: "bottomDouble"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.Types.Double) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -324,7 +324,7 @@ DragDrop.DropArea {
///Top Edge ///Top Edge
State { State {
name: "topCenter" name: "topCenter"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.Types.Center) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -337,7 +337,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "topLeft" name: "topLeft"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.Types.Left) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Left)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -350,7 +350,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "topRight" name: "topRight"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.Types.Right) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Right)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -363,7 +363,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "topDouble" name: "topDouble"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.Types.Double) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: mainLayout target: mainLayout
@ -552,10 +552,10 @@ DragDrop.DropArea {
///to add applets ///to add applets
if (plasmoid.immutable) { if (plasmoid.immutable) {
if(root.isHorizontal) { if(root.isHorizontal) {
root.Layout.preferredWidth = (plasmoid.configuration.panelPosition === NowDock.Types.Double ? root.Layout.preferredWidth = (plasmoid.configuration.panelPosition === LatteDock.Types.Double ?
layoutsContainer.width + 0.5*iconMargin : mainLayout.width + iconMargin); layoutsContainer.width + 0.5*iconMargin : mainLayout.width + iconMargin);
} else { } else {
root.Layout.preferredHeight = (plasmoid.configuration.panelPosition === NowDock.Types.Double ? root.Layout.preferredHeight = (plasmoid.configuration.panelPosition === LatteDock.Types.Double ?
layoutsContainer.height + 0.5*iconMargin : mainLayout.height + iconMargin); layoutsContainer.height + 0.5*iconMargin : mainLayout.height + iconMargin);
} }
} else { } else {
@ -864,10 +864,10 @@ DragDrop.DropArea {
// console.log("------Entered check-----"); // console.log("------Entered check-----");
if (root.isVertical) { if (root.isVertical) {
layoutLength = (plasmoid.configuration.panelPosition === NowDock.Types.Double) ? layoutLength = (plasmoid.configuration.panelPosition === LatteDock.Types.Double) ?
mainLayout.height+secondLayout.height : mainLayout.height mainLayout.height+secondLayout.height : mainLayout.height
} else { } else {
layoutLength = (plasmoid.configuration.panelPosition === NowDock.Types.Double) ? layoutLength = (plasmoid.configuration.panelPosition === LatteDock.Types.Double) ?
mainLayout.width+secondLayout.width : mainLayout.width mainLayout.width+secondLayout.width : mainLayout.width
} }
@ -951,7 +951,7 @@ DragDrop.DropArea {
////BEGIN interfaces ////BEGIN interfaces
NowDock.WindowSystem { LatteDock.WindowSystem {
id:windowSystem id:windowSystem
} }
@ -1018,7 +1018,7 @@ DragDrop.DropArea {
onExited: { onExited: {
if (plasmoid.immutable && magicWin && !magicWin.isHovered if (plasmoid.immutable && magicWin && !magicWin.isHovered
&& ((magicWin.panelVisibility === NowDock.Types.AutoHide) || magicWin.isDockWindowType) ) { && ((magicWin.panelVisibility === LatteDock.Types.AutoHide) || magicWin.isDockWindowType) ) {
hideMagicWindowInAutoHide.start(); hideMagicWindowInAutoHide.start();
} }
} }
@ -1029,7 +1029,7 @@ DragDrop.DropArea {
function showWindow() { function showWindow() {
if (plasmoid.immutable && magicWin if (plasmoid.immutable && magicWin
&& ((magicWin.panelVisibility === NowDock.Types.AutoHide) || magicWin.isDockWindowType) ) { && ((magicWin.panelVisibility === LatteDock.Types.AutoHide) || magicWin.isDockWindowType) ) {
magicWin.updateMaskArea(); magicWin.updateMaskArea();
magicWin.mustBeRaised(); magicWin.mustBeRaised();
} else { } else {
@ -1049,21 +1049,21 @@ DragDrop.DropArea {
signal updateScale(int delegateIndex, real newScale, real step) signal updateScale(int delegateIndex, real newScale, real step)
// property bool parentMagicWinFlag: plasmoid.immutable && magicWin && !root.inStartup && windowSystem.compositingActive // property bool parentMagicWinFlag: plasmoid.immutable && magicWin && !root.inStartup && windowSystem.compositingActive
//&& !(root.inStartup && magicWin.panelVisibility === NowDock.Types.AutoHide) //&& !(root.inStartup && magicWin.panelVisibility === LatteDock.Types.AutoHide)
property int allCount: root.nowDock ? mainLayout.count-1+nowDock.tasksCount : mainLayout.count property int allCount: root.nowDock ? mainLayout.count-1+nowDock.tasksCount : mainLayout.count
property int currentSpot: -1000 property int currentSpot: -1000
property int hoveredIndex: -1 property int hoveredIndex: -1
x: (plasmoid.configuration.panelPosition === NowDock.Types.Double) && root.isHorizontal x: (plasmoid.configuration.panelPosition === LatteDock.Types.Double) && root.isHorizontal
&& plasmoid.immutable && windowSystem.compositingActive ? && plasmoid.immutable && windowSystem.compositingActive ?
(dockView.width/2) - (dockView.visibility.maxLength/2): 0 (dockView.width/2) - (dockView.visibility.maxLength/2): 0
y: (plasmoid.configuration.panelPosition === NowDock.Types.Double) && root.isVertical y: (plasmoid.configuration.panelPosition === LatteDock.Types.Double) && root.isVertical
&& plasmoid.immutable && windowSystem.compositingActive ? && plasmoid.immutable && windowSystem.compositingActive ?
(dockView.height/2) - (dockView.visibility.maxLength/2): 0 (dockView.height/2) - (dockView.visibility.maxLength/2): 0
width: (plasmoid.configuration.panelPosition === NowDock.Types.Double) && root.isHorizontal && plasmoid.immutable ? width: (plasmoid.configuration.panelPosition === LatteDock.Types.Double) && root.isHorizontal && plasmoid.immutable ?
dockView.visibility.maxLength : parent.width dockView.visibility.maxLength : parent.width
height: (plasmoid.configuration.panelPosition === NowDock.Types.Double) && root.isVertical && plasmoid.immutable ? height: (plasmoid.configuration.panelPosition === LatteDock.Types.Double) && root.isVertical && plasmoid.immutable ?
dockView.visibility.maxLength : parent.height dockView.visibility.maxLength : parent.height
Component.onCompleted: { Component.onCompleted: {
@ -1159,7 +1159,7 @@ DragDrop.DropArea {
states:[ states:[
State { State {
name: "bottom" name: "bottom"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === NowDock.Types.Double) when: (plasmoid.location === PlasmaCore.Types.BottomEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: secondLayout target: secondLayout
@ -1172,7 +1172,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "left" name: "left"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === NowDock.Types.Double) when: (plasmoid.location === PlasmaCore.Types.LeftEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: secondLayout target: secondLayout
@ -1185,7 +1185,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "right" name: "right"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === NowDock.Types.Double) when: (plasmoid.location === PlasmaCore.Types.RightEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: secondLayout target: secondLayout
@ -1198,7 +1198,7 @@ DragDrop.DropArea {
}, },
State { State {
name: "top" name: "top"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === NowDock.Types.Double) when: (plasmoid.location === PlasmaCore.Types.TopEdge)&&(root.panelAlignment === LatteDock.Types.Double)
AnchorChanges { AnchorChanges {
target: secondLayout target: secondLayout
@ -1232,7 +1232,7 @@ DragDrop.DropArea {
var visibility = dockView.visibility; var visibility = dockView.visibility;
if (plasmoid.immutable && !visibility.isHovered //&& !wholeArea.containsMouse if (plasmoid.immutable && !visibility.isHovered //&& !wholeArea.containsMouse
&& ((visibility.panelVisibility === NowDock.Types.AutoHide) || visibility.isDockWindowType) ) { && ((visibility.panelVisibility === LatteDock.Types.AutoHide) || visibility.isDockWindowType) ) {
visibility.mustBeLowered(); visibility.mustBeLowered();
} }
} }

@ -12,7 +12,7 @@ include(KDEPackageAppTemplates)
set(nowdock-app_SRCS set(nowdock-app_SRCS
../libnowdock/types.cpp ../liblattedock/types.cpp
abstractinterface.cpp abstractinterface.cpp
xwindowinterface.cpp xwindowinterface.cpp
visibilitymanager.cpp visibilitymanager.cpp

@ -35,7 +35,7 @@
#include <KActionCollection> #include <KActionCollection>
#include "nowdockcorona.h" #include "nowdockcorona.h"
//using Candil::Dock;
NowDockView::NowDockView(Plasma::Corona *corona, QScreen *targetScreen) NowDockView::NowDockView(Plasma::Corona *corona, QScreen *targetScreen)
: PlasmaQuick::ContainmentView(corona), : PlasmaQuick::ContainmentView(corona),

@ -4,7 +4,7 @@
#include "xwindowinterface.h" #include "xwindowinterface.h"
#include "plasmaquick/containmentview.h" #include "plasmaquick/containmentview.h"
#include "../libnowdock/types.h" #include "../liblattedock/types.h"
#include <QDebug> #include <QDebug>
@ -43,7 +43,7 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view) :
connect(&m_initTimer, &QTimer::timeout, this, &VisibilityManager::initWindow); connect(&m_initTimer, &QTimer::timeout, this, &VisibilityManager::initWindow);
connect(this, SIGNAL(panelVisibilityChanged()), this, SLOT(updateVisibilityFlags())); connect(this, SIGNAL(panelVisibilityChanged()), this, SLOT(updateVisibilityFlags()));
setPanelVisibility(NowDock::Types::BelowActive); setPanelVisibility(LatteDock::Types::BelowActive);
// updateVisibilityFlags(); // updateVisibilityFlags();
// connect(this, SIGNAL(locationChanged()), this, SLOT(updateWindowPosition())); // connect(this, SIGNAL(locationChanged()), this, SLOT(updateWindowPosition()));
@ -67,12 +67,12 @@ void VisibilityManager::setContainment(Plasma::Containment *containment)
} }
NowDock::Types::Visibility VisibilityManager::panelVisibility() const LatteDock::Types::Visibility VisibilityManager::panelVisibility() const
{ {
return m_panelVisibility; return m_panelVisibility;
} }
void VisibilityManager::setPanelVisibility(NowDock::Types::Visibility state) void VisibilityManager::setPanelVisibility(LatteDock::Types::Visibility state)
{ {
if (m_panelVisibility == state) { if (m_panelVisibility == state) {
return; return;
@ -268,7 +268,7 @@ void VisibilityManager::updateState()
//update the dock behavior //update the dock behavior
switch (m_panelVisibility) { switch (m_panelVisibility) {
case NowDock::Types::BelowActive: case LatteDock::Types::BelowActive:
if (!m_interface->desktopIsActive() && m_interface->dockIntersectsActiveWindow()) { if (!m_interface->desktopIsActive() && m_interface->dockIntersectsActiveWindow()) {
if (m_interface->dockIsOnTop() || (m_isDockWindowType && !m_isAutoHidden)) { if (m_interface->dockIsOnTop() || (m_isDockWindowType && !m_isAutoHidden)) {
// qDebug() << m_isHovered << " - " << m_windowIsInAttention << " - "<< m_disableHiding; // qDebug() << m_isHovered << " - " << m_windowIsInAttention << " - "<< m_disableHiding;
@ -297,7 +297,7 @@ void VisibilityManager::updateState()
break; break;
case NowDock::Types::BelowMaximized: case LatteDock::Types::BelowMaximized:
if (!m_interface->desktopIsActive() && m_interface->activeIsMaximized() && m_interface->dockIntersectsActiveWindow()) { if (!m_interface->desktopIsActive() && m_interface->activeIsMaximized() && m_interface->dockIntersectsActiveWindow()) {
if (m_interface->dockIsOnTop() || (m_isDockWindowType && !m_isAutoHidden)) { if (m_interface->dockIsOnTop() || (m_isDockWindowType && !m_isAutoHidden)) {
if (!m_isHovered && !m_windowIsInAttention && !m_disableHiding) { if (!m_isHovered && !m_windowIsInAttention && !m_disableHiding) {
@ -321,7 +321,7 @@ void VisibilityManager::updateState()
break; break;
case NowDock::Types::LetWindowsCover: case LatteDock::Types::LetWindowsCover:
//this is not supported in clean Dock Window Types such as in wayland case //this is not supported in clean Dock Window Types such as in wayland case
if (m_isDockWindowType) { if (m_isDockWindowType) {
@ -348,11 +348,11 @@ void VisibilityManager::updateState()
break; break;
case NowDock::Types::WindowsGoBelow: case LatteDock::Types::WindowsGoBelow:
//Do nothing, the dock is OnTop state in every case //Do nothing, the dock is OnTop state in every case
break; break;
case NowDock::Types::AutoHide: case LatteDock::Types::AutoHide:
if (m_windowIsInAttention && m_isAutoHidden) { if (m_windowIsInAttention && m_isAutoHidden) {
emit mustBeRaised(); emit mustBeRaised();
} else if (!m_isHovered && !m_disableHiding) { } else if (!m_isHovered && !m_disableHiding) {
@ -361,7 +361,7 @@ void VisibilityManager::updateState()
break; break;
case NowDock::Types::AlwaysVisible: case LatteDock::Types::AlwaysVisible:
//Do nothing, the dock in OnTop state in every case //Do nothing, the dock in OnTop state in every case
break; break;
} }
@ -389,9 +389,9 @@ void VisibilityManager::showOnBottom()
/***************/ /***************/
void VisibilityManager::activeWindowChanged() void VisibilityManager::activeWindowChanged()
{ {
if ((m_panelVisibility == NowDock::Types::WindowsGoBelow) if ((m_panelVisibility == LatteDock::Types::WindowsGoBelow)
|| (m_panelVisibility == NowDock::Types::AlwaysVisible) || (m_panelVisibility == LatteDock::Types::AlwaysVisible)
|| (m_panelVisibility == NowDock::Types::AutoHide)) { || (m_panelVisibility == LatteDock::Types::AutoHide)) {
return; return;
} }
@ -407,8 +407,8 @@ void VisibilityManager::activeWindowChanged()
//the dock is totally hidden underneath //the dock is totally hidden underneath
void VisibilityManager::showOnTopCheck() void VisibilityManager::showOnTopCheck()
{ {
if ((m_panelVisibility == NowDock::Types::BelowActive) || (m_panelVisibility == NowDock::Types::BelowMaximized) if ((m_panelVisibility == LatteDock::Types::BelowActive) || (m_panelVisibility == LatteDock::Types::BelowMaximized)
|| (m_panelVisibility == NowDock::Types::LetWindowsCover)) { || (m_panelVisibility == LatteDock::Types::LetWindowsCover)) {
if (m_interface->dockIsCovered(true)) { if (m_interface->dockIsCovered(true)) {
m_updateStateTimer.stop(); m_updateStateTimer.stop();
setIsHovered(true); setIsHovered(true);
@ -430,7 +430,7 @@ bool VisibilityManager::event(QEvent *event)
m_updateStateTimer.stop(); m_updateStateTimer.stop();
setIsHovered(true); setIsHovered(true);
if ((m_panelVisibility == NowDock::Types::AutoHide) || (m_isDockWindowType)) { if ((m_panelVisibility == LatteDock::Types::AutoHide) || (m_isDockWindowType)) {
if (m_isAutoHidden) { if (m_isAutoHidden) {
emit mustBeRaised(); emit mustBeRaised();
} }
@ -440,8 +440,8 @@ bool VisibilityManager::event(QEvent *event)
} else if (event->type() == QEvent::Leave) { } else if (event->type() == QEvent::Leave) {
setIsHovered(false); setIsHovered(false);
if ((m_panelVisibility != NowDock::Types::WindowsGoBelow) if ((m_panelVisibility != LatteDock::Types::WindowsGoBelow)
&& (m_panelVisibility != NowDock::Types::AlwaysVisible)) { && (m_panelVisibility != LatteDock::Types::AlwaysVisible)) {
m_updateStateTimer.start(); m_updateStateTimer.start();
} }
} }

@ -2,7 +2,7 @@
#define VISIBILITYMANAGER_H #define VISIBILITYMANAGER_H
#include <QObject> #include <QObject>
#include "../libnowdock/types.h" #include "../liblattedock/types.h"
#include "abstractinterface.h" #include "abstractinterface.h"
#include "plasmaquick/containmentview.h" #include "plasmaquick/containmentview.h"
@ -20,7 +20,7 @@ class VisibilityManager : public QObject {
Q_PROPERTY(bool isHovered READ isHovered NOTIFY isHoveredChanged) Q_PROPERTY(bool isHovered READ isHovered NOTIFY isHoveredChanged)
Q_PROPERTY(bool windowInAttention READ windowInAttention WRITE setWindowInAttention NOTIFY windowInAttentionChanged) Q_PROPERTY(bool windowInAttention READ windowInAttention WRITE setWindowInAttention NOTIFY windowInAttentionChanged)
Q_PROPERTY(NowDock::Types::Visibility panelVisibility READ panelVisibility WRITE setPanelVisibility NOTIFY panelVisibilityChanged) Q_PROPERTY(LatteDock::Types::Visibility panelVisibility READ panelVisibility WRITE setPanelVisibility NOTIFY panelVisibilityChanged)
public: public:
explicit VisibilityManager(PlasmaQuick::ContainmentView *view); explicit VisibilityManager(PlasmaQuick::ContainmentView *view);
@ -39,10 +39,10 @@ public:
bool windowInAttention() const; bool windowInAttention() const;
NowDock::Types::Visibility panelVisibility() const; LatteDock::Types::Visibility panelVisibility() const;
void setContainment(Plasma::Containment *contaiment); void setContainment(Plasma::Containment *contaiment);
void setMaskArea(QRect area); void setMaskArea(QRect area);
void setPanelVisibility(NowDock::Types::Visibility state); void setPanelVisibility(LatteDock::Types::Visibility state);
public slots: public slots:
Q_INVOKABLE void initialize(); Q_INVOKABLE void initialize();
@ -94,13 +94,10 @@ private:
PlasmaQuick::ContainmentView *m_view; PlasmaQuick::ContainmentView *m_view;
NowDock::AbstractInterface *m_interface; NowDock::AbstractInterface *m_interface;
NowDock::Types::Visibility m_panelVisibility; LatteDock::Types::Visibility m_panelVisibility;
}; };
#endif #endif

@ -0,0 +1,30 @@
set (REQUIRED_QT_VERSION "5.6.0")
find_package(ECM 1.8.0 REQUIRED NO_MODULE)
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Quick Qml)
find_package(KF5 REQUIRED COMPONENTS
WindowSystem
CoreAddons
)
set(CMAKE_AUTOMOC ON)
set(lattedock_SRCS
lattedockplugin.cpp
windowsystem.cpp
types.cpp
)
add_library(lattedockplugin SHARED ${lattedock_SRCS})
target_link_libraries(lattedockplugin
Qt5::Quick
Qt5::Qml
KF5::WindowSystem
KF5::CoreAddons
)
install(TARGETS lattedockplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/latte/dock)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/latte/dock)

@ -0,0 +1,14 @@
#include "lattedockplugin.h"
#include "windowsystem.h"
#include "types.h"
#include <qqml.h>
void LatteDockPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.latte.dock"));
qmlRegisterUncreatableType<LatteDock::Types>(uri, 0, 1, "Types", "LatteDock Types uncreatable");
qmlRegisterType<LatteDock::WindowSystem>(uri, 0, 1, "WindowSystem");
}

@ -1,9 +1,9 @@
#ifndef NOWDOCKPLUGIN_H #ifndef LATTEDOCKPLUGIN_H
#define NOWDOCKPLUGIN_H #define LATTEDOCKPLUGIN_H
#include <QQmlExtensionPlugin> #include <QQmlExtensionPlugin>
class NowDockPlugin : public QQmlExtensionPlugin { class LatteDockPlugin : public QQmlExtensionPlugin {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")

@ -0,0 +1,2 @@
module org.kde.latte.dock
plugin lattedockplugin

@ -5,7 +5,7 @@
#include <QMetaEnum> #include <QMetaEnum>
#include <QMetaType> #include <QMetaType>
namespace NowDock { namespace LatteDock {
class Types { class Types {
Q_GADGET Q_GADGET

@ -2,7 +2,7 @@
#include <KWindowSystem> #include <KWindowSystem>
namespace NowDock { namespace LatteDock {
WindowSystem::WindowSystem(QObject *parent) : WindowSystem::WindowSystem(QObject *parent) :
QObject(parent) QObject(parent)
@ -24,4 +24,4 @@ void WindowSystem::compositingChanged(bool state)
emit compositingChanged(); emit compositingChanged();
} }
} } //end of namespace

@ -1,9 +1,9 @@
#ifndef WINDOWSYSTEM_H #ifndef WINDOWSYSTEM_H
#define WINDOWSYSTEM_H #define WINDOWSYSTEM_H
#include "abstractinterface.h" #include <QObject>
namespace NowDock { namespace LatteDock {
class WindowSystem : public QObject { class WindowSystem : public QObject {
Q_OBJECT Q_OBJECT
@ -23,6 +23,6 @@ private Q_SLOTS:
void compositingChanged(bool state); void compositingChanged(bool state);
}; };
}//NowDock namespace }//LatteDock namespace
#endif #endif

@ -1,39 +0,0 @@
set (REQUIRED_QT_VERSION "5.6.0")
find_package(ECM 1.8.0 REQUIRED NO_MODULE)
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Quick Qml)
find_package(KF5 REQUIRED COMPONENTS
Plasma
PlasmaQuick
WindowSystem
KDELibs4Support
CoreAddons
)
set(CMAKE_AUTOMOC ON)
set(nowdock_SRCS
nowdockplugin.cpp
panelwindow.cpp
windowsystem.cpp
xwindowinterface.cpp
abstractinterface.cpp
types.cpp
)
add_library(nowdockplugin SHARED ${nowdock_SRCS})
target_link_libraries(nowdockplugin
Qt5::Quick
Qt5::Qml
KF5::Plasma
KF5::PlasmaQuick
KF5::WindowSystem
KF5::KDELibs4Support
KF5::CoreAddons
)
install(TARGETS nowdockplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/nowdock)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/nowdock)

@ -1,42 +0,0 @@
#include "abstractinterface.h"
#include <QObject>
#include <QQuickWindow>
namespace NowDock {
AbstractInterface::AbstractInterface(QQuickWindow *dock) :
QObject(dock),
m_isDockWindowType(false),
m_dockNumber(0)
{
m_dockWindow = dock;
}
void AbstractInterface::setDockNumber(unsigned int no)
{
if (m_dockNumber == no) {
return;
}
m_dockNumber = no;
emit dockNumberChanged(m_dockNumber);
}
unsigned int AbstractInterface::dockNumber() const
{
return m_dockNumber;
}
void AbstractInterface::setMaskArea(QRect area)
{
if (m_maskArea == area) {
return;
}
m_maskArea = area;
}
}

@ -1,56 +0,0 @@
#ifndef ABSTRACTINTERFACE_H
#define ABSTRACTINTERFACE_H
#include <QObject>
#include <QQuickWindow>
namespace NowDock {
class AbstractInterface : public QObject {
Q_OBJECT
public:
explicit AbstractInterface(QQuickWindow *dock);
virtual bool activeIsDialog() const = 0;
virtual bool activeIsMaximized() const = 0;
virtual bool desktopIsActive() const = 0;
virtual bool dockIntersectsActiveWindow() const = 0;
virtual bool dockIsCovered(bool totally = false) const = 0;
virtual bool dockIsCovering() const = 0;
virtual bool dockIsOnTop() const = 0;
virtual bool dockInNormalState() const = 0;
virtual bool dockIsBelow() const = 0;
//FIXME: This may not be needed, it would be better to investigate in KWindowSystem
//its behavior when setting the window type to NET::Dock
virtual void setDockDefaultFlags(bool dock = false) = 0;
virtual void setDockToAllDesktops() = 0;
virtual void showDockAsNormal() = 0;
virtual void showDockOnBottom() = 0;
virtual void showDockOnTop() = 0;
void setDockNumber(unsigned int no);
unsigned int dockNumber() const;
void setMaskArea(QRect area);
Q_SIGNALS:
void activeWindowChanged();
void dockNumberChanged(unsigned int no);
void windowInAttention(bool);
//FIXME: there is a chance that this signal is not needed at all
void windowChanged();
protected:
bool m_isDockWindowType;
int m_dockNumber;
QRect m_maskArea;
QQuickWindow *m_dockWindow;
};
}
#endif

@ -1,17 +0,0 @@
#include "nowdockplugin.h"
#include "panelwindow.h"
#include "windowsystem.h"
#include "types.h"
#include <qqml.h>
void NowDockPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.nowdock"));
qmlRegisterUncreatableType<NowDock::Types>(uri, 0, 1, "Types", "NowDock Types uncreatable");
qmlRegisterType<NowDock::PanelWindow>(uri, 0, 1, "PanelWindow");
qmlRegisterType<NowDock::WindowSystem>(uri, 0, 1, "WindowSystem");
}

File diff suppressed because it is too large Load Diff

@ -1,203 +0,0 @@
#ifndef PANELWINDOW_H
#define PANELWINDOW_H
#include <QMenu>
#include <QQuickWindow>
#include <QTimer>
#include <plasma/plasma.h>
#include <Plasma/Applet>
#include <Plasma/Containment>
#include <PlasmaQuick/AppletQuickItem>
#include "abstractinterface.h"
#include "windowsystem.h"
namespace NowDock {
class PanelWindow : public QQuickWindow {
Q_OBJECT
Q_ENUMS(PanelVisibility)
Q_ENUMS(Alignment)
Q_PROPERTY(bool disableHiding READ disableHiding WRITE setDisableHiding NOTIFY disableHidingChanged)
Q_PROPERTY(bool immutable READ immutable WRITE setImmutable NOTIFY immutableChanged)
Q_PROPERTY(bool isAutoHidden READ isAutoHidden WRITE setIsAutoHidden NOTIFY isAutoHiddenChanged)
Q_PROPERTY(bool isDockWindowType READ isDockWindowType WRITE setIsDockWindowType NOTIFY isDockWindowTypeChanged)
Q_PROPERTY(bool isHovered READ isHovered NOTIFY isHoveredChanged)
Q_PROPERTY(bool windowInAttention READ windowInAttention WRITE setWindowInAttention NOTIFY windowInAttentionChanged)
Q_PROPERTY(int childrenLength READ childrenLength WRITE setChildrenLength NOTIFY childrenLengthChanged)
Q_PROPERTY(unsigned int maximumLength READ maximumLength NOTIFY maximumLengthChanged)
/**
* the window mask, can be used in real transparent panels that set only the visual area
* of the window
* @since 5.8
*/
Q_PROPERTY(QRect maskArea READ maskArea WRITE setMaskArea NOTIFY maskAreaChanged)
/**
* the dock's screen geometry, e.g. it is used to set correctly x, y values
*/
Q_PROPERTY(QRect screenGeometry READ screenGeometry NOTIFY screenGeometryChanged)
Q_PROPERTY(Plasma::Types::Location location READ location WRITE setLocation NOTIFY locationChanged)
Q_PROPERTY(PanelVisibility panelVisibility READ panelVisibility WRITE setPanelVisibility NOTIFY panelVisibilityChanged)
public:
enum PanelVisibility {
BelowActive = 0, /** always visible except if ovelaps with the active window, no area reserved */
BelowMaximized, /** always visible except if ovelaps with an active maximize window, no area reserved */
LetWindowsCover, /** always visible, windows will go over the panel, no area reserved */
WindowsGoBelow, /** default, always visible, windows will go under the panel, no area reserved */
AutoHide, /** the panel will be shownn only if the mouse cursor is on screen edges */
AlwaysVisible, /** always visible panel, "Normal" plasma panel, accompanies plasma's "Always Visible" */
};
enum Alignment {
Center = 0,
Left,
Right,
Top,
Bottom,
Double = 10
};
explicit PanelWindow(QQuickWindow *parent = Q_NULLPTR);
~PanelWindow();
bool disableHiding() const;
void setDisableHiding(bool state);
bool immutable() const;
void setImmutable(bool state);
bool isAutoHidden() const;
void setIsAutoHidden(bool state);
bool isDockWindowType() const;
void setIsDockWindowType(bool state);
bool isHovered() const;
bool windowInAttention() const;
// void setWindowInAttention(bool state);
int childrenLength() const;
void setChildrenLength(int value);
unsigned int maximumLength() const;
QRect maskArea() const;
void setMaskArea(QRect area);
QRect screenGeometry() const;
Plasma::Types::Location location() const;
void setLocation(Plasma::Types::Location location);
PanelVisibility panelVisibility() const;
void setPanelVisibility(PanelVisibility state);
Q_SIGNALS:
void childrenLengthChanged();
void disableHidingChanged();
void immutableChanged();
void isAutoHiddenChanged();
void isDockWindowTypeChanged();
void isHoveredChanged();
void locationChanged();
void maskAreaChanged();
void maximumLengthChanged();
void mustBeLowered();
void mustBeRaised(); //are used to triger the sliding animations from the qml part
void mustBeRaisedImmediately();
void panelVisibilityChanged();
void screenGeometryChanged();
void windowInAttentionChanged();
public slots:
Q_INVOKABLE void addAppletItem(QObject *item);
Q_INVOKABLE void initialize();
Q_INVOKABLE void removeAppletItem(QObject *item);
Q_INVOKABLE void setTransientThickness(unsigned int thickness);
Q_INVOKABLE void showNormal();
Q_INVOKABLE void showOnTop();
Q_INVOKABLE void showOnTopCheck();
Q_INVOKABLE void showOnBottom();
void setWindowInAttention(bool state);
protected:
bool event(QEvent *event) override;
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
private Q_SLOTS:
void activeWindowChanged();
void compositingChanged();
void updateState();
void initWindow();
void menuAboutToHide();
void setIsHovered(bool state);
void screenChanged(QScreen *screen);
void setScreenGeometry(QRect geometry);
void shrinkTransient();
void transientPositionChanged();
void updateVisibilityFlags();
void updateWindowPosition();
private:
bool m_disableHiding;
bool m_immutable;
bool m_isAutoHidden;
bool m_isDockWindowType;
bool m_isHovered;
//second pass of the initialization
bool m_secondInitPass;
bool m_windowIsInAttention;
int m_childrenLength;
int m_tempThickness;
unsigned int m_maximumLength;
QPointer<Plasma::Containment> m_containment;
QRect m_maskArea;
QRect m_screenGeometry;
QScreen *m_screen;
QList<PlasmaQuick::AppletQuickItem *> m_appletItems;
QTimer m_initTimer;
QTimer m_triggerShrinkTransient;
QTimer m_updateStateTimer;
QWeakPointer<QMenu> m_contextMenu;
QWindow *m_transient;
Qt::Orientations m_panelOrientation;
Plasma::Types::Location m_location;
PanelVisibility m_panelVisibility;
AbstractInterface *m_interface;
WindowSystem *m_windowSystem;
void addAppletActions(QMenu *desktopMenu, Plasma::Applet *applet, QEvent *event);
void addContainmentActions(QMenu *desktopMenu, QEvent *event);
void setPanelOrientation(Plasma::Types::Location location);
void setPanelScreen(QScreen *screen);
void updateMaximumLength();
void updateTransient();
};
} //NowDock namespace
#endif

@ -1,2 +0,0 @@
module org.kde.nowdock
plugin nowdockplugin

@ -1,361 +0,0 @@
#include "xwindowinterface.h"
#include <QDebug>
#include <KWindowInfo>
#include <KWindowSystem>
namespace NowDock {
XWindowInterface::XWindowInterface(QQuickWindow *parent) :
AbstractInterface(parent),
m_demandsAttention(0)
{
m_activeWindow = KWindowSystem::activeWindow();
connect(KWindowSystem::self(), SIGNAL(activeWindowChanged(WId)), this, SLOT(activeWindowChanged(WId)));
connect(KWindowSystem::self(), SIGNAL(windowChanged(WId, NET::Properties, NET::Properties2)), this, SLOT(windowChanged(WId, NET::Properties, NET::Properties2)));
connect(KWindowSystem::self(), SIGNAL(windowRemoved(WId)), this, SLOT(windowRemoved(WId)));
connect(this, SIGNAL(dockNumberChanged(uint)), this, SLOT(dockNumberChanged(uint)));
}
XWindowInterface::~XWindowInterface()
{
}
void XWindowInterface::dockNumberChanged(unsigned int no)
{
if (no == 1) {
m_dockWindow->setFlags(Qt::Tool | Qt::WindowDoesNotAcceptFocus | Qt::FramelessWindowHint);
}
}
void XWindowInterface::setDockToAllDesktops()
{
KWindowSystem::setOnAllDesktops(m_dockWindow->winId(), true);
}
void XWindowInterface::setDockDefaultFlags(bool dock)
{
//Notice: the Qt::Tool flag even though it works perfectly for a single Now Dock
//it creates a strange situation when there are two and more Now Dock's
//in that case it is used only for the first created Now Dock
m_isDockWindowType = dock;
if ((m_dockNumber == 1) && (!m_isDockWindowType)) {
m_dockWindow->setFlags(Qt::Tool | Qt::WindowDoesNotAcceptFocus | Qt::FramelessWindowHint);
} else {
KWindowSystem::setType(m_dockWindow->winId(), NET::Dock);
KWindowSystem::setState(m_dockWindow->winId(), NET::SkipTaskbar | NET::SkipPager);
}
}
void XWindowInterface::showDockOnTop()
{
//this is the only way in order to not break the case of two and more NowDocks
//there is a small issue that the pop ups from locked plasmoids are opened
//on the maximum thickness
//qDebug() << "Docknumber:" << m_dockNumber;
if (m_isDockWindowType) {
return;
}
if (m_dockNumber != 1) {
KWindowSystem::setType(m_dockWindow->winId(), NET::Dock);
}
KWindowSystem::clearState(m_dockWindow->winId(), NET::KeepBelow);
KWindowSystem::setState(m_dockWindow->winId(), NET::KeepAbove);
}
void XWindowInterface::showDockAsNormal()
{
// qDebug() << "reached make normal...";
if (m_isDockWindowType) {
return;
}
if (m_dockNumber != 1) {
m_dockWindow->setFlags(Qt::Tool | Qt::WindowDoesNotAcceptFocus | Qt::FramelessWindowHint);
}
KWindowSystem::clearState(m_dockWindow->winId(), NET::KeepAbove);
KWindowSystem::clearState(m_dockWindow->winId(), NET::KeepBelow);
}
void XWindowInterface::showDockOnBottom()
{
// qDebug() << "reached make bottom...";
if (m_isDockWindowType) {
return;
}
if (m_dockNumber != 1) {
m_dockWindow->setFlags(Qt::Tool | Qt::WindowDoesNotAcceptFocus | Qt::FramelessWindowHint);
}
KWindowSystem::clearState(m_dockWindow->winId(), NET::KeepAbove);
KWindowSystem::setState(m_dockWindow->winId(), NET::KeepBelow);
}
bool XWindowInterface::isDesktop(WId id) const
{
KWindowInfo info(id, NET::WMWindowType);
if (!info.valid()) {
return false;
}
NET::WindowType type = info.windowType(NET::DesktopMask | NET::DockMask | NET::DialogMask);
return type == NET::Desktop;
}
bool XWindowInterface::isDialog(WId id) const
{
KWindowInfo info(id, NET::WMWindowType);
if (!info.valid()) {
return false;
}
NET::WindowType type = info.windowType(NET::DesktopMask | NET::DockMask | NET::DialogMask);
return type == NET::Dialog;
}
bool XWindowInterface::isMaximized(WId id) const
{
KWindowInfo info(id, NET::WMState);
if (!info.valid()) {
return false;
}
return (info.hasState(NET::Max));
}
bool XWindowInterface::isNormal(WId id) const
{
return (!isOnBottom(id) && !isOnTop(id));
}
bool XWindowInterface::isOnBottom(WId id) const
{
KWindowInfo info(id, NET::WMState);
if (!info.valid()) {
return false;
}
return (info.hasState(NET::KeepBelow));
}
bool XWindowInterface::isOnTop(WId id) const
{
KWindowInfo info(id, NET::WMState);
if (!info.valid()) {
return false;
}
return (info.hasState(NET::KeepAbove));
}
bool XWindowInterface::activeIsDialog() const
{
return isDialog(m_activeWindow);
}
bool XWindowInterface::activeIsMaximized() const
{
return isMaximized(m_activeWindow);
}
bool XWindowInterface::desktopIsActive() const
{
return isDesktop(m_activeWindow);
}
bool XWindowInterface::dockIsOnTop() const
{
return isOnTop(m_dockWindow->winId());
}
bool XWindowInterface::dockInNormalState() const
{
return isNormal(m_dockWindow->winId());
}
bool XWindowInterface::dockIsBelow() const
{
return isOnBottom(m_dockWindow->winId());
}
bool XWindowInterface::dockIntersectsActiveWindow() const
{
KWindowInfo activeInfo(m_activeWindow, NET::WMGeometry);
if (activeInfo.valid()) {
QRect maskSize;
if (!m_maskArea.isNull()) {
maskSize = QRect(m_dockWindow->x() + m_maskArea.x(), m_dockWindow->y() + m_maskArea.y(), m_maskArea.width(), m_maskArea.height());
} else {
maskSize = QRect(m_dockWindow->x(), m_dockWindow->y(), m_dockWindow->width(), m_dockWindow->height());
}
return maskSize.intersects(activeInfo.geometry());
} else {
return false;
}
}
bool XWindowInterface::dockIsCovered(bool totally) const
{
int currentDockPos = -1;
QList<WId> windows = KWindowSystem::stackingOrder();
int size = windows.count();
for (int i = size - 1; i >= 0; --i) {
WId window = windows.at(i);
if (window == m_dockWindow->winId()) {
currentDockPos = i;
break;
}
}
if (currentDockPos >= 0) {
QRect maskSize;
if (!m_maskArea.isNull()) {
maskSize = QRect(m_dockWindow->x() + m_maskArea.x(), m_dockWindow->y() + m_maskArea.y(), m_maskArea.width(), m_maskArea.height());
} else {
maskSize = QRect(m_dockWindow->x(), m_dockWindow->y(), m_dockWindow->width(), m_dockWindow->height());
}
WId transient = 0;
if (m_dockWindow->transientParent()) {
transient = m_dockWindow->transientParent()->winId();
}
for (int j = size - 1; j > currentDockPos; --j) {
WId window = windows.at(j);
KWindowInfo info(window, NET::WMState | NET::XAWMState | NET::WMGeometry);
if (info.valid() && !isDesktop(window) && transient != window && !info.isMinimized()) {
if (totally) {
QRect winGeometry = info.geometry();
if ((maskSize.left() >= winGeometry.left()) && (maskSize.top() >= winGeometry.top())
&& (maskSize.right() <= winGeometry.right()) && (maskSize.bottom() <= winGeometry.bottom())) {
return true;
}
} else {
if (maskSize.intersects(info.geometry())) {
return true;
}
}
}
}
}
return false;
}
bool XWindowInterface::dockIsCovering() const
{
int currentDockPos = -1;
QList<WId> windows = KWindowSystem::stackingOrder();
int size = windows.count();
for (int i = size - 1; i >= 0; --i) {
WId window = windows.at(i);
if (window == m_dockWindow->winId()) {
currentDockPos = i;
break;
}
}
if (currentDockPos >= 0) {
QRect maskSize;
if (!m_maskArea.isNull()) {
maskSize = QRect(m_dockWindow->x() + m_maskArea.x(), m_dockWindow->y() + m_maskArea.y(), m_maskArea.width(), m_maskArea.height());
} else {
maskSize = QRect(m_dockWindow->x(), m_dockWindow->y(), m_dockWindow->width(), m_dockWindow->height());
}
WId transient = 0;
if (m_dockWindow->transientParent()) {
transient = m_dockWindow->transientParent()->winId();
}
for (int j = currentDockPos - 1; j >= 0; --j) {
WId window = windows.at(j);
KWindowInfo info(window, NET::WMState | NET::XAWMState | NET::WMGeometry);
if (info.valid() && !isDesktop(window) && transient != window && !info.isMinimized() && maskSize.intersects(info.geometry())) {
return true;
}
}
}
return false;
}
/*
* SLOTS
*/
void XWindowInterface::activeWindowChanged(WId win)
{
m_activeWindow = win;
emit AbstractInterface::activeWindowChanged();
}
void XWindowInterface::windowChanged(WId id, NET::Properties properties, NET::Properties2 properties2)
{
KWindowInfo info(id, NET::WMState | NET::CloseWindow);
if (info.valid()) {
if ((m_demandsAttention == 0) && info.hasState(NET::DemandsAttention)) {
m_demandsAttention = id;
emit windowInAttention(true);
} else if ((m_demandsAttention == id) && !info.hasState(NET::DemandsAttention)) {
m_demandsAttention = 0;
emit windowInAttention(false);
}
}
// emit AbstractInterface::windowChanged();
if (id == m_activeWindow) {
emit AbstractInterface::activeWindowChanged();
}
}
void XWindowInterface::windowRemoved(WId id)
{
if (id == m_demandsAttention) {
m_demandsAttention = 0;
emit AbstractInterface::windowInAttention(false);
}
}
}

@ -1,60 +0,0 @@
#ifndef XWINDOWINTERFACE_H
#define XWINDOWINTERFACE_H
#include <QObject>
#include <KWindowInfo>
#include "abstractinterface.h"
namespace NowDock {
class XWindowInterface : public AbstractInterface {
Q_OBJECT
public:
explicit XWindowInterface(QQuickWindow *parent);
~XWindowInterface();
bool activeIsDialog() const;
bool activeIsMaximized() const;
bool dockIntersectsActiveWindow() const;
bool desktopIsActive() const;
bool dockIsCovered(bool totally = false) const;
bool dockIsCovering() const;
bool dockIsOnTop() const;
bool dockInNormalState() const;
bool dockIsBelow() const;
void setDockDefaultFlags(bool dock = false);
void setDockToAllDesktops();
void setDockToAlwaysVisible();
void showDockAsNormal();
void showDockOnBottom();
void showDockOnTop();
private Q_SLOTS:
void activeWindowChanged(WId win);
void dockNumberChanged(unsigned int no);
void windowChanged(WId id, NET::Properties properties, NET::Properties2 properties2);
void windowRemoved(WId id);
private:
WId m_activeWindow;
WId m_demandsAttention;
bool isDesktop(WId id) const;
bool isDialog(WId id) const;
bool isMaximized(WId id) const;
bool isNormal(WId id) const;
bool isOnBottom(WId id) const;
bool isOnTop(WId id) const;
};
}
#endif

@ -29,7 +29,7 @@ import org.kde.plasma.private.taskmanager 0.1 as TaskManagerApplet
import org.kde.activities 0.1 as Activities import org.kde.activities 0.1 as Activities
import org.kde.nowdock 0.1 as NowDock import org.kde.latte.dock 0.1 as LatteDock
import "../code/tools.js" as TaskTools import "../code/tools.js" as TaskTools
import "../code/activitiesTools.js" as ActivitiesTools import "../code/activitiesTools.js" as ActivitiesTools
@ -217,7 +217,7 @@ Item {
// FIXME: at some point this must be dropped with NowDock plugin // FIXME: at some point this must be dropped with NowDock plugin
////BEGIN interfaces ////BEGIN interfaces
NowDock.WindowSystem{ LatteDock.WindowSystem{
id:windowSystem id:windowSystem
} }
@ -994,7 +994,7 @@ Item {
///Bottom Edge ///Bottom Edge
State { State {
name: "bottomCenter" name: "bottomCenter"
when: (panel.position === PlasmaCore.Types.BottomPosition && userPanelPosition===NowDock.Types.Center) when: (panel.position === PlasmaCore.Types.BottomPosition && userPanelPosition===LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1007,7 +1007,7 @@ Item {
}, },
State { State {
name: "bottomLeft" name: "bottomLeft"
when: (panel.position === PlasmaCore.Types.BottomPosition && userPanelPosition===NowDock.Types.Left) when: (panel.position === PlasmaCore.Types.BottomPosition && userPanelPosition===LatteDock.Types.Left)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1020,7 +1020,7 @@ Item {
}, },
State { State {
name: "bottomRight" name: "bottomRight"
when: (panel.position === PlasmaCore.Types.BottomPosition && userPanelPosition===NowDock.Types.Right) when: (panel.position === PlasmaCore.Types.BottomPosition && userPanelPosition===LatteDock.Types.Right)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1034,7 +1034,7 @@ Item {
///Top Edge ///Top Edge
State { State {
name: "topCenter" name: "topCenter"
when: (panel.position === PlasmaCore.Types.TopPosition && userPanelPosition===NowDock.Types.Center) when: (panel.position === PlasmaCore.Types.TopPosition && userPanelPosition===LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1047,7 +1047,7 @@ Item {
}, },
State { State {
name: "topLeft" name: "topLeft"
when: (panel.position === PlasmaCore.Types.TopPosition && userPanelPosition===NowDock.Types.Left) when: (panel.position === PlasmaCore.Types.TopPosition && userPanelPosition===LatteDock.Types.Left)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1060,7 +1060,7 @@ Item {
}, },
State { State {
name: "topRight" name: "topRight"
when: (panel.position === PlasmaCore.Types.TopPosition && userPanelPosition===NowDock.Types.Right) when: (panel.position === PlasmaCore.Types.TopPosition && userPanelPosition===LatteDock.Types.Right)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1074,7 +1074,7 @@ Item {
////Left Edge ////Left Edge
State { State {
name: "leftCenter" name: "leftCenter"
when: (panel.position === PlasmaCore.Types.LeftPosition && userPanelPosition===NowDock.Types.Center) when: (panel.position === PlasmaCore.Types.LeftPosition && userPanelPosition===LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1087,7 +1087,7 @@ Item {
}, },
State { State {
name: "leftTop" name: "leftTop"
when: (panel.position === PlasmaCore.Types.LeftPosition && userPanelPosition===NowDock.Types.Top) when: (panel.position === PlasmaCore.Types.LeftPosition && userPanelPosition===LatteDock.Types.Top)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1100,7 +1100,7 @@ Item {
}, },
State { State {
name: "leftBottom" name: "leftBottom"
when: (panel.position === PlasmaCore.Types.LeftPosition && userPanelPosition===NowDock.Types.Bottom) when: (panel.position === PlasmaCore.Types.LeftPosition && userPanelPosition===LatteDock.Types.Bottom)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1114,7 +1114,7 @@ Item {
///Right Edge ///Right Edge
State { State {
name: "rightCenter" name: "rightCenter"
when: (panel.position === PlasmaCore.Types.RightPosition && userPanelPosition===NowDock.Types.Center) when: (panel.position === PlasmaCore.Types.RightPosition && userPanelPosition===LatteDock.Types.Center)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1127,7 +1127,7 @@ Item {
}, },
State { State {
name: "rightTop" name: "rightTop"
when: (panel.position === PlasmaCore.Types.RightPosition && userPanelPosition===NowDock.Types.Top) when: (panel.position === PlasmaCore.Types.RightPosition && userPanelPosition===LatteDock.Types.Top)
AnchorChanges { AnchorChanges {
target: barLine target: barLine
@ -1140,7 +1140,7 @@ Item {
}, },
State { State {
name: "rightBottom" name: "rightBottom"
when: (panel.position === PlasmaCore.Types.RightPosition && userPanelPosition===NowDock.Types.Bottom) when: (panel.position === PlasmaCore.Types.RightPosition && userPanelPosition===LatteDock.Types.Bottom)
AnchorChanges { AnchorChanges {
target: barLine target: barLine

@ -8,7 +8,7 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.plasmoid 2.0
import org.kde.nowdock 0.1 as NowDock import org.kde.latte.dock 0.1 as LatteDock
PlasmaCore.FrameSvgItem { PlasmaCore.FrameSvgItem {
imagePath: "dialogs/background" imagePath: "dialogs/background"
@ -65,28 +65,28 @@ PlasmaCore.FrameSvgItem {
function updatePanelPositionVisual(){ function updatePanelPositionVisual(){
if((panelPosition == NowDock.Types.Left)||(panelPosition == NowDock.Types.Top)){ if((panelPosition == LatteDock.Types.Left)||(panelPosition == LatteDock.Types.Top)){
firstPosition.checked = true; firstPosition.checked = true;
centerPosition.checked = false; centerPosition.checked = false;
lastPosition.checked = false; lastPosition.checked = false;
splitTwoPosition.checked = false; splitTwoPosition.checked = false;
removeInternalViewSplitter(); removeInternalViewSplitter();
} }
else if(panelPosition == NowDock.Types.Center){ else if(panelPosition == LatteDock.Types.Center){
firstPosition.checked = false; firstPosition.checked = false;
centerPosition.checked = true; centerPosition.checked = true;
lastPosition.checked = false; lastPosition.checked = false;
splitTwoPosition.checked = false; splitTwoPosition.checked = false;
removeInternalViewSplitter(); removeInternalViewSplitter();
} }
else if((panelPosition == NowDock.Types.Right)||(panelPosition == NowDock.Types.Bottom)){ else if((panelPosition == LatteDock.Types.Right)||(panelPosition == LatteDock.Types.Bottom)){
firstPosition.checked = false; firstPosition.checked = false;
centerPosition.checked = false; centerPosition.checked = false;
lastPosition.checked = true; lastPosition.checked = true;
splitTwoPosition.checked = false; splitTwoPosition.checked = false;
removeInternalViewSplitter(); removeInternalViewSplitter();
} }
else if (panelPosition == NowDock.Types.Double){ else if (panelPosition == LatteDock.Types.Double){
firstPosition.checked = false; firstPosition.checked = false;
centerPosition.checked = false; centerPosition.checked = false;
lastPosition.checked = false; lastPosition.checked = false;
@ -112,9 +112,9 @@ PlasmaCore.FrameSvgItem {
onCheckedChanged: { onCheckedChanged: {
if(checked && !parent.inStartup){ if(checked && !parent.inStartup){
if(panelIsVertical) if(panelIsVertical)
plasmoid.configuration.panelPosition = NowDock.Types.Top plasmoid.configuration.panelPosition = LatteDock.Types.Top
else else
plasmoid.configuration.panelPosition = NowDock.Types.Left plasmoid.configuration.panelPosition = LatteDock.Types.Left
} }
} }
onClicked: checked=true; onClicked: checked=true;
@ -127,7 +127,7 @@ PlasmaCore.FrameSvgItem {
onCheckedChanged: { onCheckedChanged: {
if(checked && !parent.inStartup){ if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = NowDock.Types.Center plasmoid.configuration.panelPosition = LatteDock.Types.Center
} }
} }
onClicked: checked=true; onClicked: checked=true;
@ -141,9 +141,9 @@ PlasmaCore.FrameSvgItem {
onCheckedChanged: { onCheckedChanged: {
if(checked && !parent.inStartup){ if(checked && !parent.inStartup){
if(panelIsVertical) if(panelIsVertical)
plasmoid.configuration.panelPosition = NowDock.Types.Bottom plasmoid.configuration.panelPosition = LatteDock.Types.Bottom
else else
plasmoid.configuration.panelPosition = NowDock.Types.Right plasmoid.configuration.panelPosition = LatteDock.Types.Right
} }
} }
onClicked: checked=true; onClicked: checked=true;
@ -157,7 +157,7 @@ PlasmaCore.FrameSvgItem {
onCheckedChanged: { onCheckedChanged: {
if(checked && !parent.inStartup){ if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = NowDock.Types.Double; plasmoid.configuration.panelPosition = LatteDock.Types.Double;
} }
} }
onClicked: checked=true; onClicked: checked=true;

Loading…
Cancel
Save