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
work/m_layershell
Michail Vourlakos 3 years ago
parent 04929b0138
commit ea500a8ec0

@ -94,6 +94,7 @@ Item {
&& ((applet && applet.status === PlasmaCore.Types.HiddenStatus ) || isInternalViewSplitter) && ((applet && applet.status === PlasmaCore.Types.HiddenStatus ) || isInternalViewSplitter)
property bool isInternalViewSplitter: (internalSplitterId > 0) property bool isInternalViewSplitter: (internalSplitterId > 0)
property bool isZoomed: false property bool isZoomed: false
property bool isPressed: viewSignalsConnector.pressed
property bool isSeparator: applet && (applet.pluginName === "audoban.applet.separator" property bool isSeparator: applet && (applet.pluginName === "audoban.applet.separator"
|| applet.pluginName === "org.kde.latte.separator") || applet.pluginName === "org.kde.latte.separator")
property bool isSpacer: applet && (applet.pluginName === "org.kde.latte.spacer") property bool isSpacer: applet && (applet.pluginName === "org.kde.latte.spacer")
@ -678,10 +679,10 @@ Item {
target: root.latteView ? root.latteView.extendedInterface : null target: root.latteView ? root.latteView.extendedInterface : null
enabled: !appletItem.indexerIsSupported && !appletItem.isSeparator && !appletItem.isSpacer && !appletItem.isHidden enabled: !appletItem.indexerIsSupported && !appletItem.isSeparator && !appletItem.isSpacer && !appletItem.isHidden
onExpandedAppletStateChanged: { onHasExpandedAppletChanged: {
if (latteView.extendedInterface.hasExpandedApplet && appletItem.applet) { if (latteView.extendedInterface.hasExpandedApplet && appletItem.applet) {
appletItem.isExpanded = latteView.extendedInterface.appletIsExpandable(appletItem.applet.id) appletItem.isExpanded = latteView.extendedInterface.appletIsExpandable(appletItem.applet.id)
&& latteView.extendedInterface.appletIsExpanded(appletItem.applet.id); && latteView.extendedInterface.appletIsExpanded(appletItem.applet.id);
} else { } else {
appletItem.isExpanded = false; appletItem.isExpanded = false;
} }
@ -727,9 +728,10 @@ Item {
isActive: appletItem.isActive isActive: appletItem.isActive
isHovered: appletItem.containsMouse isHovered: appletItem.containsMouse
isPressed: appletItem.isPressed
isSquare: appletItem.isSquare isSquare: appletItem.isSquare
hasActive: isActive hasActive: appletItem.isActive
scaleFactor: appletItem.wrapper.zoomScale scaleFactor: appletItem.wrapper.zoomScale
panelOpacity: root.background.currentOpacity panelOpacity: root.background.currentOpacity

@ -26,10 +26,10 @@ PlasmaCore.ToolTipArea {
textFormat: plasmoid.toolTipTextFormat textFormat: plasmoid.toolTipTextFormat
mainItem: plasmoid.toolTipItem ? plasmoid.toolTipItem : null mainItem: plasmoid.toolTipItem ? plasmoid.toolTipItem : null
property Item fullRepresentation property Item fullRepresentation: null
property Item compactRepresentation property Item compactRepresentation: null
/*Discover real visual parent - the following code points to Applet::ItemWrapper*/ /*Discover real visual parent - the following code points to Applet::ItemWrapper*/
property Item originalCompactRepresenationParent property Item originalCompactRepresenationParent: null
property Item compactRepresentationVisualParent: originalCompactRepresenationParent && originalCompactRepresenationParent.parent property Item compactRepresentationVisualParent: originalCompactRepresenationParent && originalCompactRepresenationParent.parent
? originalCompactRepresenationParent.parent.parent : null ? originalCompactRepresenationParent.parent.parent : null
@ -42,7 +42,15 @@ PlasmaCore.ToolTipArea {
originalCompactRepresenationParent = compactRepresentation.parent; originalCompactRepresenationParent = compactRepresentation.parent;
compactRepresentation.parent = root; 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; compactRepresentation.visible = true;
} }
root.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 //// ////Clicked Effect ////
BrightnessContrast { BrightnessContrast {
id: _clickedEffect id: _clickedEffect
anchors.fill: parent anchors.centerIn: parent
anchors.horizontalCenterOffset: compactRepresentation ? compactRepresentation.anchors.horizontalCenterOffset : 0
anchors.verticalCenterOffset: compactRepresentation ? compactRepresentation.anchors.verticalCenterOffset : 0
source: compactRepresentation source: compactRepresentation
width: root.width
height: root.height
visible: appletItem && clickedAnimation.running && !appletItem.indicators.info.providesClickedAnimation visible: appletItem && clickedAnimation.running && !appletItem.indicators.info.providesClickedAnimation
z:1000 z:1000
} }

Loading…
Cancel
Save