Skip to content

Commit

Permalink
Fixed color of text when IconButtonWithText is over.
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Dec 15, 2022
1 parent 4befce5 commit b178a5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/widgets/icon_button_with_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ void IconButtonWithText::paintEvent(QPaintEvent *e) {
IconButton::paintEvent(e);

const auto r = rect() - _st.textPadding;
const auto overIconOpacity = IconButton::iconOverOpacity();

auto p = QPainter(this);
p.setFont(_st.font);
p.setPen(_st.textFg);
p.setPen((overIconOpacity == 1.) ? _st.textFgOver : _st.textFg);
p.drawText(r, _text, _st.textAlign);

const auto overIconOpacity = IconButton::iconOverOpacity();
if (overIconOpacity > 0. && overIconOpacity < 1.) {
p.setPen(_st.textFgOver);
p.setOpacity(overIconOpacity);
Expand Down

0 comments on commit b178a5d

Please sign in to comment.