enable Plasma Indicator Style

CCBUG: 404122
pull/4/head
Michail Vourlakos 6 years ago
parent 87e6d23b7c
commit 2884f73507

@ -32,6 +32,7 @@ import org.kde.latte 0.2 as Latte
import "colorizer" as Colorizer
import "communicator" as Communicator
import "indicators" as Indicators
Item {
id: appletItem
@ -533,9 +534,22 @@ Item {
|| (root.activeIndicator === Latte.Types.InternalsIndicator && communicator.overlayLatteIconIsActive))
&& communicator.activeIndicatorEnabled
sourceComponent: Item{
sourceComponent: root.indicatorStyle===Latte.Types.PlasmaIndicator ? plasmaStyleIndicator : latteStyleIndicator
Component {
id: latteStyleIndicator
Item{
anchors.fill: parent
Indicators.LatteIndicator{}
}
}
Component {
id: plasmaStyleIndicator
Item{
anchors.fill: parent
ActiveIndicator{}
Indicators.PlasmaIndicator {}
}
}
}

@ -0,0 +1,74 @@
/*
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.latte 0.2 as Latte
PlasmaCore.FrameSvgItem {
id: frame
anchors.fill: parent
imagePath: "widgets/tasks"
property bool isActive: (appletItem.isExpanded
&& communicator.overlayLatteIconIsActive
&& !appletItem.isSystray
&& applet.pluginName !== root.plasmoidName
&& applet.pluginName !== "org.kde.activeWindowControl"
&& applet.pluginName !== "org.kde.plasma.appmenu")
property string basePrefix: ""
prefix: taskPrefix(basePrefix)
function taskPrefix(prefix) {
var effectivePrefix;
switch (plasmoid.location) {
case PlasmaCore.Types.LeftEdge:
effectivePrefix = "west-" + prefix;
break;
case PlasmaCore.Types.TopEdge:
effectivePrefix = "north-" + prefix;
break;
case PlasmaCore.Types.RightEdge:
effectivePrefix = "east-" + prefix;
break;
default:
effectivePrefix = "south-" + prefix;
}
return [effectivePrefix, prefix];
}
states: [
State {
name: "active"
when: frame.isActive
PropertyChanges {
target: frame
basePrefix: "focus"
}
}
]
}

@ -161,8 +161,6 @@ DragDrop.DropArea {
property alias hoveredIndex: layoutsContainer.hoveredIndex
property alias directRenderDelayerIsRunning: directRenderDelayerForEnteringTimer.running
property int activeIndicator: plasmoid.configuration.activeIndicator
property int actionsBlockHiding: 0 //actions that block hiding
property int animationsNeedBothAxis:0 //animations need space in both axes, e.g zooming a task
@ -335,7 +333,8 @@ DragDrop.DropArea {
//! for that value between 0.04 - 0.5 of iconSize, this way 100% iconMargin means
//! equal to the iconSize
property int iconMargin: Math.ceil( ((0.5 * (plasmoid.configuration.iconMargin))/100) * iconSize)
property int statesLineSize: activeIndicator === Latte.Types.NoneIndicator ? 0 : Math.ceil( root.iconSize/13 )
property int statesLineSize: activeIndicator === Latte.Types.NoneIndicator || indicatorStyle !== Latte.Types.LatteIndicator ?
0 : Math.ceil( root.iconSize/13 )
///FIXME: <delete both> 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)
@ -402,7 +401,10 @@ DragDrop.DropArea {
readonly property bool hasInternalSeparator: latteApplet ? latteApplet.hasInternalSeparator : false
property int activeIndicator: plasmoid.configuration.activeIndicator
property int indicatorStyle: plasmoid.configuration.indicatorStyle
property int activeIndicatorType: plasmoid.configuration.activeIndicatorType
property int animationStep: {
if (!universalSettings || universalSettings.mouseSensitivity === Latte.Types.HighSensitivity) {
return 1;

@ -176,6 +176,7 @@ Item {
property alias windowPreviewIsShown: windowsPreviewDlg.visible
property int activeIndicator: latteView ? latteView.activeIndicator : Latte.Types.AllIndicator
property int indicatorStyle: latteView ? latteView.indicatorStyle : Latte.Types.LatteIndicator
property int activeIndicatorType: latteView ? latteView.activeIndicatorType : Latte.Types.LineIndicator
property int animationStep: latteView ? latteView.animationStep : 1
property int directRenderAnimationTime: latteView ? latteView.directRenderAnimationTime : 0

@ -31,7 +31,7 @@ import org.kde.kquickcontrolsaddons 2.0 as KQuickControlAddons
import org.kde.latte 0.2 as Latte
import "animations" as TaskAnimations
import "indicators" as Indicators
//I am using KQuickControlAddons.QIconItem even though onExit it triggers the following error
//QObject::~QObject: Timers cannot be stopped from another thread
@ -108,6 +108,12 @@ Item{
onTempColorChanged: tempColor.a = 0.35;
}
Loader {
anchors.fill: parent
active: root.activeIndicator !== Latte.Types.NoneIndicator && root.indicatorStyle === Latte.Types.PlasmaIndicator
sourceComponent: Indicators.PlasmaIndicator{}
}
TitleTooltipParent{
id: titleTooltipParent
thickness: (root.zoomFactor * root.realSize) + root.statesLineSize

@ -152,6 +152,7 @@ Item{
|| (((root.position === PlasmaCore.Types.BottomPositioned) || (root.position === PlasmaCore.Types.RightPositioned))
&& root.reverseLinesPosition) )
&& !root.disableAllWindowsFunctionality
&& root.indicatorStyle === Latte.Types.LatteIndicator
&& root.activeIndicator !== Latte.Types.NoneIndicator
visible: active
@ -220,7 +221,9 @@ Item{
id: secondIndicator
active: !firstIndicator.active
&& !root.disableAllWindowsFunctionality
&& root.indicatorStyle === Latte.Types.LatteIndicator
&& root.activeIndicator !== Latte.Types.NoneIndicator
visible: active
sourceComponent: Component{

@ -0,0 +1,93 @@
/*
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.latte 0.2 as Latte
PlasmaCore.FrameSvgItem {
id: frame
anchors.fill: parent
imagePath: "widgets/tasks"
property string basePrefix: "normal"
prefix: taskPrefix(basePrefix)
function taskPrefix(prefix) {
var effectivePrefix;
switch (plasmoid.location) {
case PlasmaCore.Types.LeftEdge:
effectivePrefix = "west-" + prefix;
break;
case PlasmaCore.Types.TopEdge:
effectivePrefix = "north-" + prefix;
break;
case PlasmaCore.Types.RightEdge:
effectivePrefix = "east-" + prefix;
break;
default:
effectivePrefix = "south-" + prefix;
}
return [effectivePrefix, prefix];
}
states: [
State {
name: "launcher"
when: taskItem.isLauncher
PropertyChanges {
target: frame
basePrefix: ""
}
},
State {
name: "attention"
when: taskItem.isDemandingAttention
PropertyChanges {
target: frame
basePrefix: "attention"
}
},
State {
name: "minimized"
when: taskItem.isMinimized
PropertyChanges {
target: frame
basePrefix: "minimized"
}
},
State {
name: "active"
when: taskItem.isActive
PropertyChanges {
target: frame
basePrefix: "focus"
}
}
]
}
Loading…
Cancel
Save