diff --git a/containment/package/contents/config/main.xml b/containment/package/contents/config/main.xml
index eb6a1f6b..db3544cf 100644
--- a/containment/package/contents/config/main.xml
+++ b/containment/package/contents/config/main.xml
@@ -1,372 +1,376 @@
0
10
64
0.2
5
20
0
false
false
false
-1
-1
false
true
6
true
false
100
false
true
true
true
true
false
false
false
0
0
-1
-1
2
0
70
30
080808
false
100
0
false
+
+ false
+
+
0
6
2
0
0
0
1
0
false
true
2
true
true
true
true
true
0
false
false
true
false
false
true
true
true
true
true
true
false
true
false
true
1
true
diff --git a/containment/package/contents/ui/layouts/EnvironmentActions.qml b/containment/package/contents/ui/layouts/EnvironmentActions.qml
index e79933f0..560d2eb7 100644
--- a/containment/package/contents/ui/layouts/EnvironmentActions.qml
+++ b/containment/package/contents/ui/layouts/EnvironmentActions.qml
@@ -1,264 +1,272 @@
/*
* Copyright 2019 Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.7
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.2 as Latte
import "loaders" as Loaders
import "indicator" as Indicator
import "../applet/indicator" as AppletIndicator
Loader {
id: environmentLoader
sourceComponent: MouseArea{
id: mainArea
width: root.isHorizontal ? length : localThickness + root.localScreenEdgeMargin
height: root.isVertical ? length : localThickness + root.localScreenEdgeMargin
+ acceptedButtons: Qt.LeftButton | Qt.MidButton
+
readonly property int localThickness: (root.isHovered ? (root.iconSize + root.thickMargins)*root.zoomFactor : (root.iconSize + root.thickMargins))
readonly property int length: {
if (screenEdgeMarginEnabled && plasmoid.configuration.fittsLawIsRequested) {
return root.isHorizontal ? root.width : root.height;
}
return useAllLayouts ? root.maxLength : root.realPanelLength;
}
hoverEnabled: true
readonly property bool useAllLayouts: panelUserSetAlignment === Latte.Types.Justify && !root.inConfigureAppletsMode
property int lastPressX: -1
property int lastPressY: -1
onContainsMouseChanged: {
if (root.mouseInHoverableArea()) {
root.stopCheckRestoreZoomTimer();
} else {
root.initializeHoveredIndexes();
root.startCheckRestoreZoomTimer()
}
}
+ onClicked: {
+ if (root.closeActiveWindowEnabled && mouse.button === Qt.MidButton) {
+ selectedWindowsTracker.lastActiveWindow.requestClose();
+ }
+ }
+
onPressed: {
if (!root.dragActiveWindowEnabled) {
return;
}
- if (selectedWindowsTracker.lastActiveWindow.canBeDragged()) {
+ if (mouse.button == Qt.LeftButton && selectedWindowsTracker.lastActiveWindow.canBeDragged()) {
lastPressX = mouse.x;
lastPressY = mouse.y;
dragWindowTimer.start();
}
}
onReleased: {
lastPressX = -1;
lastPressY = -1;
}
onPositionChanged: {
if (!root.dragActiveWindowEnabled) {
return;
}
var stepX = Math.abs(lastPressX-mouse.x);
var stepY = Math.abs(lastPressY-mouse.y);
var threshold = 5;
var tryDrag = mainArea.pressed && (stepX>threshold || stepY>threshold);
if ( tryDrag && selectedWindowsTracker.lastActiveWindow.canBeDragged()) {
dragWindowTimer.stop();
activateDragging();
}
}
onDoubleClicked: {
if (!root.dragActiveWindowEnabled) {
return;
}
dragWindowTimer.stop();
selectedWindowsTracker.lastActiveWindow.requestToggleMaximized();
}
onWheel: {
if (root.scrollAction === Latte.Types.ScrollNone) {
root.emptyAreasWheel(wheel);
return;
}
var delta = 0;
if (wheel.angleDelta.y>=0 && wheel.angleDelta.x>=0) {
delta = Math.max(wheel.angleDelta.y, wheel.angleDelta.x);
} else {
delta = Math.min(wheel.angleDelta.y, wheel.angleDelta.x);
}
var angle = delta / 8;
if (angle>10) {
if (root.scrollAction === Latte.Types.ScrollDesktops) {
latteView.windowsTracker.switchToPreviousVirtualDesktop();
} else if (root.scrollAction === Latte.Types.ScrollActivities) {
latteView.windowsTracker.switchToPreviousActivity();
} else if (tasksLoader.active) {
tasksLoader.item.activateNextPrevTask(true);
}
} else if (angle<-10) {
if (root.scrollAction === Latte.Types.ScrollDesktops) {
latteView.windowsTracker.switchToNextVirtualDesktop();
} else if (root.scrollAction === Latte.Types.ScrollActivities) {
latteView.windowsTracker.switchToNextActivity();
} else if (tasksLoader.active) {
tasksLoader.item.activateNextPrevTask(false);
}
}
}
Loaders.Tasks{
id: tasksLoader
}
function activateDragging(){
selectedWindowsTracker.requestMoveLastWindow(mainArea.mouseX, mainArea.mouseY);
mainArea.lastPressX = -1;
mainArea.lastPressY = -1;
}
//! Timers
Timer {
id: dragWindowTimer
interval: 500
onTriggered: {
if (mainArea.pressed && selectedWindowsTracker.lastActiveWindow.canBeDragged()) {
mainArea.activateDragging();
}
}
}
//! Background Indicator
Indicator.Bridge{
id: indicatorBridge
}
//! Indicator Back Layer
Indicator.Loader{
id: indicatorBackLayer
level: AppletIndicator.LevelOptions {
id: backLevelOptions
isBackground: true
bridge: indicatorBridge
}
}
states:[
State {
name: "bottom"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)
AnchorChanges {
target: mainArea
anchors{ top:undefined; bottom:parent.bottom; left:undefined; right:undefined;
horizontalCenter:parent.horizontalCenter; verticalCenter:undefined}
}
},
State {
name: "top"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
AnchorChanges {
target: mainArea
anchors{ top:parent.top; bottom:undefined; left:undefined; right:undefined;
horizontalCenter:parent.horizontalCenter; verticalCenter:undefined}
}
},
State {
name: "left"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)
AnchorChanges {
target: mainArea
anchors{ top:undefined; bottom:undefined; left:parent.left; right:undefined;
horizontalCenter:undefined; verticalCenter:parent.verticalCenter}
}
},
State {
name: "right"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)
AnchorChanges {
target: mainArea
anchors{ top:undefined; bottom:undefined; left:undefined; right:parent.right;
horizontalCenter:undefined; verticalCenter:parent.verticalCenter}
}
}
]
}
states:[
State {
name: "bottom"
when: (plasmoid.location === PlasmaCore.Types.BottomEdge)
AnchorChanges {
target: environmentLoader
anchors{ top:undefined; bottom: _mainLayout.bottom; left:undefined; right:undefined;
horizontalCenter: _mainLayout.horizontalCenter; verticalCenter:undefined}
}
},
State {
name: "top"
when: (plasmoid.location === PlasmaCore.Types.TopEdge)
AnchorChanges {
target: environmentLoader
anchors{ top: _mainLayout.top; bottom:undefined; left:undefined; right:undefined;
horizontalCenter: _mainLayout.horizontalCenter; verticalCenter:undefined}
}
},
State {
name: "left"
when: (plasmoid.location === PlasmaCore.Types.LeftEdge)
AnchorChanges {
target: environmentLoader
anchors{ top:undefined; bottom:undefined; left: _mainLayout.left; right:undefined;
horizontalCenter:undefined; verticalCenter: _mainLayout.verticalCenter}
}
},
State {
name: "right"
when: (plasmoid.location === PlasmaCore.Types.RightEdge)
AnchorChanges {
target: environmentLoader
anchors{ top:undefined; bottom:undefined; left:undefined; right: _mainLayout.right;
horizontalCenter:undefined; verticalCenter: _mainLayout.verticalCenter}
}
}
]
}
diff --git a/containment/package/contents/ui/layouts/LayoutsContainer.qml b/containment/package/contents/ui/layouts/LayoutsContainer.qml
index 4fce3391..76ea8939 100644
--- a/containment/package/contents/ui/layouts/LayoutsContainer.qml
+++ b/containment/package/contents/ui/layouts/LayoutsContainer.qml
@@ -1,295 +1,295 @@
/*
* Copyright 2016 Smith AR
* Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.1
import QtQuick.Layouts 1.1
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.latte 0.2 as Latte
import "../../code/HeuristicTools.js" as HeuristicTools
Item{
id: layoutsContainer
readonly property bool isHidden: root.inStartup || (latteView && latteView.visibility && latteView.visibility.isHidden)
readonly property bool useMaxLength: (plasmoid.configuration.panelPosition === Latte.Types.Justify && !root.inConfigureAppletsMode)
/* && ((!root.inConfigureAppletsMode && !root.behaveAsPlasmaPanel )
|| (behaveAsPlasmaPanel && root.inConfigureAppletsMode))*/
property int allCount: root.latteApplet ? _mainLayout.count-1+latteApplet.tasksCount : _mainLayout.count
property int currentSpot: -1000
property int hoveredIndex: -1
readonly property int fillApplets: _startLayout.fillApplets + _mainLayout.fillApplets + _endLayout.fillApplets
property Item startLayout : _startLayout
property Item mainLayout: _mainLayout
property Item endLayout: _endLayout
Binding {
target: layoutsContainer
property: "x"
value: {
if (visibilityManager.inLocationAnimation) {
return;
}
if (root.behaveAsPlasmaPanel) {
return 0;
}
if ( latteView && root.isHorizontal && useMaxLength ){
return ((latteView.width/2) - (root.maxLength/2) + root.offset);
} else {
if ((visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) && root.isVertical){
return;
}
if (layoutsContainer.isHidden && root.isVertical) {
if (Latte.WindowSystem.compositingActive) {
return visibilityManager.slidingOutToPos;
} else {
if ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) {
return visibilityManager.slidingOutToPos + 1;
} else {
return visibilityManager.slidingOutToPos - 1;
}
}
} else {
return 0;
}
}
}
}
Binding{
target: layoutsContainer
property: "y"
value: {
if (visibilityManager.inLocationAnimation) {
return;
}
if (root.behaveAsPlasmaPanel) {
return 0;
}
if ( latteView && root.isVertical && useMaxLength ) {
return ((latteView.height/2) - (root.maxLength/2) + root.offset);
} else {
if ((visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) && root.isHorizontal){
return;
}
if (layoutsContainer.isHidden && root.isHorizontal) {
if (Latte.WindowSystem.compositingActive) {
return visibilityManager.slidingOutToPos;
} else {
if ((plasmoid.location===PlasmaCore.Types.LeftEdge)||(plasmoid.location===PlasmaCore.Types.TopEdge)) {
return visibilityManager.slidingOutToPos + 1;
} else {
return visibilityManager.slidingOutToPos - 1;
}
}
} else {
return 0;
}
}
}
}
width: root.isHorizontal && useMaxLength ? root.maxLength : parent.width
height: root.isVertical && useMaxLength ? root.maxLength : parent.height
z:10
property bool animationSent: false
property bool shouldCheckHalfs: (plasmoid.configuration.panelPosition === Latte.Types.Justify) && (_mainLayout.children>1)
property int contentsWidth: _startLayout.width + _mainLayout.width + _endLayout.width
property int contentsHeight: _startLayout.height + _mainLayout.height + _endLayout.height
onContentsWidthChanged: {
if (root.isHorizontal){
var firstHalfExited = false;
var secondHalfExited = false;
if (shouldCheckHalfs){
firstHalfExited = ( (_startLayout.width + _mainLayout.width/2) >= root.maxLength/2 );
secondHalfExited = ( (_endLayout.width + _mainLayout.width/2) >= root.maxLength/2 );
}
if (latteView && ((contentsWidth >= root.maxLength) || firstHalfExited || secondHalfExited)) {
automaticItemSizer.updateAutomaticIconSize();
}
if (!animationSent) {
animationSent = true;
slotAnimationsNeedLength(1);
}
layoutsContainer.updateSizeForAppletsInFill();
delayUpdateMaskArea.start();
}
}
onContentsHeightChanged: {
if (root.isVertical){
var firstHalfExited = false;
var secondHalfExited = false;
if (shouldCheckHalfs){
firstHalfExited = ( (_startLayout.height + _mainLayout.height/2) >= root.maxLength/2 );
secondHalfExited = ( (_endLayout.height + _mainLayout.height/2) >= root.maxLength/2 );
}
if (latteView && ((contentsHeight >= root.maxLength) || firstHalfExited || secondHalfExited)) {
automaticItemSizer.updateAutomaticIconSize();
}
if (!animationSent) {
animationSent = true;
slotAnimationsNeedLength(1);
}
layoutsContainer.updateSizeForAppletsInFill();
delayUpdateMaskArea.start();
}
}
onXChanged: root.updateEffectsArea();
onYChanged: root.updateEffectsArea();
EnvironmentActions {
- active: root.scrollAction !== Latte.Types.ScrollNone || root.dragActiveWindowEnabled
+ active: root.scrollAction !== Latte.Types.ScrollNone || root.dragActiveWindowEnabled || root.closeActiveWindowEnabled
}
AppletsContainer {
id: _startLayout
beginIndex: 0
offset: root.totalPanelEdgeSpacing/2
alignment: {
switch(plasmoid.location) {
case PlasmaCore.Types.BottomEdge: return Latte.Types.BottomEdgeLeftAlign;
case PlasmaCore.Types.TopEdge: return Latte.Types.TopEdgeLeftAlign;
case PlasmaCore.Types.LeftEdge: return Latte.Types.LeftEdgeTopAlign;
case PlasmaCore.Types.RightEdge: return Latte.Types.RightEdgeTopAlign;
}
return Latte.Types.BottomEdgeLeftAlign;
}
}
AppletsContainer {
id: _mainLayout
beginIndex: 100
offset: centered ? appliedOffset : root.offsetFixed
readonly property bool centered: (root.panelAlignment === Latte.Types.Center) || (root.panelAlignment === Latte.Types.Justify)
readonly property bool reversed: Qt.application.layoutDirection === Qt.RightToLeft
readonly property int appliedOffset: root.panelAlignment === Latte.Types.Justify ? 0 : root.offset
alignment: {
if (plasmoid.location === PlasmaCore.Types.LeftEdge) {
if (centered) return Latte.Types.LeftEdgeCenterAlign;
if (root.panelAlignment === Latte.Types.Top) return Latte.Types.LeftEdgeTopAlign;
if (root.panelAlignment === Latte.Types.Bottom) return Latte.Types.LeftEdgeBottomAlign;
}
if (plasmoid.location === PlasmaCore.Types.RightEdge) {
if (centered) return Latte.Types.RightEdgeCenterAlign;
if (root.panelAlignment === Latte.Types.Top) return Latte.Types.RightEdgeTopAlign;
if (root.panelAlignment === Latte.Types.Bottom) return Latte.Types.RightEdgeBottomAlign;
}
if (plasmoid.location === PlasmaCore.Types.BottomEdge) {
if (centered) return Latte.Types.BottomEdgeCenterAlign;
if ((root.panelAlignment === Latte.Types.Left && !reversed)
|| (root.panelAlignment === Latte.Types.Right && reversed)) {
return Latte.Types.BottomEdgeLeftAlign;
}
if ((root.panelAlignment === Latte.Types.Right && !reversed)
|| (root.panelAlignment === Latte.Types.Left && reversed)) {
return Latte.Types.BottomEdgeRightAlign;
}
}
if (plasmoid.location === PlasmaCore.Types.TopEdge) {
if (centered) return Latte.Types.TopEdgeCenterAlign;
if ((root.panelAlignment === Latte.Types.Left && !reversed)
|| (root.panelAlignment === Latte.Types.Right && reversed)) {
return Latte.Types.TopEdgeLeftAlign;
}
if ((root.panelAlignment === Latte.Types.Right && !reversed)
|| (root.panelAlignment === Latte.Types.Left && reversed)) {
return Latte.Types.TopEdgeRightAlign;
}
}
return Latte.Types.BottomEdgeCenterAlign;
}
transitions: Transition {
enabled: editModeVisual.plasmaEditMode
AnchorAnimation {
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
}
AppletsContainer {
id: _endLayout
beginIndex: 200
offset: root.totalPanelEdgeSpacing/2
alignment: {
switch(plasmoid.location) {
case PlasmaCore.Types.BottomEdge: return Latte.Types.BottomEdgeRightAlign;
case PlasmaCore.Types.TopEdge: return Latte.Types.TopEdgeRightAlign;
case PlasmaCore.Types.LeftEdge: return Latte.Types.LeftEdgeBottomAlign;
case PlasmaCore.Types.RightEdge: return Latte.Types.RightEdgeBottomAlign;
}
return Latte.Types.BottomEdgeLeftAlign;
}
}
function updateSizeForAppletsInFill() {
if (!updateSizeForAppletsInFillTimer.running) {
updateSizeForAppletsInFillTimer.start();
}
}
//! This timer is needed in order to reduce the calls to heavy cpu function
//! HeuristicTools.updateSizeForAppletsInFill()
Timer{
id: updateSizeForAppletsInFillTimer
interval: 10
onTriggered: HeuristicTools.updateSizeForAppletsInFill();
}
}
diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml
index 4a8c43b6..dde087c4 100644
--- a/containment/package/contents/ui/main.qml
+++ b/containment/package/contents/ui/main.qml
@@ -1,1948 +1,1949 @@
/*
* Copyright 2016 Smith AR
* Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.8
import QtQuick.Layouts 1.1
import QtQuick.Window 2.2
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kquickcontrolsaddons 2.0
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.2 as Latte
import org.kde.latte.components 1.0 as LatteComponents
import "applet" as Applet
import "colorizer" as Colorizer
import "editmode" as EditMode
import "indicators" as Indicators
import "layouts" as Layouts
import "../code/LayoutManager.js" as LayoutManager
Item {
id: root
objectName: "containmentViewLayout"
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft && !root.isVertical
LayoutMirroring.childrenInherit: true
//// BEGIN SIGNALS
signal clearZoomSignal();
signal destroyInternalViewSplitters();
signal emptyAreasWheel(QtObject wheel);
signal separatorsUpdated();
signal signalActivateEntryAtIndex(int entryIndex);
signal signalNewInstanceForEntryAtIndex(int entryIndex);
signal updateEffectsArea();
signal updateIndexes();
signal updateScale(int delegateIndex, real newScale, real step);
signal broadcastedToApplet(string pluginName, string action, variant value);
//// END SIGNALS
////BEGIN properties
property bool debugMode: Qt.application.arguments.indexOf("--graphics")>=0
property bool debugModeSpacers: Qt.application.arguments.indexOf("--spacers")>=0
property bool debugModeTimers: Qt.application.arguments.indexOf("--timers")>=0
property bool debugModeWindow: Qt.application.arguments.indexOf("--with-window")>=0
property bool debugModeOverloadedIcons: Qt.application.arguments.indexOf("--overloaded-icons")>=0
readonly property int version: Latte.WindowSystem.makeVersion(0,9,4)
property bool globalDirectRender: false //it is used as a globalDirectRender for all elements in the dock
property int directRenderAnimationTime: 0
property bool addLaunchersMessage: false
property bool addLaunchersInTaskManager: plasmoid.configuration.addLaunchersInTaskManager
property bool backgroundOnlyOnMaximized: plasmoid.configuration.backgroundOnlyOnMaximized
property bool behaveAsPlasmaPanel: {
if (!latteView || !latteView.visibility) {
return false;
}
if (screenEdgeMarginEnabled && plasmoid.configuration.fittsLawIsRequested) {
//! dont use when floating views are requesting Fitt's Law
return false;
}
return (visibilityManager.panelIsBiggerFromIconSize
&& (maxZoomFactor === 1.0)
&& (plasmoid.configuration.panelPosition === Latte.Types.Justify)
&& !root.editMode
&& !visibilityManager.inLocationAnimation);
}
property int viewType: {
if ((plasmoid.configuration.panelPosition === Latte.Types.Justify)
&& (plasmoid.configuration.useThemePanel)
&& (plasmoid.configuration.panelSize === 100)
&& (maxZoomFactor === 1.0)) {
return Latte.Types.PanelView;
}
return Latte.Types.DockView;
}
property bool blurEnabled: plasmoid.configuration.blurEnabled && (!forceTransparentPanel || forcePanelForBusyBackground)
readonly property bool ignoreRegularFilesDragging: !root.editMode
&& (dragInfo.computationsAreValid || foreDropArea.dragInfo.computationsAreValid)
&& !root.dragInfo.isPlasmoid
&& !root.dragInfo.onlyLaunchers
readonly property Item dragInfo: Item {
property bool entered: backDropArea.dragInfo.entered || foreDropArea.dragInfo.entered
property bool isTask: backDropArea.dragInfo.isTask || foreDropArea.dragInfo.isTask
property bool isPlasmoid: backDropArea.dragInfo.isPlasmoid || foreDropArea.dragInfo.isPlasmoid
property bool isSeparator: backDropArea.dragInfo.isSeparator || foreDropArea.dragInfo.isSeparator
property bool isLatteTasks: backDropArea.dragInfo.isLatteTasks || foreDropArea.dragInfo.isLatteTasks
property bool onlyLaunchers: backDropArea.dragInfo.onlyLaunchers || foreDropArea.dragInfo.onlyLaunchers
// onIsPlasmoidChanged: console.log("isPlasmoid :: " + backDropArea.dragInfo.isPlasmoid + " _ " + foreDropArea.dragInfo.isPlasmoid );
// onEnteredChanged: console.log("entered :: " + backDropArea.dragInfo.entered + " _ " + foreDropArea.dragInfo.entered );
}
property bool containsOnlyPlasmaTasks: false //this is flag to indicate when from tasks only a plasma based one is found
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: latteView && latteView.windowsTracker
&& (latteView.windowsTracker.currentScreen.activeWindowTouching || hasExpandedApplet)
property bool forceSolidPanel: (latteView && latteView.visibility
&& Latte.WindowSystem.compositingActive
&& !inConfigureAppletsMode
&& userShowPanelBackground
&& ( (plasmoid.configuration.solidBackgroundForMaximized
&& !(hasExpandedApplet && !plasmaBackgroundForPopups)
&& latteView.windowsTracker.currentScreen.existsWindowTouching)
|| (hasExpandedApplet && plasmaBackgroundForPopups) ))
|| solidBusyForTouchingBusyVerticalView
|| plasmaStyleBusyForTouchingBusyVerticalView
|| !Latte.WindowSystem.compositingActive
property bool forceTransparentPanel: root.backgroundOnlyOnMaximized
&& latteView && latteView.visibility
&& Latte.WindowSystem.compositingActive
&& !inConfigureAppletsMode
&& !forceSolidPanel
&& !latteView.windowsTracker.currentScreen.existsWindowTouching
&& !(windowColors === Latte.Types.ActiveWindowColors && selectedWindowsTracker.existsWindowActive)
property bool forcePanelForBusyBackground: userShowPanelBackground && (root.themeColors === Latte.Types.SmartThemeColors)
&& ( (root.forceTransparentPanel && colorizerManager.backgroundIsBusy)
|| normalBusyForTouchingBusyVerticalView )
property bool normalBusyForTouchingBusyVerticalView: (latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers isBusy transparency*/
&& latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView
&& root.themeColors === Latte.Types.SmartThemeColors
&& plasmoid.configuration.backgroundOnlyOnMaximized
/*&& !plasmoid.configuration.solidBackgroundForMaximized
&& !plasmaBackgroundForPopups*/)
property bool solidBusyForTouchingBusyVerticalView: false //DISABLED, until to check if the normalBusyForTouchingBusyVerticalView is enough to catch and handle the case
/*(latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers solidness*/
/* && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView
&& root.themeColors === Latte.Types.SmartThemeColors
&& plasmoid.configuration.backgroundOnlyOnMaximized
&& plasmoid.configuration.solidBackgroundForMaximized
&& !plasmaBackgroundForPopups)*/
property bool plasmaStyleBusyForTouchingBusyVerticalView: false //DISABLED, until to check if the normalBusyForTouchingBusyVerticalView is enough to catch and handle the case
//(latteView && latteView.windowsTracker /*is touching a vertical view that is in busy state and the user prefers solidness*/
/* && latteView.windowsTracker.currentScreen.isTouchingBusyVerticalView
&& root.themeColors === Latte.Types.SmartThemeColors
&& plasmoid.configuration.backgroundOnlyOnMaximized
&& plasmaBackgroundForPopups)*/
property bool hideThickScreenGap: screenEdgeMarginEnabled
&& plasmoid.configuration.hideScreenGapForMaximized
&& latteView && latteView.windowsTracker
&& latteView.windowsTracker.currentScreen.existsWindowMaximized
property bool hideLengthScreenGaps: hideThickScreenGap
&& (latteView.visibility.mode === Latte.Types.AlwaysVisible
|| latteView.visibility.mode === Latte.Types.WindowsGoBelow)
&& (plasmoid.configuration.panelPosition === Latte.Types.Justify)
&& plasmoid.configuration.maxLength>85
&& !root.editMode
property int themeColors: plasmoid.configuration.themeColors
property int windowColors: plasmoid.configuration.windowColors
property bool colorizerEnabled: themeColors !== Latte.Types.PlasmaThemeColors || windowColors !== Latte.Types.NoneWindowColors
property bool plasmaBackgroundForPopups: plasmoid.configuration.plasmaBackgroundForPopups
readonly property bool hasExpandedApplet: plasmoid.applets.some(function (item) {
return (item.status >= PlasmaCore.Types.NeedsAttentionStatus && item.status !== PlasmaCore.Types.HiddenStatus
&& item.pluginName !== root.plasmoidName
&& item.pluginName !== "org.kde.plasma.appmenu"
&& item.pluginName !== "org.kde.windowappmenu"
&& item.pluginName !== "org.kde.activeWindowControl");
})
readonly property bool hasUserSpecifiedBackground: (latteView && latteView.layout && latteView.layout.background.startsWith("/")) ?
true : false
readonly property bool inConfigureAppletsMode: root.editMode && (plasmoid.configuration.inConfigureAppletsMode || !Latte.WindowSystem.compositingActive)
readonly property bool parabolicEffectEnabled: zoomFactor>1 && !inConfigureAppletsMode
property bool dockIsShownCompletely: !(dockIsHidden || inSlidingIn || inSlidingOut) && !root.editMode
+ property bool closeActiveWindowEnabled: plasmoid.configuration.closeActiveWindowEnabled
property bool dragActiveWindowEnabled: plasmoid.configuration.dragActiveWindowEnabled
property bool immutable: plasmoid.immutable
property bool inFullJustify: (plasmoid.configuration.panelPosition === Latte.Types.Justify) && (maxLengthPerCentage===100)
property bool inSlidingIn: visibilityManager ? visibilityManager.inSlidingIn : false
property bool inSlidingOut: visibilityManager ? visibilityManager.inSlidingOut : false
property bool inStartup: true
property bool isHalfShown: false //is used to disable the zoom hovering effect at sliding in-out the dock
property bool isHorizontal: plasmoid.formFactor === PlasmaCore.Types.Horizontal
property bool isReady: !(dockIsHidden || inSlidingIn || inSlidingOut)
property bool isVertical: !isHorizontal
property bool isHovered: latteApplet ? ((latteAppletHoveredIndex !== -1) || (layoutsContainer.hoveredIndex !== -1)) //|| wholeArea.containsMouse
: (layoutsContainer.hoveredIndex !== -1) //|| wholeArea.containsMouse
property bool mouseWheelActions: plasmoid.configuration.mouseWheelActions
property bool onlyAddingStarup: true //is used for the initialization phase in startup where there aren't removals, this variable provides a way to grow icon size
property bool shrinkThickMargins: plasmoid.configuration.shrinkThickMargins
property bool showLatteShortcutBadges: false
property bool showAppletShortcutBadges: false
property bool showMetaBadge: false
property int applicationLauncherId: -1
//FIXME: possibly this is going to be the default behavior, this user choice
//has been dropped from the Dock Configuration Window
//property bool smallAutomaticIconJumps: plasmoid.configuration.smallAutomaticIconJumps
property bool smallAutomaticIconJumps: true
property bool userShowPanelBackground: Latte.WindowSystem.compositingActive ? plasmoid.configuration.useThemePanel : true
property bool useThemePanel: noApplets === 0 || !Latte.WindowSystem.compositingActive ?
true : (plasmoid.configuration.useThemePanel || plasmoid.configuration.solidBackgroundForMaximized)
property alias hoveredIndex: layoutsContainer.hoveredIndex
property alias directRenderDelayerIsRunning: directRenderDelayerForEnteringTimer.running
property int actionsBlockHiding: 0 //actions that block hiding
property int animationsNeedBothAxis:0 //animations need space in both axes, e.g zooming a task
property int animationsNeedLength: 0 // animations need length, e.g. adding a task
property int animationsNeedThickness: 0 // animations need thickness, e.g. bouncing animation
readonly property bool thickAnimated: animationsNeedBothAxis>0 || animationsNeedThickness>0
property int animationTime: durationTime*2.8*units.longDuration
property int appletsNeedWindowsTracking: 0
//what is the highest icon size based on what icon size is used, screen calculated or user specified
property int maxIconSize: proportionIconSize!==-1 ? proportionIconSize : plasmoid.configuration.iconSize
property int iconSize: automaticItemSizer.automaticIconSizeBasedSize > 0 && automaticItemSizer.isActive ?
Math.min(automaticItemSizer.automaticIconSizeBasedSize, root.maxIconSize) :
root.maxIconSize
property int proportionIconSize: { //icon size based on screen height
if ((plasmoid.configuration.proportionIconSize===-1) || !latteView)
return -1;
return Math.max(16,Math.round(latteView.screenGeometry.height * plasmoid.configuration.proportionIconSize/100/8)*8);
}
property int latteAppletPos: -1
property int maxLengthPerCentage: hideLengthScreenGaps ? 100 : plasmoid.configuration.maxLength
property int maxLength: {
if (root.isHorizontal) {
return behaveAsPlasmaPanel ? width : width * (maxLengthPerCentage/100)
} else {
return behaveAsPlasmaPanel ? height : height * (maxLengthPerCentage/100)
}
}
property int leftClickAction: plasmoid.configuration.leftClickAction
property int middleClickAction: plasmoid.configuration.middleClickAction
property int hoverAction: plasmoid.configuration.hoverAction
property int modifier: plasmoid.configuration.modifier
property int modifierClickAction: plasmoid.configuration.modifierClickAction
property int modifierClick: plasmoid.configuration.modifierClick
property int scrollAction: plasmoid.configuration.scrollAction
property bool panelOutline: plasmoid.configuration.panelOutline
property int panelEdgeSpacing: Math.max(panelBoxBackground.lengthMargins, 1.5*appShadowSize)
property int panelTransparency: plasmoid.configuration.panelTransparency //user set
property int currentPanelTransparency: 0 //application override
readonly property real currentPanelOpacity: currentPanelTransparency/100
property bool panelShadowsActive: {
if (!userShowPanelBackground) {
return false;
}
if (inConfigureAppletsMode) {
return plasmoid.configuration.panelShadows;
}
var forcedNoShadows = (plasmoid.configuration.panelShadows && disablePanelShadowMaximized
&& latteView && latteView.windowsTracker && latteView.windowsTracker.currentScreen.activeWindowMaximized);
if (forcedNoShadows) {
return false;
}
var transparencyCheck = (blurEnabled || (!blurEnabled && currentPanelTransparency>20));
//! Draw shadows for isBusy state only when current panelTransparency is greater than 10%
if (plasmoid.configuration.panelShadows && root.forcePanelForBusyBackground && transparencyCheck) {
return true;
}
if (( (plasmoid.configuration.panelShadows && !root.backgroundOnlyOnMaximized)
|| (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && !root.forceTransparentPanel))
&& !forcedNoShadows) {
return true;
}
if (hasExpandedApplet && plasmaBackgroundForPopups) {
return true;
}
return false;
}
property int appShadowOpacity: (plasmoid.configuration.shadowOpacity/100) * 255
property int appShadowSize: enableShadows ? (0.5*root.iconSize) * (plasmoid.configuration.shadowSize/100) : 0
property int appShadowSizeOriginal: enableShadows ? (0.5*maxIconSize) * (plasmoid.configuration.shadowSize/100) : 0
property string appChosenShadowColor: {
if (plasmoid.configuration.shadowColorType === Latte.Types.ThemeColorShadow) {
var strC = String(theme.textColor);
return strC.indexOf("#") === 0 ? strC.substr(1) : strC;
} else if (plasmoid.configuration.shadowColorType === Latte.Types.UserColorShadow) {
return plasmoid.configuration.shadowColor;
}
// default shadow color
return "080808";
}
property string appShadowColor: "#" + decimalToHex(appShadowOpacity) + appChosenShadowColor
property string appShadowColorSolid: "#" + appChosenShadowColor
property int totalPanelEdgeSpacing: 0 //this is set by PanelBox
property int offset: {
if (behaveAsPlasmaPanel) {
return 0;
}
if (root.isHorizontal) {
return width * (plasmoid.configuration.offset/100);
} else {
height * (plasmoid.configuration.offset/100)
}
}
//center the layout correctly when the user uses an offset
property int offsetFixed: (offset===0 || panelAlignment === Latte.Types.Center || plasmoid.configuration.panelPosition === Latte.Types.Justify)?
offset : offset+panelMarginLength/2+totalPanelEdgeSpacing/2
property int realPanelSize: 0
property int realPanelLength: 0
property int realPanelThickness: 0
//this is set by the PanelBox
property int panelThickMarginBase: 0
property int panelThickMarginHigh: 0
property int panelMarginLength: 0
property int panelShadow: 0 //shadowsSize
property int editShadow: {
if (!Latte.WindowSystem.compositingActive) {
return 0;
} else if (latteView && latteView.screenGeometry) {
return latteView.screenGeometry.height/90;
} else {
return 7;
}
}
property int themePanelThickness: {
var panelBase = root.panelThickMarginHigh + root.panelThickMarginBase;
var margin = shrinkThickMargins ? 0 : thickMargins + localScreenEdgeMargin;
var maxPanelSize = (iconSize + margin) - panelBase;
var percentage = Latte.WindowSystem.compositingActive ? plasmoid.configuration.panelSize/100 : 1;
return Math.max(panelBase, panelBase + percentage*maxPanelSize);
}
property int lengthIntMargin: lengthIntMarginFactor * root.iconSize
property int lengthExtMargin: lengthExtMarginFactor * root.iconSize
property real lengthIntMarginFactor: indicators.isEnabled ? indicators.padding : 0
property real lengthExtMarginFactor: plasmoid.configuration.lengthExtMargin / 100
property real lengthAppletIntMarginFactor: indicators.infoLoaded ? indicators.info.appletLengthPadding : -1
property real thickMarginFactor: {
if (shrinkThickMargins) {
return indicators.info.minThicknessPadding;
}
//0.075 old statesLineSize and 0.06 old default thickMargin
return Math.max(indicators.info.minThicknessPadding, plasmoid.configuration.thickMargin / 100)
}
property int thickMargin: thickMarginFactor * root.iconSize
property bool screenEdgeMarginEnabled: plasmoid.configuration.screenEdgeMargin >= 0 && !plasmoid.configuration.shrinkThickMargins
property int screenEdgeMargin: {
//! is used for window geometry calculations
if (!screenEdgeMarginEnabled
|| (hideThickScreenGap && localScreenEdgeMargin === 0)) {
/*window geometry is updated after the local screen margin animation was zeroed*/
return 0;
}
return plasmoid.configuration.screenEdgeMargin;
}
property int localScreenEdgeMargin: (screenEdgeMarginEnabled && behaveAsPlasmaPanel)
|| !screenEdgeMarginEnabled
|| hideThickScreenGap ? 0 : plasmoid.configuration.screenEdgeMargin
//! thickness margins are always two and equal in order for items
//! to be always correctly centered
property int thickMargins: 2 * thickMargin
//it is used in order to not break the calculations for the thickness placement
//especially in automatic icon sizes calculations
property int maxThickMargin: thickMarginFactor * maxIconSize
property int lengthMargin: lengthIntMargin + lengthExtMargin
property int lengthMargins: 2 * lengthMargin
property int widthMargins: root.isVertical ? thickMargins : lengthMargins
property int heightMargins: root.isHorizontal ? thickMargins : lengthMargins
///FIXME: 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 layoutsContainer.mainLayoutPosition: !plasmoid.immutable ? Latte.Types.Center : (root.isVertical ? Latte.Types.Top : Latte.Types.Left)
//property int panelAlignment: plasmoid.configuration.panelPosition !== Latte.Types.Justify ? plasmoid.configuration.panelPosition : layoutsContainer.mainLayoutPosition
property int panelAlignment: !root.inConfigureAppletsMode ? plasmoid.configuration.panelPosition :
( plasmoid.configuration.panelPosition === Latte.Types.Justify ?
Latte.Types.Center : plasmoid.configuration.panelPosition )
property int panelUserSetAlignment: plasmoid.configuration.panelPosition
property real zoomFactor: Latte.WindowSystem.compositingActive && root.animationsEnabled ? ( 1 + (plasmoid.configuration.zoomLevel / 20) ) : 1
readonly property string plasmoidName: "org.kde.latte.plasmoid"
property var badgesForActivate: {
if (!shortcutsEngine) {
return ['1','2','3','4','5','6','7','8','9','0', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.'];
}
return shortcutsEngine.badgesForActivate;
}
property var iconsArray: [16, 22, 32, 48, 64, 96, 128, 256]
property Item dragOverlay
property Item toolBox
property Item latteAppletContainer
property Item latteApplet
readonly property Item indicatorsManager: indicators
readonly property Item parabolicManager: _parabolicManager
readonly property Item maskManager: visibilityManager
readonly property Item layoutsContainerItem: layoutsContainer
property QtObject latteView: null
property QtObject shortcutsEngine: null
property QtObject themeExtended: null
property QtObject universalSettings: null
property QtObject layoutsManager: null
property QtObject viewLayout: latteView && latteView.layout ? latteView.layout : null
property QtObject selectedWindowsTracker: {
if (latteView && latteView.windowsTracker) {
switch(plasmoid.configuration.activeWindowFilter) {
case Latte.Types.ActiveInCurrentScreen:
return latteView.windowsTracker.currentScreen;
case Latte.Types.ActiveFromAllScreens:
return latteView.windowsTracker.allScreens;
}
}
return 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 badges3DStyle: universalSettings ? universalSettings.badges3DStyle : true
property bool enableShadows: plasmoid.configuration.shadows || (root.forceTransparentPanel && plasmoid.configuration.shadows>0)
property bool dockIsHidden: latteView ? latteView.visibility.isHidden : true
property bool groupTasksByDefault: plasmoid.configuration.groupTasksByDefault
property bool showInfoBadge: plasmoid.configuration.showInfoBadge
property bool showProgressBadge: plasmoid.configuration.showProgressBadge
property bool showAudioBadge: plasmoid.configuration.showAudioBadge
property bool audioBadgeActionsEnabled: plasmoid.configuration.audioBadgeActionsEnabled
property bool infoBadgeProminentColorEnabled: plasmoid.configuration.infoBadgeProminentColorEnabled
property bool scrollTasksEnabled: plasmoid.configuration.scrollTasksEnabled
property bool autoScrollTasksEnabled: plasmoid.configuration.autoScrollTasksEnabled
property int manualScrollTasksType: plasmoid.configuration.manualScrollTasksType
property bool showWindowActions: plasmoid.configuration.showWindowActions
property bool showWindowsOnlyFromLaunchers: plasmoid.configuration.showWindowsOnlyFromLaunchers
property bool showOnlyCurrentScreen: plasmoid.configuration.showOnlyCurrentScreen
property bool showOnlyCurrentDesktop: plasmoid.configuration.showOnlyCurrentDesktop
property bool showOnlyCurrentActivity: plasmoid.configuration.showOnlyCurrentActivity
property bool titleTooltips: plasmoid.configuration.titleTooltips
property bool unifiedGlobalShortcuts: plasmoid.configuration.unifiedGlobalShortcuts
readonly property bool hasInternalSeparator: latteApplet ? latteApplet.hasInternalSeparator : false
property int animationStep: {
if (!universalSettings || universalSettings.mouseSensitivity === Latte.Types.HighSensitivity) {
return 1;
} else if (universalSettings.mouseSensitivity === Latte.Types.MediumSensitivity) {
return Math.max(3, root.iconSize / 18);
} else if (universalSettings.mouseSensitivity === Latte.Types.LowSensitivity) {
return Math.max(5, root.iconSize / 10);
}
}
property int latteAppletHoveredIndex: latteApplet ? latteApplet.hoveredIndex : -1
property int launchersGroup: plasmoid.configuration.launchersGroup
property int tasksCount: latteApplet ? latteApplet.tasksCount : 0
//! Animations
property bool animationsEnabled: plasmoid.configuration.animationsEnabled && Latte.WindowSystem.compositingActive
property bool animationLauncherBouncing: animationsEnabled && latteApplet && plasmoid.configuration.animationLauncherBouncing
property bool animationWindowInAttention: animationsEnabled && latteApplet && plasmoid.configuration.animationWindowInAttention
property bool animationNewWindowSliding: animationsEnabled && latteApplet && plasmoid.configuration.animationNewWindowSliding
property bool animationWindowAddedInGroup: animationsEnabled && latteApplet && plasmoid.configuration.animationWindowAddedInGroup
property bool animationWindowRemovedFromGroup: animationsEnabled && latteApplet && plasmoid.configuration.animationWindowRemovedFromGroup
property real appliedDurationTime: animationsEnabled ? durationTime : 2
property real durationTime: {
if (!animationsEnabled) {
return 0;
}
/*if ((latteView && latteView.effects && latteView.effects.animationsBlocked)
|| !animationsEnabled) {
return 0;
}*/
if (plasmoid.configuration.durationTime === 0 || plasmoid.configuration.durationTime === 2 )
return plasmoid.configuration.durationTime;
if (plasmoid.configuration.durationTime === 1)
return 1.65;
else if (plasmoid.configuration.durationTime === 3)
return 2.35;
return 2;
}
property real animationsZoomFactor : {
if (!animationsEnabled) {
return 1;
}
if (latteApplet && (animationLauncherBouncing || animationWindowInAttention || animationWindowAddedInGroup)) {
return 1.65;
}
return 1;
}
property real maxZoomFactor: Math.max(zoomFactor, animationsZoomFactor)
property rect screenGeometry: latteView ? latteView.screenGeometry : plasmoid.screenGeometry
readonly property color minimizedDotColor: colorizerManager.minimizedDotColor
///END properties from latteApplet
Plasmoid.backgroundHints: PlasmaCore.Types.NoBackground
//// BEGIN properties in functions
property int noApplets: {
var count1 = 0;
var count2 = 0;
count1 = layoutsContainer.mainLayout.children.length;
var tempLength = layoutsContainer.mainLayout.children.length;
for (var i=tempLength-1; i>=0; --i) {
var applet = layoutsContainer.mainLayout.children[i];
if (applet && (applet === dndSpacer || applet === lastSpacer || applet.isInternalViewSplitter))
count1--;
}
count2 = layoutsContainer.endLayout.children.length;
tempLength = layoutsContainer.endLayout.children.length;
for (var i=tempLength-1; i>=0; --i) {
var applet = layoutsContainer.endLayout.children[i];
if (applet && (applet === dndSpacer || applet === lastSpacer || applet.isInternalViewSplitter))
count2--;
}
return (count1 + count2);
}
///The index of user's current icon size
property int currentIconIndex:{
for(var i=iconsArray.length-1; i>=0; --i){
if(iconsArray[i] === iconSize){
return i;
}
}
return 3;
}
//// END properties in functions
////////////////END properties
//// BEGIN OF Behaviors
Behavior on thickMargin {
NumberAnimation {
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
Behavior on lengthIntMargin {
NumberAnimation {
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
Behavior on lengthExtMargin {
NumberAnimation {
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
Behavior on localScreenEdgeMargin {
enabled: !root.behaveAsPlasmaPanel
&& !editModeVisual.editAnimationRunning /*avoid slide-out animation when from editMode we change to real floating*/
NumberAnimation {
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
Behavior on iconSize {
enabled: !(root.editMode && root.behaveAsPlasmaPanel)
NumberAnimation {
duration: 0.8 * root.animationTime
onRunningChanged: {
if (!running) {
delayUpdateMaskArea.start();
}
}
}
}
Behavior on offset {
enabled: editModeVisual.editAnimationInFullThickness
NumberAnimation {
id: offsetAnimation
duration: 0.8 * root.animationTime
easing.type: Easing.OutCubic
}
}
//// END OF Behaviors
//////////////START OF CONNECTIONS
onEditModeChanged: {
if (editMode) {
visibilityManager.updateMaskArea();
clearZoom();
} else {
layoutsContainer.updateSizeForAppletsInFill();
}
//! This is used in case the dndspacer has been left behind
//! e.g. the user drops a folder and a context menu is appearing
//! but the user decides to not make a choice for the applet type
if (dndSpacer.parent !== root) {
dndSpacer.parent = root;
}
}
onInConfigureAppletsModeChanged: {
if (inConfigureAppletsMode && panelUserSetAlignment===Latte.Types.Justify) {
joinLayoutsToMainLayout();
} else if (!inConfigureAppletsMode) {
splitMainLayoutToLayouts();
}
updateIndexes();
}
//! It is used only when the user chooses different alignment types
//! and not during startup
onPanelUserSetAlignmentChanged: {
if (!root.editMode) {
return;
}
if (!inConfigureAppletsMode){
if (panelUserSetAlignment===Latte.Types.Justify) {
addInternalViewSplitters();
splitMainLayoutToLayouts();
} else {
joinLayoutsToMainLayout();
root.destroyInternalViewSplitters();
}
} else {
if (panelUserSetAlignment===Latte.Types.Justify) {
addInternalViewSplitters();
} else {
root.destroyInternalViewSplitters();
}
}
LayoutManager.save();
updateIndexes();
}
onLatteViewChanged: {
if (latteView) {
latteView.onXChanged.connect(visibilityManager.updateMaskArea);
latteView.onYChanged.connect(visibilityManager.updateMaskArea);
latteView.onWidthChanged.connect(visibilityManager.updateMaskArea);
latteView.onHeightChanged.connect(visibilityManager.updateMaskArea);
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);
latteView.visibility.onContainsMouseChanged.connect(visibilityManager.slotContainsMouseChanged);
latteView.visibility.onMustBeHide.connect(visibilityManager.slotMustBeHide);
latteView.visibility.onMustBeShown.connect(visibilityManager.slotMustBeShown);
updateContainsOnlyPlasmaTasks();
}
}
onDockContainsMouseChanged: {
if (!dockContainsMouse) {
initializeHoveredIndexes();
}
}
onMaxLengthChanged: {
layoutsContainer.updateSizeForAppletsInFill();
}
onToolBoxChanged: {
if (toolBox) {
toolBox.visible = false;
}
}
onIsReadyChanged: {
if (isReady && !titleTooltipDialog.visible && titleTooltipDialog.activeItemHovered){
titleTooltipDialog.show(titleTooltipDialog.activeItem, titleTooltipDialog.activeItemText);
}
}
onIsVerticalChanged: {
if (isVertical) {
if (plasmoid.configuration.panelPosition === Latte.Types.Left)
plasmoid.configuration.panelPosition = Latte.Types.Top;
else if (plasmoid.configuration.panelPosition === Latte.Types.Right)
plasmoid.configuration.panelPosition = Latte.Types.Bottom;
} else {
if (plasmoid.configuration.panelPosition === Latte.Types.Top)
plasmoid.configuration.panelPosition = Latte.Types.Left;
else if (plasmoid.configuration.panelPosition === Latte.Types.Bottom)
plasmoid.configuration.panelPosition = Latte.Types.Right;
}
}
// onIconSizeChanged: console.log("Icon Size Changed:"+iconSize);
Component.onCompleted: {
// currentLayout.isLayoutHorizontal = isHorizontal
LayoutManager.plasmoid = plasmoid;
LayoutManager.root = root;
LayoutManager.layout = layoutsContainer.mainLayout;
LayoutManager.layoutS = layoutsContainer.startLayout;
LayoutManager.layoutE = layoutsContainer.endLayout;
LayoutManager.lastSpacer = lastSpacer;
LayoutManager.restore();
plasmoid.action("configure").visible = !plasmoid.immutable;
plasmoid.action("configure").enabled = !plasmoid.immutable;
inStartupTimer.start();
}
Component.onDestruction: {
console.debug("Destroying Latte Dock Containment ui...");
if (latteView) {
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);
}
}
}
Containment.onAppletAdded: {
addApplet(applet, x, y);
console.log(applet.pluginName);
LayoutManager.save();
updateIndexes();
}
Containment.onAppletRemoved: {
LayoutManager.removeApplet(applet);
var flexibleFound = false;
for (var i = 0; i < layoutsContainer.mainLayout.children.length; ++i) {
var applet = layoutsContainer.mainLayout.children[i].applet;
if (applet && ((root.isHorizontal && applet.Layout.fillWidth) ||
(!root.isHorizontal && applet.Layout.fillHeight)) &&
applet.visible) {
flexibleFound = true;
break
}
}
if (!flexibleFound) {
lastSpacer.parent = layoutsContainer.mainLayout;
}
console.log(applet.pluginName);
LayoutManager.save();
updateIndexes();
updateContainsOnlyPlasmaTasks();
}
Plasmoid.onUserConfiguringChanged: {
if (plasmoid.immutable) {
if (dragOverlay) {
dragOverlay.destroy();
}
return;
}
// console.debug("user configuring", plasmoid.userConfiguring)
if (plasmoid.userConfiguring) {
// console.log("applets------");
for (var i = 0; i < plasmoid.applets.length; ++i) {
// console.log("applet:"+i);
plasmoid.applets[i].expanded = false;
}
if (!dragOverlay) {
var component = Qt.createComponent("editmode/ConfigOverlay.qml");
if (component.status == Component.Ready) {
dragOverlay = component.createObject(root);
} else {
console.log("Could not create ConfigOverlay");
console.log(component.errorString());
}
component.destroy();
} else {
dragOverlay.visible = true;
}
} else {
if (dragOverlay) {
dragOverlay.visible = false;
dragOverlay.destroy();
}
}
}
Plasmoid.onImmutableChanged: {
plasmoid.action("configure").visible = !plasmoid.immutable;
plasmoid.action("configure").enabled = !plasmoid.immutable;
///Set Preferred Sizes///
///Notice: they are set here because if they are set with a binding
///they break the !immutable experience, the latteView becomes too small
///to add applets
/* if (plasmoid.immutable) {
if(root.isHorizontal) {
root.Layout.preferredWidth = (plasmoid.configuration.panelPosition === Latte.Types.Justify ?
layoutsContainer.width + 0.5*iconMargin : layoutsContainer.mainLayout.width + iconMargin);
} else {
root.Layout.preferredHeight = (plasmoid.configuration.panelPosition === Latte.Types.Justify ?
layoutsContainer.height + 0.5*iconMargin : layoutsContainer.mainLayout.height + iconMargin);
}
} else {
if (root.isHorizontal) {
root.Layout.preferredWidth = Screen.width;
} else {
root.Layout.preferredHeight = Screen.height;
}
}*/
visibilityManager.updateMaskArea();
}
//////////////END OF CONNECTIONS
//////////////START OF FUNCTIONS
function addApplet(applet, x, y) {
var container = appletContainerComponent.createObject(dndSpacer.parent)
container.applet = applet;
applet.parent = container.appletWrapper;
applet.anchors.fill = container.appletWrapper;
applet.visible = true;
// don't show applet if it chooses to be hidden but still make it
// accessible in the panelcontroller
container.visible = Qt.binding(function() {
return applet.status !== PlasmaCore.Types.HiddenStatus || (!plasmoid.immutable && root.inConfigureAppletsMode)
})
addContainerInLayout(container, applet, x, y);
updateContainsOnlyPlasmaTasks();
}
function addContainerInLayout(container, applet, x, y){
// Is there a DND placeholder? Replace it!
if ( (dndSpacer.parent === layoutsContainer.mainLayout)
|| (dndSpacer.parent === layoutsContainer.startLayout)
|| (dndSpacer.parent===layoutsContainer.endLayout)) {
LayoutManager.insertBeforeForLayout(dndSpacer.parent, dndSpacer, container);
dndSpacer.parent = root;
return;
// If the provided position is valid, use it.
} else if (x >= 0 && y >= 0) {
var index = LayoutManager.insertAtCoordinates2(container, x , y);
// Fall through to determining an appropriate insert position.
} else {
var before = null;
container.animationsEnabled = false;
if (lastSpacer.parent === layoutsContainer.mainLayout) {
before = lastSpacer;
}
// Insert icons to the left of whatever is at the center (usually a Task Manager),
// if it exists.
// FIXME TODO: This is a real-world fix to produce a sensible initial position for
// launcher icons added by launcher menu applets. The basic approach has been used
// since Plasma 1. However, "add launcher to X" is a generic-enough concept and
// frequent-enough occurrence that we'd like to abstract it further in the future
// and get rid of the ugliness of parties external to the containment adding applets
// of a specific type, and the containment caring about the applet type. In a better
// system the containment would be informed of requested launchers, and determine by
// itself what it wants to do with that information.
if (applet.pluginName == "org.kde.plasma.icon") {
var middle = layoutsContainer.mainLayout.childAt(root.width / 2, root.height / 2);
if (middle) {
before = middle;
}
// Otherwise if lastSpacer is here, enqueue before it.
}
if (before) {
LayoutManager.insertBefore(before, container);
// Fall through to adding at the end.
} else {
container.parent = layoutsContainer.mainLayout;
}
}
//Important, removes the first children of the layoutsContainer.mainLayout after the first
//applet has been added
lastSpacer.parent = root;
updateIndexes();
}
function addInternalViewSplitters(){
if (internalViewSplittersCount() === 0) {
addInternalViewSplitter(plasmoid.configuration.splitterPosition);
addInternalViewSplitter(plasmoid.configuration.splitterPosition2);
}
}
function addInternalViewSplitter(pos){
var splittersCount = internalViewSplittersCount();
if(splittersCount<2){
var container = appletContainerComponent.createObject(root);
container.internalSplitterId = splittersCount+1;
container.visible = true;
if(pos>=0 ){
LayoutManager.insertAtIndex(container, pos);
} else {
LayoutManager.insertAtIndex(container, Math.floor(layoutsContainer.mainLayout.count / 2));
}
}
}
//! it is used in order to check the right click position
//! the only way to take into account the visual appearance
//! of the applet (including its spacers)
function appletContainsPos(appletId, pos){
for (var i = 0; i < layoutsContainer.startLayout.children.length; ++i) {
var child = layoutsContainer.startLayout.children[i];
if (child && child.applet && child.applet.id === appletId && child.containsPos(pos))
return true;
}
for (var i = 0; i < layoutsContainer.mainLayout.children.length; ++i) {
var child = layoutsContainer.mainLayout.children[i];
if (child && child.applet && child.applet.id === appletId && child.containsPos(pos))
return true;
}
for (var i = 0; i < layoutsContainer.endLayout.children.length; ++i) {
var child = layoutsContainer.endLayout.children[i];
if (child && child.applet && child.applet.id === appletId && child.containsPos(pos))
return true;
}
return false;
}
function checkLastSpacer() {
lastSpacer.parent = root
var expands = false;
if (isHorizontal) {
for (var container in layoutsContainer.mainLayout.children) {
var item = layoutsContainer.mainLayout.children[container];
if (item.Layout && item.Layout.fillWidth) {
expands = true;
}
}
} else {
for (var container in layoutsContainer.mainLayout.children) {
var item = layoutsContainer.mainLayout.children[container];
if (item.Layout && item.Layout.fillHeight) {
expands = true;
}
}
}
if (!expands) {
lastSpacer.parent = layoutsContainer.mainLayout
}
}
function clearZoom(){
if (latteApplet){
latteApplet.clearZoom();
}
root.clearZoomSignal();
}
function containmentActions(){
return latteView.containmentActions();
}
function decimalToHex(d, padding) {
var hex = Number(d).toString(16);
padding = typeof (padding) === "undefined" || padding === null ? padding = 2 : padding;
while (hex.length < padding) {
hex = "0" + hex;
}
return hex;
}
function disableDirectRender(){
// root.globalDirectRender = false;
}
function internalViewSplittersCount(){
var splitters = 0;
for (var container in layoutsContainer.startLayout.children) {
var item = layoutsContainer.startLayout.children[container];
if(item && item.isInternalViewSplitter) {
splitters = splitters + 1;
}
}
for (var container in layoutsContainer.mainLayout.children) {
var item = layoutsContainer.mainLayout.children[container];
if(item && item.isInternalViewSplitter) {
splitters = splitters + 1;
}
}
for (var container in layoutsContainer.endLayout.children) {
var item = layoutsContainer.endLayout.children[container];
if(item && item.isInternalViewSplitter) {
splitters = splitters + 1;
}
}
return splitters;
}
function initializeHoveredIndexes() {
layoutsContainer.hoveredIndex = -1;
layoutsContainer.currentSpot = -1000;
if (latteApplet) {
latteApplet.initializeHoveredIndex();
}
}
function layoutManager() {
return LayoutManager;
}
function layoutManagerInsertBefore(place, item) {
LayoutManager.insertBefore(place, item);
}
function layoutManagerInsertAfter(place, item) {
LayoutManager.insertAfter(place, item);
}
function layoutManagerSave() {
LayoutManager.save();
}
function layoutManagerSaveOptions() {
LayoutManager.saveOptions();
}
function mouseInCanBeHoveredApplet(){
if (latteApplet && latteApplet.containsMouse())
return true;
var applets = layoutsContainer.startLayout.children;
for(var i=0; i=0; --i){
if(iconsArray[i] === size){
return true;
}
}
return false;
}
function slotAnimationsNeedBothAxis(step) {
if (step === 0) {
return;
}
animationsNeedBothAxis = Math.max(animationsNeedBothAxis + step, 0);
visibilityManager.updateMaskArea();
}
function slotAnimationsNeedLength(step) {
if (step === 0) {
return;
}
animationsNeedLength = Math.max(animationsNeedLength + step, 0);
//when need length animations are ended it would be a good idea
//to update the tasks geometries in the plasmoid
if(animationsNeedLength === 0 && latteApplet) {
latteApplet.publishTasksGeometries();
}
visibilityManager.updateMaskArea();
}
function slotAnimationsNeedThickness(step) {
if (step === 0) {
return;
}
animationsNeedThickness = Math.max(animationsNeedThickness + step, 0);
visibilityManager.updateMaskArea();
}
function slotAppletsNeedWindowsTracking(step) {
if (step === 0) {
return;
}
appletsNeedWindowsTracking = Math.max(appletsNeedWindowsTracking + step, 0);
}
//this is used when dragging a task in order to not hide the dock
//and also by the menu appearing from tasks for the same reason
function slotActionsBlockHiding(step) {
//if (root.editMode) {
// return;
// }
if ((step === 0) || (!latteView)) {
return;
}
actionsBlockHiding = Math.max(actionsBlockHiding + step, 0);
if (actionsBlockHiding > 0){
latteView.setBlockHiding(true);
} else {
if (!root.editMode)
latteView.setBlockHiding(false);
}
}
function slotPreviewsShown(){
if (latteView) {
latteView.deactivateApplets();
}
}
function startCheckRestoreZoomTimer(){
checkRestoreZoom.start();
}
function stopCheckRestoreZoomTimer(){
checkRestoreZoom.stop();
}
function startDirectRenderDelayerDuringEntering(){
directRenderDelayerForEnteringTimer.start();
}
function setGlobalDirectRender(value) {
if (latteApplet && latteApplet.tasksExtendedManager.waitingLaunchersLength() > 0)
return;
if (value === true) {
if (mouseInCanBeHoveredApplet()) {
root.globalDirectRender = true;
} else {
// console.log("direct render true ignored...");
}
} else {
root.globalDirectRender = false;
}
}
function updateContainsOnlyPlasmaTasks() {
if (latteView) {
root.containsOnlyPlasmaTasks = (latteView.tasksPresent() && !latteApplet);
} else {
root.containsOnlyPlasmaTasks = false;
}
}
function updateSizeForAppletsInFill() {
layoutsContainer.updateSizeForAppletsInFill();
}
function splitMainLayoutToLayouts() {
if (internalViewSplittersCount() === 2) {
console.log("LAYOUTS: Moving applets from MAIN to THREE Layouts mode...");
var splitter = -1;
var splitter2 = -1;
var totalChildren = layoutsContainer.mainLayout.children.length;
for (var i=0; i=0 && splitter2 === -1) {
splitter2 = i;
}
}
// console.log("update layouts 1:"+splitter + " - "+splitter2);
for (var i=0; i<=splitter; ++i){
var item = layoutsContainer.mainLayout.children[0];
item.parent = layoutsContainer.startLayout;
}
splitter2 = splitter2 - splitter - 1;
// console.log("update layouts 2:"+splitter + " - "+splitter2);
totalChildren = layoutsContainer.mainLayout.children.length;
for (var i=splitter2+1; i=0; --i) {
var item1 = layoutsContainer.mainLayout.children[0];
item1.parent = layoutsContainer.startLayout;
}
var totalChildren2 = layoutsContainer.endLayout.children.length;
for (var i=totalChildren2-1; i>=0; --i) {
var item2 = layoutsContainer.endLayout.children[0];
item2.parent = layoutsContainer.startLayout;
}
var totalChildrenL = layoutsContainer.startLayout.children.length;
for (var i=totalChildrenL-1; i>=0; --i) {
var itemL = layoutsContainer.startLayout.children[0];
itemL.parent = layoutsContainer.mainLayout;
}
}
//END functions
////BEGIN interfaces
Connections {
target: Latte.WindowSystem
onCompositingActiveChanged: {
visibilityManager.updateMaskArea();
}
}
Connections {
target: latteView
onContextMenuIsShownChanged: {
if (!latteView.contextMenuIsShown) {
checkRestoreZoom.start();
} else {
root.setGlobalDirectRender(false);
}
}
}
Connections{
target: latteView && latteView.visibility ? latteView.visibility : root
ignoreUnknownSignals : true
onContainsMouseChanged: {
if (mouseInHoverableArea()) {
stopCheckRestoreZoomTimer();
} else {
startCheckRestoreZoomTimer();
}
}
}
Connections{
target: layoutsContainer
onHoveredIndexChanged: {
if (latteApplet && layoutsContainer.hoveredIndex>-1){
latteApplet.setHoveredIndex(-1);
}
if (latteApplet && latteApplet.windowPreviewIsShown && layoutsContainer.hoveredIndex>-1) {
latteApplet.hidePreview();
}
}
}
////END interfaces
/////BEGIN: Title Tooltip///////////
PlasmaCore.Dialog{
id: titleTooltipDialog
type: PlasmaCore.Dialog.Tooltip
flags: Qt.WindowStaysOnTopHint | Qt.WindowDoesNotAcceptFocus | Qt.ToolTip
location: plasmoid.location
mainItem: RowLayout{
Layout.fillWidth: true
Layout.fillHeight: true
PlasmaComponents.Label{
id:titleLbl
Layout.leftMargin: 4
Layout.rightMargin: 4
Layout.topMargin: 2
Layout.bottomMargin: 2
text: titleTooltipDialog.title
}
}
visible: false
property string title: ""
property bool activeItemHovered: false
property Item activeItem: null
property Item activeItemTooltipParent: null
property string activeItemText: ""
Component.onCompleted: {
root.clearZoomSignal.connect(titleTooltipDialog.hide);
}
Component.onDestruction: {
root.clearZoomSignal.disconnect(titleTooltipDialog.hide);
}
function hide(debug){
if (!root.titleTooltips)
return;
activeItemHovered = false;
hideTitleTooltipTimer.start();
}
function show(taskItem, text){
if (!root.titleTooltips || (latteApplet && latteApplet.contextMenu)){
return;
}
activeItemHovered = true;
if (activeItem !== taskItem) {
activeItem = taskItem;
activeItemTooltipParent = taskItem.tooltipVisualParent;
activeItemText = text;
}
if (isReady) {
showTitleTooltipTimer.start();
}
}
function update() {
activeItemHovered = true
title = activeItemText;
visualParent = activeItemTooltipParent;
if (latteApplet && latteApplet.windowPreviewIsShown) {
latteApplet.hidePreview();
}
visible = true;
}
}
Timer {
id: showTitleTooltipTimer
interval: 100
onTriggered: {
if (latteView && latteView.visibility && latteView.visibility.containsMouse) {
titleTooltipDialog.update();
}
if (titleTooltipDialog.visible) {
titleTooltipCheckerToNotShowTimer.start();
}
if (root.debugModeTimers) {
console.log("containment timer: showTitleTooltipTimer called...");
}
}
}
Timer {
id: hideTitleTooltipTimer
interval: 200
onTriggered: {
if (!titleTooltipDialog.activeItemHovered) {
titleTooltipDialog.visible = false;
}
if (root.debugModeTimers) {
console.log("containment timer: hideTitleTooltipTimer called...");
}
}
}
//! Timer to fix #811, rare cases that both a window preview and context menu are
//! shown
Timer {
id: titleTooltipCheckerToNotShowTimer
interval: 250
onTriggered: {
if (titleTooltipDialog.visible && latteApplet && (latteApplet.contextMenu || latteApplet.windowPreviewIsShown)) {
titleTooltipDialog.visible = false;
}
}
}
/////END: Title Tooltip///////////
///////////////BEGIN components
Component {
id: appletContainerComponent
Applet.AppletItem{}
}
ParabolicManager{
id: _parabolicManager
}
Indicators.Manager{
id: indicators
}
Item {
id: graphicsSystem
readonly property bool isAccelerated: (GraphicsInfo.api !== GraphicsInfo.Software)
&& (GraphicsInfo.api !== GraphicsInfo.Unknown)
}
///////////////END components
PlasmaCore.ColorScope{
id: colorScopePalette
}
///////////////BEGIN UI elements
//it is used to check if the mouse is outside the layoutsContainer borders,
//so in that case the onLeave event behavior should be trigerred
RootMouseArea{
id: rootMouseArea
}
Loader{
active: root.debugModeWindow
sourceComponent: DebugWindow{}
}
//! Load a sepia background in order to avoid black background
Loader{
anchors.fill: parent
active: !Latte.WindowSystem.compositingActive
sourceComponent: Image{
anchors.fill: parent
fillMode: Image.Tile
source: root.hasUserSpecifiedBackground ? latteView.layout.background : "../icons/wheatprint.jpg"
}
}
EditMode.Visual{
id:editModeVisual
// z: root.behaveAsPlasmaPanel ? 1 : 0
}
Item {
id: lastSpacer
parent: layoutsContainer.mainLayout
Layout.fillWidth: true
Layout.fillHeight: true
z:10
Rectangle{
anchors.fill: parent
color: "transparent"
border.color: "yellow"
border.width: 1
}
}
Loader{
anchors.fill: parent
active: root.debugMode
z:10
sourceComponent: Item{
Rectangle{
anchors.fill: parent
color: "yellow"
opacity: 0.06
}
}
}
AutomaticItemSizer {
id: automaticItemSizer
}
VisibilityManager{ id: visibilityManager }
DragDropArea {
id: backDropArea
anchors.fill: parent
readonly property bool higherPriority: latteView && latteView.containsDrag
&& ((root.dragInfo.isPlasmoid && root.dragInfo.isSeparator)
|| (foreDropArea.dragInfo.computationsAreValid && !root.dragInfo.isPlasmoid && !root.dragInfo.onlyLaunchers))
Item{
id: panelBox
anchors.fill: layoutsContainer
PanelBox{
id: panelBoxBackground
}
}
Layouts.LayoutsContainer {
id: layoutsContainer
}
DragDropArea {
id: foreDropArea
anchors.fill: parent
visible: !backDropArea.higherPriority
isForeground: true
/* Rectangle {
anchors.fill: parent
color: "blue"
opacity: 0.5
}*/
}
}
Colorizer.Manager {
id: colorizerManager
}
Item {
id: dndSpacer
width: root.isHorizontal ? length : thickness
height: root.isHorizontal ? thickness : length
readonly property int length: root.iconSize + root.lengthMargins
readonly property int thickness: root.iconSize + root.thickMargins + root.localScreenEdgeMargin
Layout.preferredWidth: width
Layout.preferredHeight: height
opacity: 0
z:1500
LatteComponents.AddItem{
id: dndSpacerAddItem
width: root.isHorizontal ? parent.width : parent.width - root.localScreenEdgeMargin
height: root.isHorizontal ? parent.height - root.localScreenEdgeMargin : parent.height
states:[
State{
name: "bottom"
when: plasmoid.location === PlasmaCore.Types.BottomEdge
AnchorChanges{
target: dndSpacerAddItem;
anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: undefined;
anchors.right: undefined; anchors.left: undefined; anchors.top: undefined; anchors.bottom: parent.bottom;
}
PropertyChanges{
target: dndSpacerAddItem;
anchors.leftMargin: 0; anchors.rightMargin: 0; anchors.topMargin:0; anchors.bottomMargin: root.localScreenEdgeMargin;
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
}
},
State{
name: "top"
when: plasmoid.location === PlasmaCore.Types.TopEdge
AnchorChanges{
target: dndSpacerAddItem;
anchors.horizontalCenter: parent.horizontalCenter; anchors.verticalCenter: undefined;
anchors.right: undefined; anchors.left: undefined; anchors.top: parent.top; anchors.bottom: undefined;
}
PropertyChanges{
target: dndSpacerAddItem;
anchors.leftMargin: 0; anchors.rightMargin: 0; anchors.topMargin: root.localScreenEdgeMargin; anchors.bottomMargin: 0;
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
}
},
State{
name: "left"
when: plasmoid.location === PlasmaCore.Types.LeftEdge
AnchorChanges{
target: dndSpacerAddItem;
anchors.horizontalCenter: undefined; anchors.verticalCenter: parent.verticalCenter;
anchors.right: undefined; anchors.left: parent.left; anchors.top: undefined; anchors.bottom: undefined;
}
PropertyChanges{
target: dndSpacerAddItem;
anchors.leftMargin: root.localScreenEdgeMargin; anchors.rightMargin: 0; anchors.topMargin:0; anchors.bottomMargin: 0;
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
}
},
State{
name: "right"
when: plasmoid.location === PlasmaCore.Types.RightEdge
AnchorChanges{
target: dndSpacerAddItem;
anchors.horizontalCenter: undefined; anchors.verticalCenter: parent.verticalCenter;
anchors.right: parent.right; anchors.left: undefined; anchors.top: undefined; anchors.bottom: undefined;
}
PropertyChanges{
target: dndSpacerAddItem;
anchors.leftMargin: 0; anchors.rightMargin: root.localScreenEdgeMargin; anchors.topMargin:0; anchors.bottomMargin: 0;
anchors.horizontalCenterOffset: 0; anchors.verticalCenterOffset: 0;
}
}
]
}
}
///////////////END UI elements
///////////////BEGIN TIMER elements
//Timer to check if the mouse is still outside the latteView in order to restore zooms to 1.0
Timer{
id:checkRestoreZoom
interval: 90
onTriggered: {
if (latteApplet && (latteApplet.previewContainsMouse() || latteApplet.contextMenu))
return;
if (latteView.contextMenuIsShown)
return;
if (!mouseInHoverableArea()) {
setGlobalDirectRender(false);
root.initializeHoveredIndexes();
root.clearZoom();
}
if (root.debugModeTimers) {
console.log("containment timer: checkRestoreZoom called...");
}
}
}
//! Delayer in order to not activate directRendering when the mouse
//! enters until the timer has ended. This way we make sure that the
//! zoom-in animations will have ended.
Timer{
id:directRenderDelayerForEnteringTimer
interval: 3.2 * root.durationTime * units.shortDuration
}
//this is a delayer to update mask area, it is used in cases
//that animations can not catch up with animations signals
//e.g. the automaicIconSize case
Timer{
id:delayUpdateMaskArea
repeat:false;
interval:300;
onTriggered: {
if (layoutsContainer.animationSent) {
root.slotAnimationsNeedLength(-1);
layoutsContainer.animationSent = false;
}
visibilityManager.updateMaskArea();
if (root.debugModeTimers) {
console.log("containment timer: delayUpdateMaskArea called...");
}
}
}
//! It is used in order to slide-in the latteView on startup
Timer{
id: inStartupTimer
interval: 1500
repeat: false
onTriggered: {
if (inStartup) {
visibilityManager.slotMustBeShown();
}
}
}
///////////////END TIMER elements
}
diff --git a/shell/package/contents/configuration/pages/BehaviorConfig.qml b/shell/package/contents/configuration/pages/BehaviorConfig.qml
index 4e05e347..4c35140e 100644
--- a/shell/package/contents/configuration/pages/BehaviorConfig.qml
+++ b/shell/package/contents/configuration/pages/BehaviorConfig.qml
@@ -1,846 +1,869 @@
/*
* Copyright 2016 Smith AR
* Michail Vourlakos
*
* This file is part of Latte-Dock
*
* Latte-Dock is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.components 3.0 as PlasmaComponents3
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.2 as Latte
import org.kde.latte.components 1.0 as LatteComponents
import "../../controls" as LatteExtraControls
PlasmaComponents.Page {
Layout.maximumWidth: content.width + content.Layout.leftMargin * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
ColumnLayout {
id: content
width: (dialog.appliedWidth - units.smallSpacing * 2) - Layout.leftMargin * 2
spacing: dialog.subGroupSpacing
anchors.horizontalCenter: parent.horizontalCenter
Layout.leftMargin: units.smallSpacing * 2
//! BEGIN: Inline Dock/Panel Type, it is used only when the secondary window
//! overlaps the main dock config window
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Layout.topMargin: units.smallSpacing
visible: dialog.highLevel && viewConfig.showInlineProperties
LatteComponents.Header {
text: i18n("Type")
}
LatteExtraControls.TypeSelection{
id: viewTypeSelection
horizontal: true
}
}
//! END: Inline Dock/Panel Type
//! BEGIN: Location
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Layout.topMargin: units.smallSpacing
LatteComponents.Header {
text: screenRow.visible ? i18n("Screen") : i18n("Location")
}
Connections {
target: universalSettings
onScreensCountChanged: screenRow.updateScreens()
}
RowLayout {
id: screenRow
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 3
spacing: 2
visible: true
function updateScreens() {
if (universalSettings.screens.length > 1) {
screenRow.visible = true;
} else {
screenRow.visible = false;
}
screensModel.clear();
var primary = {name: i18n("On Primary"), icon: 'favorites'};
screensModel.append(primary);
//check if the screen exists, it is used in cases Latte is moving
//the view automatically to primaryScreen in order for the user
//to has always a view with tasks shown
var screenExists = false
for (var i = 0; i < universalSettings.screens.length; i++) {
if (universalSettings.screens[i].name === latteView.positioner.currentScreenName) {
screenExists = true;
}
}
if (!screenExists && !latteView.onPrimary) {
var scr = {name: latteView.positioner.currentScreenName, icon: 'view-fullscreen'};
screensModel.append(scr);
}
for (var i = 0; i < universalSettings.screens.length; i++) {
var scr = {name: universalSettings.screens[i].name, icon: 'view-fullscreen'};
screensModel.append(scr);
}
if (latteView.onPrimary) {
screenCmb.currentIndex = 0;
} else {
screenCmb.currentIndex = screenCmb.findScreen(latteView.positioner.currentScreenName);
}
console.log(latteView.positioner.currentScreenName);
}
Connections{
target: viewConfig
onShowSignal: screenRow.updateScreens();
}
ListModel {
id: screensModel
}
LatteComponents.ComboBox {
id: screenCmb
Layout.fillWidth: true
model: screensModel
textRole: "name"
iconRole: "icon"
Component.onCompleted: screenRow.updateScreens();
onActivated: {
var succeed = false;
if (index === 0) {
succeed = latteView.positioner.setCurrentScreen("primary");
if (succeed) {
latteView.onPrimary = true;
} else if (!latteView.onPrimary){
console.log("the edge is already occupied!!!");
currentIndex = findScreen(latteView.positioner.currentScreenName);
}
} else if (index>0 && (index !== findScreen(latteView.positioner.currentScreenName) || latteView.onPrimary)) {
console.log("current index changed!!! :"+ index);
console.log("screen must be changed...");
succeed = latteView.positioner.setCurrentScreen(textAt(index));
if(succeed) {
latteView.onPrimary = false;
} else {
console.log("the edge is already occupied!!!");
currentIndex = findScreen(latteView.positioner.currentScreenName);
}
}
}
function findScreen(scrName) {
for(var i=0; i=0);
topEdgeBtn.edgeIsFree = (edges.indexOf(topEdgeBtn.edge)>=0);
leftEdgeBtn.edgeIsFree = (edges.indexOf(leftEdgeBtn.edge)>=0);
rightEdgeBtn.edgeIsFree = (edges.indexOf(rightEdgeBtn.edge)>=0);
}
PlasmaComponents.Button {
id: bottomEdgeBtn
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18nc("bottom location", "Bottom")
iconSource: "arrow-down"
checked: latteView.location === edge
checkable: true
enabled: checked || edgeIsFree
exclusiveGroup: locationGroup
property bool edgeIsFree: true
readonly property int edge: PlasmaCore.Types.BottomEdge
}
PlasmaComponents.Button {
id: leftEdgeBtn
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18nc("left location", "Left")
iconSource: "arrow-left"
checked: latteView.location === edge
checkable: true
enabled: checked || edgeIsFree
exclusiveGroup: locationGroup
property bool edgeIsFree: true
readonly property int edge: PlasmaCore.Types.LeftEdge
}
PlasmaComponents.Button {
id: topEdgeBtn
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18nc("top location", "Top")
iconSource: "arrow-up"
checked: latteView.location === edge
checkable: true
enabled: checked || edgeIsFree
exclusiveGroup: locationGroup
property bool edgeIsFree: true
readonly property int edge: PlasmaCore.Types.TopEdge
}
PlasmaComponents.Button {
id: rightEdgeBtn
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18nc("right location", "Right")
iconSource: "arrow-right"
checked: latteView.location === edge
checkable: true
enabled: checked || edgeIsFree
exclusiveGroup: locationGroup
property bool edgeIsFree: true
readonly property int edge: PlasmaCore.Types.RightEdge
}
}
}
//! END: Location
//! BEGIN: Alignment
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
LatteComponents.Header {
text: i18n("Alignment")
}
RowLayout {
id: alignmentRow
Layout.fillWidth: true
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
LayoutMirroring.enabled: false
spacing: 2
readonly property int panelPosition: plasmoid.configuration.panelPosition
readonly property int buttonSize: (dialog.optionsWidth - (spacing * 3)) / 4
ExclusiveGroup {
id: alignmentGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.panelPosition = current.position
}
}
PlasmaComponents.Button {
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: panelIsVertical ? i18nc("top alignment", "Top") : i18nc("left alignment", "Left")
iconSource: panelIsVertical ? "format-align-vertical-top" : "format-justify-left"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
property int position: panelIsVertical ? Latte.Types.Top : Latte.Types.Left
}
PlasmaComponents.Button {
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18nc("center alignment", "Center")
iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
property int position: Latte.Types.Center
}
PlasmaComponents.Button {
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: panelIsVertical ? i18nc("bottom alignment", "Bottom") : i18nc("right alignment", "Right")
iconSource: panelIsVertical ? "format-align-vertical-bottom" : "format-justify-right"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
property int position: panelIsVertical ? Latte.Types.Bottom : Latte.Types.Right
}
PlasmaComponents.Button {
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18nc("justify alignment", "Justify")
iconSource: "format-justify-fill"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
property int position: Latte.Types.Justify
}
}
}
//! END: Alignment
//! BEGIN: Visibility
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
LatteComponents.Header {
text: i18n("Visibility")
}
GridLayout {
width: parent.width
rowSpacing: 1
columnSpacing: 2
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
columns: 2
property int mode: latteView.visibility.mode
readonly property int buttonSize: (dialog.optionsWidth - (columnSpacing)) / 2
ExclusiveGroup {
id: visibilityGroup
onCurrentChanged: {
if (current.checked){
if (current !== windowsModeBtn.button){
latteView.visibility.mode = current.mode;
} else {
latteView.visibility.mode = windowsModeBtn.mode;
}
}
}
}
PlasmaComponents.Button {
id:alwaysVisibleBtn
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18n("Always Visible")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Types.AlwaysVisible
}
PlasmaComponents.Button {
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18n("Auto Hide")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Types.AutoHide
}
PlasmaComponents.Button {
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18n("Dodge Active")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Types.DodgeActive
}
PlasmaComponents.Button {
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18n("Dodge Maximized")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Types.DodgeMaximized
}
PlasmaComponents.Button {
id: dodgeAllWindowsBtn
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
text: i18n("Dodge All Windows")
checked: parent.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
property int mode: Latte.Types.DodgeAllWindows
}
LatteExtraControls.CustomWindowsModeButton {
id: windowsModeBtn
Layout.minimumWidth: parent.buttonSize
Layout.maximumWidth: Layout.minimumWidth
implicitWidth: dodgeAllWindowsBtn.implicitWidth
implicitHeight: dodgeAllWindowsBtn.implicitHeight
checked: parent.mode === mode
buttonExclusiveGroup: visibilityGroup
comboBoxMinimumPopUpWidth: windowsModeBtn.width
}
}
}
//! END: Visibility
//! BEGIN: Delay
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
enabled: !(latteView.visibility.mode === Latte.Types.AlwaysVisible
|| latteView.visibility.mode === Latte.Types.WindowsGoBelow
|| latteView.visibility.mode === Latte.Types.WindowsAlwaysCover)
LatteComponents.Header {
text: i18n("Delay")
}
Flow {
width: dialog.optionsWidth
Layout.minimumWidth: dialog.optionsWidth
Layout.maximumWidth: dialog.optionsWidth
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
Layout.topMargin: units.smallSpacing
spacing: 2
readonly property bool overlap: showContainer.overlap || hideContainer.overlap
Item {
id: showContainer
width: parent.overlap ? dialog.optionsWidth : oneLineWidth
height: childrenRect.height
implicitWidth: width
implicitHeight: height
readonly property bool overlap: oneLineWidth > dodgeAllWindowsBtn.width
readonly property int oneLineWidth: Math.max(dodgeAllWindowsBtn.width, showTimerRow.width)
RowLayout{
id: showTimerRow
anchors.horizontalCenter: parent.horizontalCenter
PlasmaComponents.Label {
Layout.leftMargin: Qt.application.layoutDirection === Qt.RightToLeft ? units.smallSpacing : 0
Layout.rightMargin: Qt.application.layoutDirection === Qt.RightToLeft ? 0 : units.smallSpacing
text: i18n("Show ")
}
LatteComponents.TextField {
Layout.preferredWidth: width
text: latteView.visibility.timerShow
onValueChanged: {
latteView.visibility.timerShow = value
}
}
}
}
Item {
id: hideContainer
width: parent.overlap ? dialog.optionsWidth : oneLineWidth
height: childrenRect.height
implicitWidth: width
implicitHeight: height
readonly property bool overlap: oneLineWidth > alwaysVisibleBtn.width
readonly property int oneLineWidth: Math.max(alwaysVisibleBtn.width, hideTimerRow.width)
RowLayout {
id: hideTimerRow
anchors.horizontalCenter: parent.horizontalCenter
PlasmaComponents.Label {
Layout.leftMargin: Qt.application.layoutDirection === Qt.RightToLeft ? units.smallSpacing : 0
Layout.rightMargin: Qt.application.layoutDirection === Qt.RightToLeft ? 0 : units.smallSpacing
text: i18n("Hide")
}
LatteComponents.TextField{
Layout.preferredWidth: width
text: latteView.visibility.timerHide
maxValue: 6000
onValueChanged: {
latteView.visibility.timerHide = value
}
}
}
}
}
}
//! END: Delay
//! BEGIN: Actions
ColumnLayout {
spacing: units.smallSpacing
visible: dialog.expertLevel
LatteComponents.Header {
text: i18n("Actions")
}
ColumnLayout {
id: actionsPropertiesColumn
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
spacing: 0
readonly property int maxLabelWidth: Math.max(trackActiveLbl.implicitWidth,
mouseWheelLbl.implicitWidth,
- leftBtnLbl.implicitWidth)
+ leftBtnLbl.implicitWidth,
+ midBtnLbl.implicitWidth)
LatteComponents.SubHeader {
text: i18n("Active Window")
}
ColumnLayout {
RowLayout {
Layout.topMargin: units.smallSpacing
PlasmaComponents.Label {
id: trackActiveLbl
Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth
Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth
text: i18n("Track From")
}
LatteComponents.ComboBox {
id: activeWindowFilterCmb
Layout.fillWidth: true
model: [i18nc("track from current screen", "Current Screen"),
i18nc("track from all screens", "All Screens")]
currentIndex: plasmoid.configuration.activeWindowFilter
onCurrentIndexChanged: {
switch(currentIndex) {
case Latte.Types.ActiveInCurrentScreen:
plasmoid.configuration.activeWindowFilter = Latte.Types.ActiveInCurrentScreen;
break;
case Latte.Types.ActiveFromAllScreens:
plasmoid.configuration.activeWindowFilter = Latte.Types.ActiveFromAllScreens;
break;
}
}
}
}
}
LatteComponents.SubHeader {
text: i18n("Empty Area")
}
ColumnLayout {
RowLayout {
PlasmaComponents.Label {
id: leftBtnLbl
Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth
Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth
text: i18n("Left Button")
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Drag Active Window")
checked: plasmoid.configuration.dragActiveWindowEnabled
checkable: true
tooltip: i18n("The user can use left mouse button to drag and maximized/restore last active window")
iconName: "transform-move"
onClicked: {
plasmoid.configuration.dragActiveWindowEnabled = !plasmoid.configuration.dragActiveWindowEnabled;
}
}
}
RowLayout {
- Layout.topMargin: units.smallSpacing
+ PlasmaComponents.Label {
+ id: midBtnLbl
+ Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth
+ Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth
+ text: i18n("Middle Button")
+ }
+
+ PlasmaComponents.Button {
+ Layout.fillWidth: true
+ text: i18n("Close Active Window")
+ checked: plasmoid.configuration.closeActiveWindowEnabled
+ checkable: true
+ tooltip: i18n("The user can use middle mouse button to close last active window")
+ iconName: "window-close"
+
+ onClicked: {
+ plasmoid.configuration.closeActiveWindowEnabled = !plasmoid.configuration.closeActiveWindowEnabled;
+ }
+ }
+ }
+
+ RowLayout {
+ // Layout.topMargin: units.smallSpacing
PlasmaComponents.Label {
id: mouseWheelLbl
Layout.minimumWidth: actionsPropertiesColumn.maxLabelWidth
Layout.maximumWidth: actionsPropertiesColumn.maxLabelWidth
text: i18n("Mouse wheel")
}
LatteComponents.ComboBox {
id: scrollAction
Layout.fillWidth: true
model: [i18nc("none scroll actions", "None Action"),
i18n("Cycle Through Desktops"),
i18n("Cycle Through Activities"),
i18n("Cycle Through Tasks")]
currentIndex: plasmoid.configuration.scrollAction
onCurrentIndexChanged: {
switch(currentIndex) {
case Latte.Types.ScrollNone:
plasmoid.configuration.scrollAction = Latte.Types.ScrollNone;
break;
case Latte.Types.ScrollDesktops:
plasmoid.configuration.scrollAction = Latte.Types.ScrollDesktops;
break;
case Latte.Types.ScrollActivities:
plasmoid.configuration.scrollAction = Latte.Types.ScrollActivities;
break;
case Latte.Types.ScrollTasks:
plasmoid.configuration.scrollAction = Latte.Types.ScrollTasks;
break;
}
}
}
}
}
LatteComponents.SubHeader {
text: i18n("Items")
}
LatteComponents.CheckBoxesColumn {
LatteComponents.CheckBox {
id: titleTooltipsChk
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Show title tooltips on hovering")
tooltip: i18n("Show thinner tooltips produced by Latte for items.\nThese tooltips are not drawn when applets zoom effect is disabled");
checked: plasmoid.configuration.titleTooltips
//enabled: plasmoid.configuration.zoomLevel > 0
onClicked: {
plasmoid.configuration.titleTooltips = !plasmoid.configuration.titleTooltips;
}
}
LatteComponents.CheckBox {
id: mouseWheelChk
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Activate through mouse wheel")
checked: plasmoid.configuration.mouseWheelActions
tooltip: i18n("Enable/Disable the mouse wheel action")
visible: dialog.highLevel
onClicked: {
plasmoid.configuration.mouseWheelActions = checked
}
}
LatteComponents.CheckBox {
Layout.maximumWidth: dialog.optionsWidth
// Layout.maximumHeight: mouseWheelChk.height
text: i18n("➊ Activate based on position through global shortcuts")
checked: latteView.isPreferredForShortcuts || (!latteView.layout.preferredForShortcutsTouched && latteView.isHighestPriorityView())
tooltip: i18n("This view is used for based on position global shortcuts. Take note that only one view can have that option enabled for each layout")
onClicked: {
latteView.isPreferredForShortcuts = checked
if (!latteView.layout.preferredForShortcutsTouched) {
latteView.layout.preferredForShortcutsTouched = true
}
}
}
}
}
LatteComponents.SubHeader {
id: floatingSubCategory
text: i18n("Floating")
enabled: !plasmoid.configuration.shrinkThickMargins && (plasmoid.configuration.screenEdgeMargin >= 0)
}
LatteComponents.CheckBoxesColumn {
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
enabled: floatingSubCategory.enabled
LatteComponents.CheckBoxesColumn {
LatteComponents.CheckBox {
id: fittsLawChk
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Always use screen gap for user interaction")
checked: plasmoid.configuration.fittsLawIsRequested
tooltip: i18n("Panels in floating mode use the screen gap for user interaction")
onClicked: {
plasmoid.configuration.fittsLawIsRequested = checked;
}
}
LatteComponents.CheckBox {
id: hideScreenGapForMaximizedChk
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Hide screen gap for maximized windows")
checked: plasmoid.configuration.hideScreenGapForMaximized
tooltip: i18n("Panels in floating mode disable their screen gap for maximized windows")
onClicked: {
plasmoid.configuration.hideScreenGapForMaximized = checked;
}
}
}
}
}
//! END: Actions
//! BEGIN: Adjust
ColumnLayout {
spacing: units.smallSpacing
visible: dialog.expertLevel
enabled: !(latteView.visibility.mode === Latte.Types.AlwaysVisible
|| latteView.visibility.mode === Latte.Types.WindowsGoBelow
|| latteView.visibility.mode === Latte.Types.WindowsCanCover
|| latteView.visibility.mode === Latte.Types.WindowsAlwaysCover)
LatteComponents.Header {
text: i18n("Environment")
}
LatteComponents.CheckBoxesColumn {
Layout.leftMargin: units.smallSpacing * 2
Layout.rightMargin: units.smallSpacing * 2
LatteComponents.CheckBox {
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Activate KWin edge after hiding")
checked: latteView.visibility.enableKWinEdges
tooltip: i18n("After the view becomes hidden, KWin is informed to track user feedback. For example an edge visual hint is shown whenever the mouse approaches the hidden view")
enabled: !latteView.byPassWM
onClicked: {
latteView.visibility.enableKWinEdges = checked;
}
}
LatteComponents.CheckBox {
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Can be above fullscreen windows")
checked: latteView.byPassWM
tooltip: i18n("BypassWindowManagerHint flag for the window. The view will be above all windows even those set as 'Always On Top'")
onCheckedChanged: {
latteView.byPassWM = checked;
}
}
LatteComponents.CheckBox {
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Raise on desktop change")
checked: latteView.visibility.raiseOnDesktop
onClicked: {
latteView.visibility.raiseOnDesktop = checked
}
}
LatteComponents.CheckBox {
Layout.maximumWidth: dialog.optionsWidth
text: i18n("Raise on activity change")
checked: latteView.visibility.raiseOnActivity
onClicked: {
latteView.visibility.raiseOnActivity = checked
}
}
}
}
//! END: Adjust
}
}