Skip to content

Commit

Permalink
fix: tooltips has strange border
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardLuo0 committed Feb 13, 2024
1 parent f3cc30e commit 35ecd15
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Kvantum/style/blur/blurhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ void BlurHelper::applyBackdrop(QWidget *widget) {

DWM_WINDOW_CORNER_PREFERENCE corner =
DWM_WINDOW_CORNER_PREFERENCE::DWMWCP_DEFAULT;
if (qobject_cast<QMenu *>(widget))
if (qobject_cast<QMenu *>(widget) ||
widget->inherits("QComboBoxPrivateContainer"))
corner = (DWM_WINDOW_CORNER_PREFERENCE)menuCorner;
else if (widget->inherits("QTipLabel")) {
corner = (DWM_WINDOW_CORNER_PREFERENCE)tooltipsCorner;
Expand Down
9 changes: 7 additions & 2 deletions Kvantum/style/polishing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,8 @@ void Style::polish(QWidget *widget)
|| (/*tspec_.isX11 && */widget->inherits("QComboBoxPrivateContainer")))
&& !translucentWidgets_.contains(widget))
{
widget->setWindowFlag(Qt::FramelessWindowHint);
widget->setAttribute(Qt::WA_TranslucentBackground);
theme_spec tspec_now = settings_->getCompositeSpec();
if (tspec_now.composite)
{
Expand Down Expand Up @@ -1028,8 +1030,11 @@ void Style::polish(QWidget *widget)
blurHelper_->registerWidget(widget);
}
}
else if (qobject_cast<QMenu*>(widget)) // for menubars and submenus (eventFilter -> case QEvent::Show)
widget->installEventFilter(this);
else {
widget->setWindowFlag(Qt::NoDropShadowWindowHint);
if (qobject_cast<QMenu*>(widget)) // for menubars and submenus (eventFilter -> case QEvent::Show)
widget->installEventFilter(this);
}
}
}

Expand Down

0 comments on commit 35ecd15

Please sign in to comment.