Skip to content

Commit e53c795

Browse files
committed
Draw borders in popup menus
1 parent 524e81d commit e53c795

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed

style/adwaitahelper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,10 +575,10 @@ void Helper::renderMenuFrame(QPainter *painter, const QRect &rect, const QColor
575575
painter->setBrush(Qt::NoBrush);
576576

577577
painter->setRenderHint(QPainter::Antialiasing, false);
578-
QRect frameRect(rect);
578+
QRectF frameRect(rect);
579579
if (outline.isValid()) {
580580
painter->setPen(outline);
581-
frameRect.adjust(0, 0, -1, -1);
581+
frameRect.adjust(0.5, 0.5, -0.5, -0.5);
582582
} else
583583
painter->setPen(Qt::NoPen);
584584

style/adwaitastyle.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,9 +1271,6 @@ void Style::drawControl(ControlElement element, const QStyleOption *option, QPai
12711271
case CE_MenuBarItem:
12721272
fcn = &Style::drawMenuBarItemControl;
12731273
break;
1274-
case CE_MenuEmptyArea:
1275-
fcn = &Style::drawMenuEmptyAreaControl;
1276-
break;
12771274
case CE_MenuItem:
12781275
fcn = &Style::drawMenuItemControl;
12791276
break;
@@ -4854,21 +4851,6 @@ bool Style::drawMenuBarItemControl(const QStyleOption *option, QPainter *painter
48544851
return true;
48554852
}
48564853

4857-
bool Style::drawMenuEmptyAreaControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const
4858-
{
4859-
if (_isGNOME)
4860-
painter->setPen(Qt::transparent);
4861-
else
4862-
painter->setPen(option->palette.window().color().darker(150));
4863-
4864-
painter->setBrush(option->palette.base().color());
4865-
if (_isGNOME)
4866-
painter->drawRect(option->rect);
4867-
else
4868-
painter->drawRect(option->rect.adjusted(0, 0, -1, -1));
4869-
return true;
4870-
}
4871-
48724854
//___________________________________________________________________________________
48734855
bool Style::drawMenuItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const
48744856
{
@@ -4882,11 +4864,6 @@ bool Style::drawMenuItemControl(const QStyleOption *option, QPainter *painter, c
48824864
// copy rect and palette
48834865
const QRect &rect(option->rect);
48844866
const QPalette &palette(option->palette);
4885-
const QColor &background(palette.color(QPalette::Active, QPalette::Base));
4886-
4887-
painter->setPen(Qt::NoPen);
4888-
painter->setBrush(background);
4889-
painter->drawRect(rect);
48904867

48914868
// deal with separators
48924869
if (menuItemOption->menuItemType == QStyleOptionMenuItem::Separator) {

style/adwaitastyle.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ protected Q_SLOTS:
312312
virtual bool drawItemViewItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const;
313313
virtual bool drawMenuBarEmptyArea(const QStyleOption *option, QPainter *painter, const QWidget *widget) const;
314314
virtual bool drawMenuBarItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const;
315-
virtual bool drawMenuEmptyAreaControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const;
316315
virtual bool drawMenuItemControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const;
317316
virtual bool drawProgressBarControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const;
318317
virtual bool drawProgressBarContentsControl(const QStyleOption *option, QPainter *painter, const QWidget *widget) const;

0 commit comments

Comments
 (0)