From d641ec0b334ffead5ed140cd9128646c1906e758 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sat, 14 Jan 2017 01:59:25 +0200 Subject: [PATCH] fix #54,dock is shown when applet needs attention --- app/dockview.cpp | 17 +++++++++++++++++ app/dockview.h | 1 + plasmoid/contents/ui/TaskIconItem.qml | 15 ++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/app/dockview.cpp b/app/dockview.cpp index ba509a5b5..b41c8d5f9 100644 --- a/app/dockview.cpp +++ b/app/dockview.cpp @@ -83,6 +83,8 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen) QAction *addWidgetsAction = containment()->actions()->action("add widgets"); addWidgetsAction->setVisible(false); //containment()->actions()->removeAction(addWidgetsAction); + + connect(containment(), SIGNAL(statusChanged(Plasma::Types::ItemStatus)), SLOT(statusChanged(Plasma::Types::ItemStatus))); }, Qt::DirectConnection); @@ -322,6 +324,21 @@ inline void DockView::syncGeometry() qDebug() << "dock geometry:" << qRectToStr(geometry()); } +void DockView::statusChanged(Plasma::Types::ItemStatus status) +{ + if ((status == Plasma::Types::NeedsAttentionStatus) || + (status == Plasma::Types::RequiresAttentionStatus)) { + m_visibility->setBlockHiding(true); + } else { + m_visibility->setBlockHiding(false); + } + + /*} else if (status == Plasma::Types::AcceptingInputStatus) { + KWindowSystem::forceActiveWindow(winId());*/ + +} + + int DockView::currentThickness() const { if (formFactor() == Plasma::Types::Vertical) { diff --git a/app/dockview.h b/app/dockview.h index 81b7cfb2e..fd23c2e17 100644 --- a/app/dockview.h +++ b/app/dockview.h @@ -135,6 +135,7 @@ signals: private slots: void menuAboutToHide(); + void statusChanged(Plasma::Types::ItemStatus); private: void initWindow(); diff --git a/plasmoid/contents/ui/TaskIconItem.qml b/plasmoid/contents/ui/TaskIconItem.qml index d0b0e4911..5f29b284d 100644 --- a/plasmoid/contents/ui/TaskIconItem.qml +++ b/plasmoid/contents/ui/TaskIconItem.qml @@ -24,6 +24,7 @@ import QtGraphicalEffects 1.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents +import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.private.taskmanager 0.1 as TaskManagerApplet import org.kde.kquickcontrolsaddons 2.0 as KQuickControlAddons @@ -529,11 +530,23 @@ Item{ ////////////////// new window and needs attention animation + //stop the bouncing animation for attention needed when the plasmoid + //does not need any more attention + Connections{ + target: plasmoid + onStatusChanged:{ + if ( (plasmoid.status === PlasmaCore.Types.PassiveStatus) + && newWindowAnimation.running && (newWindowAnimation.loops > 2) ) { + newWindowAnimation.clear(); + } + } + } + SequentialAnimation{ id:newWindowAnimation property int speed: root.durationTime*units.longDuration - property bool isDemandingAttention: (IsDemandingAttention === true) ? true : false + property bool isDemandingAttention: (IsDemandingAttention === true) property bool entered: mainItemContainer.mouseEntered property bool needsThicknessSent: false //flag to check if the signal for thickness was sent