From 94e4d4ddcda36d5a555894fd914579aed757dbf7 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 27 Feb 2021 16:15:04 +0900 Subject: [PATCH] Simplified code for changing the keys color. Signed-off-by: Michele Calgaro --- src/VButton.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/VButton.cpp b/src/VButton.cpp index c5763ab..9dffe26 100644 --- a/src/VButton.cpp +++ b/src/VButton.cpp @@ -71,15 +71,9 @@ void VButton::setColor(const TQColor &color) // 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. TQPalette plt = palette(); - TQColorGroup cg = plt.active(); - cg.setColor(TQColorGroup::Button, color); - plt.setActive(cg); - cg = plt.inactive(); - cg.setColor(TQColorGroup::Button, color); - plt.setInactive(cg); - cg = plt.disabled(); - cg.setColor(TQColorGroup::Button, color); - plt.setDisabled(cg); + plt.setColor(TQPalette::Active, TQColorGroup::Button, color); + plt.setColor(TQPalette::Inactive, TQColorGroup::Button, color); + plt.setColor(TQPalette::Disabled, TQColorGroup::Button, color); setPalette(plt); }