move Plasma/UnityIndicators into liblatte2
parent
529c6f0bab
commit
d9fe9d438d
@ -1,194 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016 Smith AR <audoban@openmailbox.org>
|
||||
* 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.plasmoid 2.0
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
|
||||
import org.kde.latte 0.2 as Latte
|
||||
|
||||
Item{
|
||||
id:indicatorRoot
|
||||
width: !root.isVertical ? parent.width : size
|
||||
height: root.isVertical ? parent.height : size
|
||||
|
||||
property int size: mimicPlasmaPanel ? 4 : 0.075*root.iconSize
|
||||
|
||||
property bool mimicPlasmaPanel: !root.latteApplet && plasmoid.configuration.panelSize===100 ?
|
||||
!plasmoid.configuration.reverseLinesPosition : false
|
||||
|
||||
/*Rectangle{
|
||||
anchors.fill: parent
|
||||
border.width: 1
|
||||
border.color: "yellow"
|
||||
color: "transparent"
|
||||
opacity:0.6
|
||||
}*/
|
||||
|
||||
Latte.GlowPoint{
|
||||
id:activePoint
|
||||
anchors.centerIn: parent
|
||||
|
||||
size: indicatorRoot.size
|
||||
basicColor: theme.buttonFocusColor
|
||||
roundCorners: true
|
||||
showGlow: root.showGlow
|
||||
glow3D: root.glow3D
|
||||
animation: Math.max(1.65*3*units.longDuration,root.durationTime*3*units.longDuration)
|
||||
location: plasmoid.location
|
||||
glowOpacity: root.glowOpacity
|
||||
contrastColor: root.appShadowColorSolid
|
||||
|
||||
opacity:{
|
||||
if ( (!vertical && width <= indicatorRoot.size && !appletItem.isActive)
|
||||
|| (vertical && height <= indicatorRoot.size && !appletItem.isActive))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
property bool vertical: root.isVertical
|
||||
|
||||
property int animationTime: root.durationTime * (1.2*units.longDuration)
|
||||
property int stateWidth: root.activeIndicatorType === Latte.Types.DotIndicator ? indicatorRoot.size : indicatorRoot.width
|
||||
property int stateHeight: root.activeIndicatorType === Latte.Types.DotIndicator ? indicatorRoot.size : indicatorRoot.height
|
||||
|
||||
property real scaleFactor: wrapper.zoomScale
|
||||
|
||||
function updateInitialSizes(){
|
||||
if(indicatorRoot){
|
||||
if(vertical)
|
||||
width = indicatorRoot.size;
|
||||
else
|
||||
height = indicatorRoot.size;
|
||||
|
||||
if(vertical && appletItem.isActive)
|
||||
height = stateHeight;
|
||||
else
|
||||
height = indicatorRoot.size;
|
||||
|
||||
if(!vertical && appletItem.isActive)
|
||||
width = stateWidth;
|
||||
else
|
||||
width = indicatorRoot.size;
|
||||
}
|
||||
}
|
||||
|
||||
Connections{
|
||||
target: appletItem
|
||||
onIsActiveChanged: activeAndReverseAnimation.start();
|
||||
}
|
||||
|
||||
onScaleFactorChanged: {
|
||||
if ( root.activeIndicatorType === Latte.Types.LineIndicator ) {
|
||||
if(!activeAndReverseAnimation.running && !root.vertical && appletItem.isActive){
|
||||
width = stateWidth;
|
||||
}
|
||||
else if (!activeAndReverseAnimation.running && root.vertical && appletItem.isActive){
|
||||
height = stateHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onStateWidthChanged:{
|
||||
if(!activeAndReverseAnimation.running && !vertical && appletItem.isActive && root.activeIndicatorType === Latte.Types.LineIndicator)
|
||||
width = stateWidth;
|
||||
}
|
||||
|
||||
onStateHeightChanged:{
|
||||
if(!activeAndReverseAnimation.running && vertical && appletItem.isActive && root.activeIndicatorType === Latte.Types.LineIndicator)
|
||||
height = stateHeight;
|
||||
}
|
||||
|
||||
onVerticalChanged: updateInitialSizes();
|
||||
|
||||
Component.onCompleted: {
|
||||
updateInitialSizes();
|
||||
|
||||
root.onIconSizeChanged.connect(updateInitialSizes);
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
root.onIconSizeChanged.disconnect(updateInitialSizes);
|
||||
}
|
||||
|
||||
NumberAnimation{
|
||||
id: activeAndReverseAnimation
|
||||
target: activePoint
|
||||
property: root.isVertical ? "height" : "width"
|
||||
to: !appletItem.isActive ? (root.isVertical ? activePoint.stateHeight : activePoint.stateWidth) : indicatorRoot.size
|
||||
duration: activePoint.animationTime
|
||||
easing.type: Easing.InQuad
|
||||
|
||||
onStopped: activePoint.updateInitialSizes()
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "left"
|
||||
when: ((plasmoid.location === PlasmaCore.Types.LeftEdge && !root.reverseLinesPosition) ||
|
||||
(plasmoid.location === PlasmaCore.Types.RightEdge && root.reverseLinesPosition))
|
||||
|
||||
AnchorChanges {
|
||||
target: indicatorRoot
|
||||
anchors{ verticalCenter:undefined; horizontalCenter:parent.horizontalCenter;
|
||||
top:undefined; bottom:undefined; left:parent.left; right:undefined;}
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "bottom"
|
||||
when: ((plasmoid.location === PlasmaCore.Types.BottomEdge && !root.reverseLinesPosition) ||
|
||||
(plasmoid.location === PlasmaCore.Types.TopEdge && root.reverseLinesPosition))
|
||||
|
||||
AnchorChanges {
|
||||
target: indicatorRoot
|
||||
anchors{ verticalCenter:undefined; horizontalCenter:parent.horizontalCenter;
|
||||
top:undefined; bottom:parent.bottom; left:undefined; right:undefined;}
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "top"
|
||||
when: ((plasmoid.location === PlasmaCore.Types.TopEdge && !root.reverseLinesPosition) ||
|
||||
(plasmoid.location === PlasmaCore.Types.BottomEdge && root.reverseLinesPosition))
|
||||
|
||||
AnchorChanges {
|
||||
target: indicatorRoot
|
||||
anchors{ verticalCenter:undefined; horizontalCenter:parent.horizontalCenter;
|
||||
top:parent.top; bottom:undefined; left:undefined; right:undefined;}
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "right"
|
||||
when: ((plasmoid.location === PlasmaCore.Types.RightEdge && !root.reverseLinesPosition) ||
|
||||
(plasmoid.location === PlasmaCore.Types.LeftEdge && root.reverseLinesPosition))
|
||||
|
||||
AnchorChanges {
|
||||
target: indicatorRoot
|
||||
anchors{ verticalCenter:undefined; horizontalCenter:parent.horizontalCenter;
|
||||
top:undefined; bottom:undefined; left:undefined; right:parent.right;}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* 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: expandedItem
|
||||
anchors.fill: parent
|
||||
imagePath: "widgets/tabbar"
|
||||
visible: opacity > 0
|
||||
prefix: {
|
||||
var prefix;
|
||||
switch (plasmoid.location) {
|
||||
case PlasmaCore.Types.LeftEdge:
|
||||
prefix = "west-active-tab";
|
||||
break;
|
||||
case PlasmaCore.Types.TopEdge:
|
||||
prefix = "north-active-tab";
|
||||
break;
|
||||
case PlasmaCore.Types.RightEdge:
|
||||
prefix = "east-active-tab";
|
||||
break;
|
||||
default:
|
||||
prefix = "south-active-tab";
|
||||
}
|
||||
if (!hasElementPrefix(prefix)) {
|
||||
prefix = "active-tab";
|
||||
}
|
||||
return prefix;
|
||||
}
|
||||
|
||||
opacity: isActive ? 1 : 0
|
||||
|
||||
property bool isActive: (appletItem.isExpanded
|
||||
&& communicator.overlayLatteIconIsActive
|
||||
&& !appletItem.isSystray
|
||||
&& applet.pluginName !== root.plasmoidName
|
||||
&& applet.pluginName !== "org.kde.activeWindowControl"
|
||||
&& applet.pluginName !== "org.kde.plasma.appmenu")
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: units.shortDuration
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
* 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 QtGraphicalEffects 1.0
|
||||
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
|
||||
import org.kde.latte 0.2 as Latte
|
||||
|
||||
Rectangle {
|
||||
id: unityRect
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 2
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width - 4
|
||||
height: parent.height - 4
|
||||
radius: 4
|
||||
//height: (root.iconSize + root.thickMargin)/6 - 4
|
||||
//radius: height/2
|
||||
color: backgroundColor
|
||||
clip: true
|
||||
|
||||
property color backgroundColor
|
||||
property color glowColor
|
||||
|
||||
RadialGradient{
|
||||
anchors.verticalCenter: parent.top
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: parent.width
|
||||
height: width
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: glowColor }
|
||||
GradientStop { position: 0.6; color: "transparent" }
|
||||
}
|
||||
}
|
||||
|
||||
visible: isActive
|
||||
}
|
Loading…
Reference in New Issue