always show preview window

show preview window whatever is single window or not

Change-Id: Ia30661696f2eb80a9ee1ae0bb693715686a8904b
This commit is contained in:
石博文 2017-04-25 16:36:58 +08:00
parent 719ba37e5c
commit ea1b02646d
Notes: Deepin Code Review 2017-04-25 16:38:16 +08:00
Code-Review+2: 石博文 <sbw@sbw.so>
Verified+1: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Tue, 25 Apr 2017 16:38:14 +0800
Reviewed-on: https://cr.deepin.io/22532
Project: dde/dde-dock
Branch: refs/heads/master
3 changed files with 8 additions and 9 deletions

View File

@ -357,11 +357,10 @@ void AppItem::showHoverTips()
// showPopupWindow(content);
const int count = m_titles.size();
if (count <= 1)
if (m_titles.isEmpty())
return DockItem::showHoverTips();
togglePreview();
showPreview();
}
void AppItem::invokedMenuItem(const QString &itemId, const bool checked)
@ -447,15 +446,15 @@ void AppItem::activeChanged()
m_active = !m_active;
}
void AppItem::togglePreview()
void AppItem::showPreview()
{
if (PopupWindow->isVisible())
return hidePopup();
// if (PopupWindow->isVisible())
// return hidePopup();
m_appPreviewTips->updateLayoutDirection(DockPosition);
m_appPreviewTips->setWindowInfos(m_titles);
qApp->processEvents();
showPopupApplet(m_appPreviewTips);
showPopupWindow(m_appPreviewTips, true);
}

View File

@ -47,7 +47,7 @@ private slots:
void updateTitle();
void refershIcon();
void activeChanged();
void togglePreview();
void showPreview();
private:
QLabel *m_appNameTips;

View File

@ -56,6 +56,7 @@ protected:
void hidePopup();
void popupWindowAccept();
void showPopupApplet(QWidget * const applet);
void showPopupWindow(QWidget * const content, const bool model = false);
virtual void showHoverTips();
virtual void invokedMenuItem(const QString &itemId, const bool checked);
virtual const QString contextMenu() const;
@ -66,7 +67,6 @@ protected slots:
private:
void updatePopupPosition();
void showPopupWindow(QWidget * const content, const bool model = false);
protected:
bool m_hover;