fix #54,dock is shown when applet needs attention

pull/1/head
Michail Vourlakos 8 years ago
parent e3aac94824
commit d641ec0b33

@ -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) {

@ -135,6 +135,7 @@ signals:
private slots:
void menuAboutToHide();
void statusChanged(Plasma::Types::ItemStatus);
private:
void initWindow();

@ -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

Loading…
Cancel
Save