Skip to content

Commit

Permalink
Merge pull request #12445 from JoergAtGithub/noStyleUnpolish
Browse files Browse the repository at this point in the history
Remove unnecessary unpolish operation of the style, before polish the new style
  • Loading branch information
ronso0 authored Feb 27, 2024
2 parents b592aa8 + d611ebe commit 62f3c82
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 11 deletions.
3 changes: 0 additions & 3 deletions src/widget/controlwidgetconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ void ControlWidgetPropertyConnection::slotControlValueChanged(double v) {

m_propertyValue = vParameter;

// According to http://stackoverflow.com/a/3822243 this is the least
// expensive way to restyle just this widget.
pWidget->style()->unpolish(pWidget);
pWidget->style()->polish(pWidget);

// These calls don't always trigger the repaint, so call it explicitly.
Expand Down
1 change: 0 additions & 1 deletion src/widget/wcolorpicker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ void WColorPicker::setColorButtonChecked(const mixxx::RgbColor::optional_t& colo
pButton->setIcon(QIcon(checked ? ":/images/ic_checkmark.svg" : ""));
}
// This is needed to re-apply skin styles (e.g. to show/hide a checkmark icon)
pButton->style()->unpolish(pButton);
pButton->style()->polish(pButton);
}

Expand Down
6 changes: 0 additions & 6 deletions src/widget/wpushbutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,6 @@ void WPushButton::setPixmapBackground(const PixmapSource& source,
void WPushButton::restyleAndRepaint() {
emit displayValueChanged(readDisplayValue());

// According to http://stackoverflow.com/a/3822243 this is the least
// expensive way to restyle just this widget.
// Since we expect button connections to not change at high frequency we
// don't try to detect whether things have changed for WPushButton, we just
// re-render.
style()->unpolish(this);
style()->polish(this);

// These calls don't always trigger the repaint, so call it explicitly.
Expand Down
1 change: 0 additions & 1 deletion src/widget/wwidgetgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ void WWidgetGroup::setHighlight(int highlight) {
return;
}
m_highlight = highlight;
style()->unpolish(this);
style()->polish(this);
update();
emit highlightChanged(m_highlight);
Expand Down

0 comments on commit 62f3c82

Please sign in to comment.