Skip to content

fix WidgetGroup highlighting#1087

Merged
rryan merged 2 commits intomixxxdj:masterfrom
Be-ing:fix_widgetgroup_highlight
Dec 22, 2016
Merged

fix WidgetGroup highlighting#1087
rryan merged 2 commits intomixxxdj:masterfrom
Be-ing:fix_widgetgroup_highlight

Conversation

@Be-ing
Copy link
Copy Markdown
Contributor

@Be-ing Be-ing commented Dec 21, 2016

make #1068 work after skin has been initialized

void WWidgetGroup::setHighlight(int highlight) {
m_highlight = highlight;
update();
style()->polish(this);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably do it like WPushButton::restyleAndRepaint:
https://github.com/mixxxdj/mixxx/blob/master/src/widget/wpushbutton.cpp#L264

Based on http://stackoverflow.com/a/3822243 we believe that's the best way to trigger re-computation of the styles.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QWidget documentation suggests calling update() is better than directly calling repaint().

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, that WPushButton one should probably be an update, not a repaint (we typically only use repaint for things that update on the waveform timer). I meant add an unpolish here.

@rryan rryan merged commit 8c6aae2 into mixxxdj:master Dec 22, 2016
@Be-ing Be-ing deleted the fix_widgetgroup_highlight branch February 1, 2017 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants