fix tip not shown when app is inactive

Change-Id: Ifc31d319d996251525fbb9cd19d7713b0859488f
This commit is contained in:
石博文 2016-07-19 15:11:28 +08:00 committed by Hualet Wang
parent a916bf5af9
commit 021a618e13
2 changed files with 13 additions and 5 deletions

View File

@ -79,6 +79,10 @@ public:
inline QString menu() const
{ return qvariant_cast< QString >(property("Menu")); }
Q_PROPERTY(QString Name READ name NOTIFY NameChanged)
inline QString name() const
{ return qvariant_cast< QString >(property("Name")); }
Q_PROPERTY(quint32 CurrentWindow READ currentWindow NOTIFY CurrentWindowChanged)
inline quint32 currentWindow() const
{ return qvariant_cast< quint32 >(property("CurrentWindow")); }
@ -122,6 +126,7 @@ void IdChanged();
void TitleChanged();
void IconChanged();
void MenuChanged();
void NameChanged();
void CurrentWindowChanged();
};

View File

@ -288,14 +288,17 @@ const QString AppItem::contextMenu() const
QWidget *AppItem::popupTips()
{
if (m_titles.isEmpty())
return nullptr;
if (m_draging)
return nullptr;
const quint32 currentWindow = m_itemEntry->currentWindow();
Q_ASSERT(m_titles.contains(currentWindow));
m_appNameTips->setText(m_titles[currentWindow]);
if (!m_titles.isEmpty())
{
const quint32 currentWindow = m_itemEntry->currentWindow();
Q_ASSERT(m_titles.contains(currentWindow));
m_appNameTips->setText(m_titles[currentWindow]);
} else {
m_appNameTips->setText(m_itemEntry->name());
}
return m_appNameTips;
}