From ea1b02646d450cfd15095f5b08d9e66ccef3b77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E5=8D=9A=E6=96=87?= Date: Tue, 25 Apr 2017 16:36:58 +0800 Subject: [PATCH] always show preview window show preview window whatever is single window or not Change-Id: Ia30661696f2eb80a9ee1ae0bb693715686a8904b --- frame/item/appitem.cpp | 13 ++++++------- frame/item/appitem.h | 2 +- frame/item/dockitem.h | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index c1e766586..2f9c48fc6 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -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); } diff --git a/frame/item/appitem.h b/frame/item/appitem.h index 1c84de649..9c51a5ccb 100644 --- a/frame/item/appitem.h +++ b/frame/item/appitem.h @@ -47,7 +47,7 @@ private slots: void updateTitle(); void refershIcon(); void activeChanged(); - void togglePreview(); + void showPreview(); private: QLabel *m_appNameTips; diff --git a/frame/item/dockitem.h b/frame/item/dockitem.h index 8084476d9..b2e14fcbf 100644 --- a/frame/item/dockitem.h +++ b/frame/item/dockitem.h @@ -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;