Fixed color of text when IconButtonWithText is over.
This commit is contained in:
parent
4befce5a29
commit
b178a5d15f
1 changed files with 2 additions and 2 deletions
|
|
@ -20,13 +20,13 @@ void IconButtonWithText::paintEvent(QPaintEvent *e) {
|
||||||
IconButton::paintEvent(e);
|
IconButton::paintEvent(e);
|
||||||
|
|
||||||
const auto r = rect() - _st.textPadding;
|
const auto r = rect() - _st.textPadding;
|
||||||
|
const auto overIconOpacity = IconButton::iconOverOpacity();
|
||||||
|
|
||||||
auto p = QPainter(this);
|
auto p = QPainter(this);
|
||||||
p.setFont(_st.font);
|
p.setFont(_st.font);
|
||||||
p.setPen(_st.textFg);
|
p.setPen((overIconOpacity == 1.) ? _st.textFgOver : _st.textFg);
|
||||||
p.drawText(r, _text, _st.textAlign);
|
p.drawText(r, _text, _st.textAlign);
|
||||||
|
|
||||||
const auto overIconOpacity = IconButton::iconOverOpacity();
|
|
||||||
if (overIconOpacity > 0. && overIconOpacity < 1.) {
|
if (overIconOpacity > 0. && overIconOpacity < 1.) {
|
||||||
p.setPen(_st.textFgOver);
|
p.setPen(_st.textFgOver);
|
||||||
p.setOpacity(overIconOpacity);
|
p.setOpacity(overIconOpacity);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue