mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-28 18:50:40 +03:00
indicators:expose iconOffsetX/Y to applets
--expose iconed applets indicator iconOffsetX/Y setting and this way animate applet icons if the indicator would like to do so
This commit is contained in:
parent
7129a54ea5
commit
fd0e3e7fcd
@ -94,6 +94,7 @@ Item {
|
||||
&& ((applet && applet.status === PlasmaCore.Types.HiddenStatus ) || isInternalViewSplitter)
|
||||
property bool isInternalViewSplitter: (internalSplitterId > 0)
|
||||
property bool isZoomed: false
|
||||
property bool isPressed: viewSignalsConnector.pressed
|
||||
property bool isSeparator: applet && (applet.pluginName === "audoban.applet.separator"
|
||||
|| applet.pluginName === "org.kde.latte.separator")
|
||||
property bool isSpacer: applet && (applet.pluginName === "org.kde.latte.spacer")
|
||||
@ -678,10 +679,10 @@ Item {
|
||||
target: root.latteView ? root.latteView.extendedInterface : null
|
||||
enabled: !appletItem.indexerIsSupported && !appletItem.isSeparator && !appletItem.isSpacer && !appletItem.isHidden
|
||||
|
||||
onExpandedAppletStateChanged: {
|
||||
onHasExpandedAppletChanged: {
|
||||
if (latteView.extendedInterface.hasExpandedApplet && appletItem.applet) {
|
||||
appletItem.isExpanded = latteView.extendedInterface.appletIsExpandable(appletItem.applet.id)
|
||||
&& latteView.extendedInterface.appletIsExpanded(appletItem.applet.id);
|
||||
&& latteView.extendedInterface.appletIsExpanded(appletItem.applet.id);
|
||||
} else {
|
||||
appletItem.isExpanded = false;
|
||||
}
|
||||
@ -727,9 +728,10 @@ Item {
|
||||
|
||||
isActive: appletItem.isActive
|
||||
isHovered: appletItem.containsMouse
|
||||
isPressed: appletItem.isPressed
|
||||
isSquare: appletItem.isSquare
|
||||
|
||||
hasActive: isActive
|
||||
hasActive: appletItem.isActive
|
||||
|
||||
scaleFactor: appletItem.wrapper.zoomScale
|
||||
panelOpacity: root.background.currentOpacity
|
||||
|
@ -26,10 +26,10 @@ PlasmaCore.ToolTipArea {
|
||||
textFormat: plasmoid.toolTipTextFormat
|
||||
mainItem: plasmoid.toolTipItem ? plasmoid.toolTipItem : null
|
||||
|
||||
property Item fullRepresentation
|
||||
property Item compactRepresentation
|
||||
property Item fullRepresentation: null
|
||||
property Item compactRepresentation: null
|
||||
/*Discover real visual parent - the following code points to Applet::ItemWrapper*/
|
||||
property Item originalCompactRepresenationParent
|
||||
property Item originalCompactRepresenationParent: null
|
||||
property Item compactRepresentationVisualParent: originalCompactRepresenationParent && originalCompactRepresenationParent.parent
|
||||
? originalCompactRepresenationParent.parent.parent : null
|
||||
|
||||
@ -42,7 +42,15 @@ PlasmaCore.ToolTipArea {
|
||||
originalCompactRepresenationParent = compactRepresentation.parent;
|
||||
|
||||
compactRepresentation.parent = root;
|
||||
compactRepresentation.anchors.fill = root;
|
||||
compactRepresentation.anchors.centerIn = root;
|
||||
compactRepresentation.width = Qt.binding(function() {
|
||||
return root.width;
|
||||
});
|
||||
|
||||
compactRepresentation.height = Qt.binding(function() {
|
||||
return root.height;
|
||||
});
|
||||
|
||||
compactRepresentation.visible = true;
|
||||
}
|
||||
root.visible = true;
|
||||
@ -203,11 +211,30 @@ PlasmaCore.ToolTipArea {
|
||||
}
|
||||
}
|
||||
|
||||
////Indicators API ////
|
||||
Binding {
|
||||
target: compactRepresentation ? compactRepresentation.anchors : null
|
||||
property: "horizontalCenterOffset"
|
||||
when: compactRepresentation
|
||||
value: appletItem ? appletItem.iconOffsetX : 0
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: compactRepresentation ? compactRepresentation.anchors : null
|
||||
property: "verticalCenterOffset"
|
||||
when: compactRepresentation
|
||||
value: appletItem ? appletItem.iconOffsetY : 0
|
||||
}
|
||||
|
||||
////Clicked Effect ////
|
||||
BrightnessContrast {
|
||||
id: _clickedEffect
|
||||
anchors.fill: parent
|
||||
anchors.centerIn: parent
|
||||
anchors.horizontalCenterOffset: compactRepresentation ? compactRepresentation.anchors.horizontalCenterOffset : 0
|
||||
anchors.verticalCenterOffset: compactRepresentation ? compactRepresentation.anchors.verticalCenterOffset : 0
|
||||
source: compactRepresentation
|
||||
width: root.width
|
||||
height: root.height
|
||||
visible: appletItem && clickedAnimation.running && !appletItem.indicators.info.providesClickedAnimation
|
||||
z:1000
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user