aboutsummaryrefslogtreecommitdiffstats
path: root/MetersPanel.c
diff options
context:
space:
mode:
authorGraham Inggs <ginggs@debian.org>2018-02-05 14:48:51 +0200
committerGraham Inggs <ginggs@debian.org>2018-02-05 14:48:51 +0200
commit2ee50d030178cede83eb9d0005fbc19f819d30fe (patch)
tree67d75c0a7c47e15bed9d0735ecf12abec4f8157b /MetersPanel.c
parent31b71b67011fa52f091df6fe536a11d6d0bfb256 (diff)
downloaddebian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.gz
debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.bz2
debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.zip
Imported Upstream version 2.1.0upstream/2.1.0
Diffstat (limited to 'MetersPanel.c')
-rw-r--r--MetersPanel.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/MetersPanel.c b/MetersPanel.c
index fa5300e..3cf3e07 100644
--- a/MetersPanel.c
+++ b/MetersPanel.c
@@ -31,13 +31,19 @@ struct MetersPanel_ {
}*/
-static const char* MetersFunctions[] = {"Type ", "Move ", "Delete", "Done ", NULL};
-static const char* MetersKeys[] = {"Space", "Enter", "Del", "Esc"};
-static int MetersEvents[] = {' ', 13, KEY_DC, 27};
-
-static const char* MetersMovingFunctions[] = {"Up ", "Down ", "Left ", "Right ", "Confirm", "Delete", "Done ", NULL};
-static const char* MetersMovingKeys[] = {"Up", "Dn", "Lt", "Rt", "Enter", "Del", "Esc"};
-static int MetersMovingEvents[] = {KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, 13, KEY_DC, 27};
+// Note: In code the meters are known to have bar/text/graph "Modes", but in UI
+// we call them "Styles".
+static const char* const MetersFunctions[] = {"Style ", "Move ", " ", "Delete", "Done ", NULL};
+static const char* const MetersKeys[] = {"Space", "Enter", " ", "Del", "F10"};
+static int MetersEvents[] = {' ', 13, ERR, KEY_DC, KEY_F(10)};
+
+// We avoid UTF-8 arrows ← → here as they might display full-width on Chinese
+// terminals, breaking our aligning.
+// In <http://unicode.org/reports/tr11/>, arrows (U+2019..U+2199) are
+// considered "Ambiguous characters".
+static const char* const MetersMovingFunctions[] = {"Style ", "Lock ", "Up ", "Down ", "Left ", "Right ", " ", "Delete", "Done ", NULL};
+static const char* const MetersMovingKeys[] = {"Space", "Enter", "Up", "Dn", "<-", "->", " ", "Del", "F10"};
+static int MetersMovingEvents[] = {' ', 13, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, ERR, KEY_DC, KEY_F(10)};
static FunctionBar* Meters_movingBar = NULL;
static void MetersPanel_delete(Object* object) {
@@ -122,8 +128,8 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
if (!this->moving) {
break;
}
- /* else fallthrough */
}
+ /* else fallthrough */
case KEY_F(7):
case '[':
case '-':
@@ -138,8 +144,8 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
if (!this->moving) {
break;
}
- /* else fallthrough */
}
+ /* else fallthrough */
case KEY_F(8):
case ']':
case '+':

© 2014-2024 Faster IT GmbH | imprint | privacy policy