provide visual indicator for multiple tasks

--when the user changes Tasks tab settings between
different applets, the selected applet is providing an
animation
work/spdx
Michail Vourlakos 4 years ago
parent 04b6909e66
commit 39ad54f9bb

@ -108,6 +108,8 @@ signals:
void latteTasksModelChanged();
void plasmaTasksModelChanged();
void appletRequestedVisualIndicator(const int &plasmoidId);
private slots:
void identifyShortcutsHost();
void identifyMethods();

@ -721,7 +721,10 @@ Item {
appletItem.isExpanded = false;
}
}
}
///END connections
//! It is used for any communication needed with the underlying applet

@ -617,6 +617,63 @@ Item{
visible: clickedAnimation.running && !indicators.info.providesClickedAnimation
}
Loader {
id: visualIndicator
anchors.fill: parent
active: showVisualIndicatorRequested
property bool showVisualIndicatorRequested: false
Connections {
target: root.latteView ? root.latteView.extendedInterface : null
onAppletRequestedVisualIndicator: {
if (plasmoidId === appletItem.applet.id) {
visualIndicator.showVisualIndicatorRequested = true;
}
}
}
sourceComponent: Rectangle {
id: visualIndicatorRectangle
color: theme.highlightColor
opacity: 0
radius: 4
Component.onCompleted: showVisualIndicatorAnimation.running = true;
SequentialAnimation{
id: showVisualIndicatorAnimation
alwaysRunToEnd: true
PropertyAnimation {
target: visualIndicatorRectangle
property: "opacity"
to: 0.6
duration: 3*appletItem.animations.duration.large
easing.type: Easing.OutQuad
}
PauseAnimation {
duration: 1500
}
PropertyAnimation {
target: visualIndicatorRectangle
property: "opacity"
to: 0
duration: 3*appletItem.animations.duration.large
easing.type: Easing.OutQuad
}
ScriptAction {
script: {
visualIndicator.showVisualIndicatorRequested = false;
}
}
}
}
}
/* onHeightChanged: {
if ((index == 1)|| (index==3)){
console.log("H: "+index+" ("+zoomScale+"). "+currentLayout.children[1].height+" - "+currentLayout.children[3].height+" - "+(currentLayout.children[1].height+currentLayout.children[3].height));

@ -32,11 +32,20 @@ import org.kde.latte.components 1.0 as LatteComponents
import org.kde.latte.private.tasks 0.1 as LatteTasks
PlasmaComponents.Page {
id: _tabsPage
Layout.maximumWidth: content.width + content.Layout.leftMargin * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
property bool disableAllWindowsFunctionality: tasks.configuration.hideAllTasks
readonly property bool isCurrentPage: (tabGroup.currentTab === _tabsPage)
onIsCurrentPageChanged: {
if (isCurrentPage && latteView.extendedInterface.latteTasksModel.count>1) {
latteView.extendedInterface.appletRequestedVisualIndicator(tasks.id);
}
}
ColumnLayout {
id: content

Loading…
Cancel
Save