diff --git a/frame/item/components/previewwidget.cpp b/frame/item/components/previewwidget.cpp index 9fa6f832c..6da4ec42b 100644 --- a/frame/item/components/previewwidget.cpp +++ b/frame/item/components/previewwidget.cpp @@ -147,9 +147,6 @@ void PreviewWidget::paintEvent(QPaintEvent *e) if (m_hovered) { const QRect br = r.marginsAdded(QMargins(1, 1, 1, 1)); - QPen p; - p.setBrush(Qt::white); - p.setWidth(4); painter.setBrush(Qt::transparent); painter.setRenderHint(QPainter::Antialiasing); painter.drawRoundedRect(br, 3, 3); diff --git a/frame/util/dockpopupwindow.cpp b/frame/util/dockpopupwindow.cpp index 968151882..e7ff7b923 100644 --- a/frame/util/dockpopupwindow.cpp +++ b/frame/util/dockpopupwindow.cpp @@ -20,13 +20,17 @@ DockPopupWindow::DockPopupWindow(QWidget *parent) m_acceptDelayTimer->setSingleShot(true); m_acceptDelayTimer->setInterval(100); + m_wmHelper = DWindowManagerHelper::instance(); + + compositeChanged(); + setBackgroundColor(DBlurEffectWidget::DarkColor); - setBorderColor(QColor(255, 255, 255, 255 * 0.05)); setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint); setAttribute(Qt::WA_InputMethodEnabled, false); setFocusPolicy(Qt::StrongFocus); connect(m_acceptDelayTimer, &QTimer::timeout, this, &DockPopupWindow::accept); + connect(m_wmHelper, &DWindowManagerHelper::hasCompositeChanged, this, &DockPopupWindow::compositeChanged); } DockPopupWindow::~DockPopupWindow() @@ -170,3 +174,11 @@ void DockPopupWindow::unRegisterMouseEvent() m_mouseInter->UnregisterArea(m_mouseAreaKey); m_mouseAreaKey.clear(); } + +void DockPopupWindow::compositeChanged() +{ + if (m_wmHelper->hasComposite()) + setBorderColor(QColor(255, 255, 255, 255 * 0.05)); + else + setBorderColor(QColor("#2C3238")); +} diff --git a/frame/util/dockpopupwindow.h b/frame/util/dockpopupwindow.h index 9d727f8d9..c987a38bb 100644 --- a/frame/util/dockpopupwindow.h +++ b/frame/util/dockpopupwindow.h @@ -5,6 +5,9 @@ #include "dbus/dbusdisplay.h" #include +#include + +DWIDGET_USE_NAMESPACE class DockPopupWindow : public Dtk::Widget::DArrowRectangle { @@ -36,6 +39,7 @@ private slots: void globalMouseRelease(int button, int x, int y, const QString &id); void registerMouseEvent(); void unRegisterMouseEvent(); + void compositeChanged(); private: bool m_model; @@ -46,6 +50,7 @@ private: DBusXMouseArea *m_mouseInter; DBusDisplay *m_displayInter; + DWindowManagerHelper *m_wmHelper; }; #endif // DOCKPOPUPWINDOW_H