summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-07-13 10:22:53 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-07-14 09:45:49 +0900
commit6fb5d38d9e6042f0ef2edc5c3fb32c352eb47c7a (patch)
treee2e64dd6254782079f5c993b9cc7e1758ee3a8b8
parent59291a27f9349425be6397c402bd35d021dedffb (diff)
downloadkvkbd-6fb5d38d9e6042f0ef2edc5c3fb32c352eb47c7a.tar.gz
kvkbd-6fb5d38d9e6042f0ef2edc5c3fb32c352eb47c7a.zip
Minor code rework for better consistency.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit f519fe9ea297487d95da992a0a77a2ed3aad2cb0)
-rw-r--r--src/VButton.cpp10
-rw-r--r--src/VButton.h6
2 files changed, 12 insertions, 4 deletions
diff --git a/src/VButton.cpp b/src/VButton.cpp
index c0ce411..46e36ec 100644
--- a/src/VButton.cpp
+++ b/src/VButton.cpp
@@ -85,6 +85,12 @@ void VButton::setupTexts(Display *display)
{
altGrShiftText = c;
}
+
+ // caps + altGr text
+ capsAltGrText = altGrText.upper();
+
+ // caps + altGr + shift text
+ capsAltGrShiftText = altGrShiftText.lower();
}
void VButton::shiftCapsAltGrPressed(bool shift, bool caps, bool altGrState)
@@ -96,11 +102,11 @@ void VButton::shiftCapsAltGrPressed(bool shift, bool caps, bool altGrState)
{
if (shift)
{
- TQPushButton::setText(altGrShiftText.lower());
+ TQPushButton::setText(capsAltGrShiftText);
}
else
{
- TQPushButton::setText(altGrText.upper());
+ TQPushButton::setText(capsAltGrText);
}
}
else if (shift)
diff --git a/src/VButton.h b/src/VButton.h
index 86a58ee..49d5d1f 100644
--- a/src/VButton.h
+++ b/src/VButton.h
@@ -32,10 +32,12 @@ protected:
bool isAlpha;
unsigned int keycode;
TQString normalText;
- TQString capsText;
TQString shiftText;
- TQString altGrText;
+ TQString capsText;
TQString capsShiftText;
+ TQString capsAltGrText;
+ TQString capsAltGrShiftText;
+ TQString altGrText;
TQString altGrShiftText;
TQRect orig_size;