Skip to content

Commit 524e81d

Browse files
committed
QComboBox: use correct button color in editable combobox
1 parent 0a8da95 commit 524e81d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

style/adwaitahelper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ QColor Helper::buttonBackgroundColor(const QPalette &palette, bool mouseOver, bo
182182
// Hovered button for normal mode is bg_color
183183
return mix(buttonBackground, background, opacity);
184184
}
185-
} else if(mouseOver) {
185+
} else if (mouseOver) {
186186
if (darkMode) {
187187
// Hovered button for dark mode is darken(bg_color, 0.01)
188188
return darken(background, 0.01);

style/adwaitastyle.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3396,7 +3396,6 @@ bool Style::drawFrameLineEditPrimitive(const QStyleOption *option, QPainter *pai
33963396

33973397
// focus takes precedence over mouse over
33983398
_animations->inputWidgetEngine().updateState(widget, AnimationFocus, hasFocus);
3399-
_animations->inputWidgetEngine().updateState(widget, AnimationHover, mouseOver && !hasFocus);
34003399

34013400
// retrieve animation mode and opacity
34023401
AnimationMode mode(_animations->inputWidgetEngine().frameAnimationMode(widget));
@@ -6278,11 +6277,13 @@ bool Style::drawComboBoxComplexControl(const QStyleOptionComplex *option, QPaint
62786277
AnimationMode mode(_animations->inputWidgetEngine().buttonAnimationMode(widget));
62796278
qreal opacity(_animations->inputWidgetEngine().buttonOpacity(widget));
62806279

6281-
QColor shadow(palette.color(QPalette::Shadow));
6280+
// define colors
6281+
QColor shadow(_helper->shadowColor(palette));
62826282
QColor outline(_helper->buttonOutlineColor(palette, mouseOver, hasFocus, opacity, mode, _dark));
62836283
QColor background(_helper->buttonBackgroundColor(palette, mouseOver, hasFocus, sunken, opacity, mode, _dark));
62846284

6285-
_helper->renderFlatButtonFrame(painter, subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget), background, outline, shadow, hasFocus, sunken, mouseOver, enabled && windowActive);
6285+
// render
6286+
_helper->renderButtonFrame(painter, rect, background, outline, shadow, hasFocus, sunken, mouseOver, enabled && windowActive, _dark);
62866287

62876288
QStyleOptionComplex tmpOpt(*option);
62886289
tmpOpt.rect.setWidth(tmpOpt.rect.width() - subControlRect(CC_ComboBox, option, SC_ComboBoxArrow, widget).width() + 3);

0 commit comments

Comments
 (0)