1 Description: Fix the indicator icon sometimes turning green when clicking on it.
2 Author: Felix Geyer <debfx-pkg@fobos.de>
3 Bug: https://bugs.launchpad.net/bugs/755537
5 --- plasma-widget-message-indicator-0.5.7.orig/src/message-indicator.h
6 +++ plasma-widget-message-indicator-0.5.7/src/message-indicator.h
7 @@ -61,6 +61,7 @@ private:
9 QLabel* mNoIndicatorLabel;
10 QWidget* mCurrentWidget;
11 + Plasma::ItemStatus m_status;
14 void initSourceModel();
15 --- plasma-widget-message-indicator-0.5.7.orig/src/message-indicator.cpp
16 +++ plasma-widget-message-indicator-0.5.7/src/message-indicator.cpp
17 @@ -45,6 +45,7 @@ MessageIndicator::MessageIndicator(QObje
18 , mView(new ExpandedTreeView(mStack))
19 , mSvg(new Plasma::Svg(this))
20 , mNoIndicatorLabel(new QLabel(mStack))
21 +, m_status(Plasma::UnknownStatus)
23 setBackgroundHints(StandardBackground);
24 setAspectRatioMode(Plasma::ConstrainedSquare);
25 @@ -191,7 +192,7 @@ void MessageIndicator::toolTipAboutToSho
26 QSizeF oldSize = mSvg->size();
27 // FIXME: Hardcoded size
29 - QString element = status() == Plasma::NeedsAttentionStatus ? NEW_STUFF_ICON : NO_NEW_STUFF_ICON;
30 + QString element = m_status == Plasma::NeedsAttentionStatus ? NEW_STUFF_ICON : NO_NEW_STUFF_ICON;
31 QPixmap pix = mSvg->pixmap(element);
32 mSvg->resize(oldSize);
33 toolTip.setImage(pix);
34 @@ -237,7 +238,7 @@ void MessageIndicator::paintInterface(QP
35 int minSize = qMin(contentsRect.height(), contentsRect.width());
36 QRect contentsSquare = QRect(contentsRect.x() + (contentsRect.width() - minSize) / 2, contentsRect.y() + (contentsRect.height() - minSize) / 2, minSize, minSize);
38 - QString element = status() == Plasma::NeedsAttentionStatus ? NEW_STUFF_ICON : NO_NEW_STUFF_ICON;
39 + QString element = m_status == Plasma::NeedsAttentionStatus ? NEW_STUFF_ICON : NO_NEW_STUFF_ICON;
40 mSvg->paint(painter, contentsSquare, element);
43 @@ -274,7 +275,6 @@ void MessageIndicator::slotDrawAttention
45 void MessageIndicator::updateStatus()
47 - Plasma::ItemStatus status;
48 if (mSourceModel && mSourceModel->rowCount() > 0) {
49 // Check if one of the indicators want to draw attention
50 QModelIndexList lst = mSourceModel->match(mSourceModel->index(0, 0),
51 @@ -282,18 +282,18 @@ void MessageIndicator::updateStatus()
54 Qt::MatchExactly | Qt::MatchRecursive);
55 - status = lst.isEmpty() ? Plasma::ActiveStatus : Plasma::NeedsAttentionStatus;
56 + m_status = lst.isEmpty() ? Plasma::ActiveStatus : Plasma::NeedsAttentionStatus;
58 - status = Plasma::PassiveStatus;
59 + m_status = Plasma::PassiveStatus;
63 + setStatus(m_status);
69 - if (status == Plasma::PassiveStatus) {
70 + if (m_status == Plasma::PassiveStatus) {
72 mNoIndicatorLabel->show();
73 mCurrentWidget = mNoIndicatorLabel;