Simplified code for changing the keys color.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/10/head
Michele Calgaro 5 years ago
parent 64d40d992e
commit 94e4d4ddcd
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -71,15 +71,9 @@ void VButton::setColor(const TQColor &color)
// Need to set TQColorGroup::Button color as well, otherwise the actual // Need to set TQColorGroup::Button color as well, otherwise the actual
// color of the key does not change until the next restart of the application. // color of the key does not change until the next restart of the application.
TQPalette plt = palette(); TQPalette plt = palette();
TQColorGroup cg = plt.active(); plt.setColor(TQPalette::Active, TQColorGroup::Button, color);
cg.setColor(TQColorGroup::Button, color); plt.setColor(TQPalette::Inactive, TQColorGroup::Button, color);
plt.setActive(cg); plt.setColor(TQPalette::Disabled, TQColorGroup::Button, color);
cg = plt.inactive();
cg.setColor(TQColorGroup::Button, color);
plt.setInactive(cg);
cg = plt.disabled();
cg.setColor(TQColorGroup::Button, color);
plt.setDisabled(cg);
setPalette(plt); setPalette(plt);
} }

Loading…
Cancel
Save