ENH: page faults when device page idle
jira: [none] Change-Id: I4dc95ae6332b81e571fb5ef09c75dcf01e77170e (cherry picked from commit cefe973772c7f7045713470d61cc85221574d9c5)
This commit is contained in:
@@ -62,9 +62,10 @@ void SwitchButton::SetThumbColor(StateColor const& color)
|
||||
|
||||
void SwitchButton::SetValue(bool value)
|
||||
{
|
||||
if (value != GetValue())
|
||||
wxBitmapToggleButton::SetValue(value);
|
||||
update();
|
||||
if (value != GetValue()) {
|
||||
wxBitmapToggleButton::SetValue(value);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
bool SwitchButton::SetBackgroundColour(const wxColour& colour)
|
||||
@@ -212,17 +213,30 @@ SwitchBoard::SwitchBoard(wxWindow *parent, wxString leftL, wxString right, wxSiz
|
||||
void SwitchBoard::updateState(wxString target)
|
||||
{
|
||||
if (target.empty()) {
|
||||
if (!switch_left && !switch_right) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch_left = false;
|
||||
switch_right = false;
|
||||
} else {
|
||||
if (target == "left") {
|
||||
if (switch_left && !switch_right) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch_left = true;
|
||||
switch_right = false;
|
||||
} else if (target == "right") {
|
||||
if (!switch_left && switch_right) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch_left = false;
|
||||
switch_right = true;
|
||||
}
|
||||
}
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user