From 54a9e7ed1784ed1675287cd5ca730a69c3d75543 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 22 Feb 2019 19:41:01 +0200 Subject: [PATCH] reposition tasks indicatots to a better place --- .../package/contents/ui/task/IconItem.qml | 5 +- .../package/contents/ui/task/TaskItem.qml | 169 +++++++++--------- 2 files changed, 90 insertions(+), 84 deletions(-) diff --git a/plasmoid/package/contents/ui/task/IconItem.qml b/plasmoid/package/contents/ui/task/IconItem.qml index 071cc96f6..8648d09c3 100644 --- a/plasmoid/package/contents/ui/task/IconItem.qml +++ b/plasmoid/package/contents/ui/task/IconItem.qml @@ -148,7 +148,7 @@ Item{ Latte.IconItem{ id: iconImageBuffer - anchors.rightMargin:{ + /* anchors.rightMargin:{ if (root.position === PlasmaCore.Types.RightPositioned) return root.thickMargin; else if (root.position === PlasmaCore.Types.LeftPositioned) @@ -179,7 +179,8 @@ Item{ return wrapper.mScale * root.thickMargin; else return 0; - } + }*/ + anchors.centerIn: parent width: Math.round(newTempSize) //+ 2*taskIcon.shadowSize height: Math.round(width) diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index cd557c942..d403f5104 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -423,87 +423,6 @@ MouseArea{ border.color: "blue" } */ - Loader { - id: indicatorLoader - anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined - anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined - anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined - anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined - - anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined - anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined - - width: !root.vertical ? wrapper.width - 2*wrapper.mScale*root.lengthExtMargin : wrapper.width - height: root.vertical ? wrapper.height - 2*wrapper.mScale*root.lengthExtMargin : wrapper.height - - active: root.activeIndicator !== Latte.Types.NoneIndicator - - /* Indicators Properties in order use them*/ - readonly property bool isTask: true - readonly property bool isApplet: false - - readonly property alias isLauncher: taskItem.isLauncher - readonly property alias isStartup: taskItem.isStartup - readonly property alias isWindow: taskItem.isWindow - - readonly property bool isActive: taskItem.hasActive || (root.showPreviews && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === taskItem)) - readonly property alias isGroup: taskItem.isGroupParent - readonly property alias isMinimized: taskItem.isMinimized - readonly property alias inAttention: taskItem.inAttention - - readonly property alias hasActive: taskItem.hasActive - readonly property alias hasMinimized: taskItem.hasMinimized - readonly property alias hasShown: taskItem.hasShown - - readonly property int iconSize: root.iconSize - readonly property int durationTime: root.durationTime - readonly property real scaleFactor: wrapper.mScale - readonly property color shadowColor: root.appShadowColorSolid - - readonly property bool dotsOnActive: root.dotsOnActive - readonly property bool multiColorEnabled: root.threeColorsWindows - readonly property bool reversedEnabled: root.reverseLinesPosition - readonly property int activeIndicatorType: root.activeIndicatorType - - //!glow options - readonly property bool glowEnabled: root.showGlow - readonly property int glowOption: root.glowOption - readonly property real glowOpacity: root.glowOpacity - readonly property bool glow3D: root.glow3D - - //!icon colors - property color backgroundColor: wrapper.backgroundColor - property color glowColor: wrapper.glowColor - - sourceComponent: { - switch (root.indicatorStyle) { - case Latte.Types.LatteIndicator: - return latteIndicatorComponent; - case Latte.Types.PlasmaIndicator: - return plasmaIndicatorComponent; - case Latte.Types.UnityIndicator: - return unityIndicatorComponent; - default: - return latteIndicatorComponent; - }; - } - - Component{ - id:latteIndicatorComponent - Latte.LatteIndicator{} - } - - Component{ - id: plasmaIndicatorComponent - Latte.PlasmaIndicator{} - } - - Component{ - id:unityIndicatorComponent - Latte.UnityIndicator{} - } - } - Flow{ id: taskFlow width: parent.width @@ -513,7 +432,93 @@ MouseArea{ // IMPORTANT: hidden spacers must be tested on vertical !!! HiddenSpacer{ id:hiddenSpacerLeft;} - Wrapper{ id: wrapper } + Item{ + width: wrapper.width + height: wrapper.height + + Loader { + id: indicatorLoader + anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined + anchors.top: (root.position === PlasmaCore.Types.TopPositioned) ? parent.top : undefined + anchors.left: (root.position === PlasmaCore.Types.LeftPositioned) ? parent.left : undefined + anchors.right: (root.position === PlasmaCore.Types.RightPositioned) ? parent.right : undefined + + anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined + anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined + + width: !root.vertical ? wrapper.width - 2*wrapper.mScale*root.lengthExtMargin : wrapper.width + height: root.vertical ? wrapper.height - 2*wrapper.mScale*root.lengthExtMargin : wrapper.height + + active: root.activeIndicator !== Latte.Types.NoneIndicator + + /* Indicators Properties in order use them*/ + readonly property bool isTask: true + readonly property bool isApplet: false + + readonly property alias isLauncher: taskItem.isLauncher + readonly property alias isStartup: taskItem.isStartup + readonly property alias isWindow: taskItem.isWindow + + readonly property bool isActive: taskItem.hasActive || (root.showPreviews && windowsPreviewDlg.activeItem && (windowsPreviewDlg.activeItem === taskItem)) + readonly property alias isGroup: taskItem.isGroupParent + readonly property alias isMinimized: taskItem.isMinimized + readonly property alias inAttention: taskItem.inAttention + + readonly property alias hasActive: taskItem.hasActive + readonly property alias hasMinimized: taskItem.hasMinimized + readonly property alias hasShown: taskItem.hasShown + + readonly property int iconSize: root.iconSize + readonly property int durationTime: root.durationTime + readonly property real scaleFactor: wrapper.mScale + readonly property color shadowColor: root.appShadowColorSolid + + readonly property bool dotsOnActive: root.dotsOnActive + readonly property bool multiColorEnabled: root.threeColorsWindows + readonly property bool reversedEnabled: root.reverseLinesPosition + readonly property int activeIndicatorType: root.activeIndicatorType + + //!glow options + readonly property bool glowEnabled: root.showGlow + readonly property int glowOption: root.glowOption + readonly property real glowOpacity: root.glowOpacity + readonly property bool glow3D: root.glow3D + + //!icon colors + property color backgroundColor: wrapper.backgroundColor + property color glowColor: wrapper.glowColor + + sourceComponent: { + switch (root.indicatorStyle) { + case Latte.Types.LatteIndicator: + return latteIndicatorComponent; + case Latte.Types.PlasmaIndicator: + return plasmaIndicatorComponent; + case Latte.Types.UnityIndicator: + return unityIndicatorComponent; + default: + return latteIndicatorComponent; + }; + } + + Component{ + id:latteIndicatorComponent + Latte.LatteIndicator{} + } + + Component{ + id: plasmaIndicatorComponent + Latte.PlasmaIndicator{} + } + + Component{ + id:unityIndicatorComponent + Latte.UnityIndicator{} + } + } + + Wrapper{id: wrapper} + } // a hidden spacer on the right for the last item to add stability HiddenSpacer{ id:hiddenSpacerRight; rightSpacer: true }