diff --git a/cmake/DdeDock/DdeDockConfig.cmake b/cmake/DdeDock/DdeDockConfig.cmake new file mode 100644 index 000000000..a01f4929b --- /dev/null +++ b/cmake/DdeDock/DdeDockConfig.cmake @@ -0,0 +1,2 @@ +set(DDE_DOCK_INCLUDE_DIR /usr/local/include/dde-dock) +include_directories("${DDE_DOCK_INCLUDE_DIR}") diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index eed9c53ba..43db252b8 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -603,7 +603,7 @@ void AppItem::showPreview() PopupWindow->setLeftRightRadius(false); } - showPopupWindow(m_appPreviewTips, true); + showPopupWindow(m_appPreviewTips, true, 18); } void AppItem::playSwingEffect() diff --git a/frame/item/components/appdragwidget.cpp b/frame/item/components/appdragwidget.cpp index f20e7d6b7..99bb9e14a 100644 --- a/frame/item/components/appdragwidget.cpp +++ b/frame/item/components/appdragwidget.cpp @@ -34,7 +34,6 @@ AppDragWidget::AppDragWidget(QWidget *parent) m_popupWindow->setShadowXOffset(0); m_popupWindow->setArrowWidth(18); m_popupWindow->setArrowHeight(10); - m_popupWindow->setRadius(18); m_scene->addItem(m_object.get()); setScene(m_scene); diff --git a/frame/item/dockitem.cpp b/frame/item/dockitem.cpp index fe78c2d64..bf245faab 100644 --- a/frame/item/dockitem.cpp +++ b/frame/item/dockitem.cpp @@ -30,7 +30,7 @@ DockItem::DockItem(QWidget *parent) if (PopupWindow.isNull()) { DockPopupWindow *arrowRectangle = new DockPopupWindow(nullptr); arrowRectangle->setShadowBlurRadius(20); - arrowRectangle->setRadius(18); + arrowRectangle->setRadius(6); arrowRectangle->setShadowYOffset(2); arrowRectangle->setShadowXOffset(0); arrowRectangle->setArrowWidth(18); @@ -270,13 +270,9 @@ void DockItem::showHoverTips() showPopupWindow(content); } -void DockItem::showPopupWindow(QWidget *const content, const bool model) +void DockItem::showPopupWindow(QWidget *const content, const bool model, const int radius) { - if(itemType() == App){ - PopupWindow->setRadius(18); - }else { - PopupWindow->setRadius(6); - } + PopupWindow->setRadius(radius); m_popupShown = true; m_lastPopupWidget = content; diff --git a/frame/item/dockitem.h b/frame/item/dockitem.h index a41f9cd5c..7d3cf36c4 100644 --- a/frame/item/dockitem.h +++ b/frame/item/dockitem.h @@ -72,7 +72,7 @@ protected: void hideNonModel(); void popupWindowAccept(); - virtual void showPopupWindow(QWidget *const content, const bool model = false); + virtual void showPopupWindow(QWidget *const content, const bool model = false, const int radius = 6); virtual void showHoverTips(); virtual void invokedMenuItem(const QString &itemId, const bool checked); virtual const QString contextMenu() const; diff --git a/frame/item/pluginsitem.cpp b/frame/item/pluginsitem.cpp index e26c63ed8..304a28064 100644 --- a/frame/item/pluginsitem.cpp +++ b/frame/item/pluginsitem.cpp @@ -242,9 +242,9 @@ void PluginsItem::invokedMenuItem(const QString &itemId, const bool checked) m_pluginInter->invokedMenuItem(m_itemKey, itemId, checked); } -void PluginsItem::showPopupWindow(QWidget *const content, const bool model) +void PluginsItem::showPopupWindow(QWidget *const content, const bool model, const int radius) { - DockItem::showPopupWindow(content, model); + DockItem::showPopupWindow(content, model, radius); } const QString PluginsItem::contextMenu() const diff --git a/frame/item/pluginsitem.h b/frame/item/pluginsitem.h index a2e63874c..e79751c7d 100644 --- a/frame/item/pluginsitem.h +++ b/frame/item/pluginsitem.h @@ -50,7 +50,7 @@ protected: void showEvent(QShowEvent *event) override; void invokedMenuItem(const QString &itemId, const bool checked) override; - void showPopupWindow(QWidget *const content, const bool model = false) override; + void showPopupWindow(QWidget *const content, const bool model = false, const int radius = 6) override; const QString contextMenu() const override; QWidget *popupTips() override; void resizeEvent(QResizeEvent *event) override; diff --git a/widgets/tipswidget.cpp b/widgets/tipswidget.cpp index 05bff6db2..5be5ddcbb 100644 --- a/widgets/tipswidget.cpp +++ b/widgets/tipswidget.cpp @@ -8,6 +8,8 @@ #include #include +#define PADDING 4 + namespace Dock{ TipsWidget::TipsWidget(QWidget *parent) : QFrame(parent) @@ -30,7 +32,7 @@ void TipsWidget::setText(const QString &text) m_text = "བོད་སྐད་ཡིག་གཟུགས་ཚད་ལེན་ཚོད་ལྟའི་སྐོར་གྱི་རྗོད་ཚིག"; #endif - setFixedSize(fontMetrics().width(m_text) + 20, fontMetrics().boundingRect(m_text).height()); + setFixedSize(fontMetrics().width(m_text) + 20, fontMetrics().boundingRect(m_text).height() + PADDING); update(); @@ -54,7 +56,7 @@ void TipsWidget::setTextList(const QStringList &textList) height += fontMetrics().boundingRect(text).height(); } - setFixedSize(width + 20, height); + setFixedSize(width + 20, height + PADDING); update(); }