11/* BEGIN_COMMON_COPYRIGHT_HEADER
22 * (c)LGPL2+
33 *
4- * LXQt - a lightweight, Qt based, desktop toolset
5- * https://lxqt.org
6- *
7- * Copyright: 2015 LXQt team
84 * Authors:
95 * Balázs Béla <balazsbela[at]gmail.com>
106 * Paulo Lieuthier <paulolieuthier@gmail.com>
@@ -54,9 +50,9 @@ namespace
5450
5551StatusNotifierButton::StatusNotifierButton (QString service, QString objectPath, QWidget *parent)
5652 : QToolButton(parent),
57- mMenu (nullptr ),
58- mStatus (Passive),
59- mFallbackIcon (QIcon::fromTheme(QLatin1String(" application-x-executable" )))
53+ m_menu (nullptr ),
54+ m_status (Passive),
55+ m_fallbackIcon (QIcon::fromTheme(QLatin1String(" application-x-executable" )))
6056{
6157 setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
6258 setAutoRaise (true );
@@ -70,8 +66,8 @@ StatusNotifierButton::StatusNotifierButton(QString service, QString objectPath,
7066
7167 interface->propertyGetAsync (QLatin1String (" Menu" ), [this ] (QDBusObjectPath path) {
7268 if (!path.path ().startsWith (" /NO_DBUSMENU" )) {
73- mMenu = (new MenuImporter{interface->service (), path.path (), this })->menu ();
74- mMenu ->setObjectName (QLatin1String (" StatusNotifierMenu" ));
69+ m_menu = (new MenuImporter{interface->service (), path.path (), this })->menu ();
70+ m_menu ->setObjectName (QLatin1String (" StatusNotifierMenu" ));
7571 }
7672 });
7773
@@ -168,13 +164,13 @@ void StatusNotifierButton::refetchIcon(Status status, const QString& themePath)
168164 switch (status)
169165 {
170166 case Active:
171- mOverlayIcon = nextIcon;
167+ m_overlayIcon = nextIcon;
172168 break ;
173169 case NeedsAttention:
174- mAttentionIcon = nextIcon;
170+ m_attentionIcon = nextIcon;
175171 break ;
176172 case Passive:
177- mIcon = nextIcon;
173+ m_icon = nextIcon;
178174 break ;
179175 }
180176
@@ -207,13 +203,13 @@ void StatusNotifierButton::refetchIcon(Status status, const QString& themePath)
207203 switch (status)
208204 {
209205 case Active:
210- mOverlayIcon = nextIcon;
206+ m_overlayIcon = nextIcon;
211207 break ;
212208 case NeedsAttention:
213- mAttentionIcon = nextIcon;
209+ m_attentionIcon = nextIcon;
214210 break ;
215211 case Passive:
216- mIcon = nextIcon;
212+ m_icon = nextIcon;
217213 break ;
218214 }
219215
@@ -248,10 +244,10 @@ void StatusNotifierButton::newStatus(QString status)
248244 else
249245 newStatus = NeedsAttention;
250246
251- if (mStatus == newStatus)
247+ if (m_status == newStatus)
252248 return ;
253249
254- mStatus = newStatus;
250+ m_status = newStatus;
255251 resetIcon ();
256252}
257253
@@ -268,8 +264,8 @@ void StatusNotifierButton::mouseReleaseEvent(QMouseEvent *event)
268264 else if (event->button () == Qt::MidButton)
269265 interface->SecondaryActivate (QCursor::pos ().x (), QCursor::pos ().y ());
270266 else if (Qt::RightButton == event->button ()) {
271- if (mMenu ) {
272- mMenu ->popup (mapToGlobal (QPoint (0 , 0 )));
267+ if (m_menu ) {
268+ m_menu ->popup (mapToGlobal (QPoint (0 , 0 )));
273269 } else
274270 interface->ContextMenu (QCursor::pos ().x (), QCursor::pos ().y ());
275271 }
@@ -286,16 +282,16 @@ void StatusNotifierButton::resetIcon()
286282{
287283 setIconSize (QSize (30 , 30 ));
288284
289- if (mStatus == Active && !mOverlayIcon .isNull ())
290- setIcon (mOverlayIcon );
291- else if (mStatus == NeedsAttention && !mAttentionIcon .isNull ())
292- setIcon (mAttentionIcon );
293- else if (!mIcon .isNull ()) // mStatus == Passive
294- setIcon (mIcon );
295- else if (!mOverlayIcon .isNull ())
296- setIcon (mOverlayIcon );
297- else if (!mAttentionIcon .isNull ())
298- setIcon (mAttentionIcon );
285+ if (m_status == Active && !m_overlayIcon .isNull ())
286+ setIcon (m_overlayIcon );
287+ else if (m_status == NeedsAttention && !m_attentionIcon .isNull ())
288+ setIcon (m_attentionIcon );
289+ else if (!m_icon .isNull ()) // m_status == Passive
290+ setIcon (m_icon );
291+ else if (!m_overlayIcon .isNull ())
292+ setIcon (m_overlayIcon );
293+ else if (!m_attentionIcon .isNull ())
294+ setIcon (m_attentionIcon );
299295 else
300- setIcon (mFallbackIcon );
296+ setIcon (m_fallbackIcon );
301297}
0 commit comments