summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-02-27 16:15:04 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-02-27 16:16:12 +0900
commitd26a127b89bffffbec97c64a526fc0ceaad79855 (patch)
tree8cc08d05bd62a27094cec8f6ef88a51f61a5f325
parent4918c52f39ab6459d1c48e9456a7fbd01a4e91f6 (diff)
downloadkvkbd-d26a127b89bffffbec97c64a526fc0ceaad79855.tar.gz
kvkbd-d26a127b89bffffbec97c64a526fc0ceaad79855.zip
Simplified code for changing the keys color.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 94e4d4ddcda36d5a555894fd914579aed757dbf7)
-rw-r--r--src/VButton.cpp12
1 files 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);
}