summaryrefslogtreecommitdiffstats
path: root/MetersPanel.c
diff options
context:
space:
mode:
authorExplorer09 <explorer09@gmail.com>2016-03-21 15:18:44 +0800
committerExplorer09 <explorer09@gmail.com>2016-07-16 21:13:46 +0800
commit0108117d0b4f1e822f434db173e976aac20b26b5 (patch)
tree037210aaae3079e8c7cd222fcf9c9266bffd680a /MetersPanel.c
parenta41c9b392555b81678c31b3722a2bdb887a1b887 (diff)
Mouse-friendly functions bar for meters panel
Before: SpaceStyle EnterMove DelDeleteEscDone | ~~~~~ ~~~~~ ~~~ ~~~ | UpUp DnDown LtLeft RtRight EnterConfirmDelDeleteEscDone | ~~ ~~ ~~ ~~ ~~~~~ ~~~ ~~~ | After: SpaceStyle EnterMove DelDeleteF10Done ~~~~~ ~~~~~ ~~ ~~~ ~~~ SpaceStyle EnterLock UpUp DnDown <-Left ->Right DelDeleteF10Done ~~~~~ ~~~~~ ~~ ~~ ~~ ~~ ~~ ~~~ ~~~ * Align 'Delete' and 'Done' to the right to match functions on other screens. (Accidental clicking is avoided as a side benefit.) * You could change meter type while in moving mode. New bar now hints this. * Two Enter key functions are put in the same place and so mouse clicks there act like functions toggle. (The wording change to 'Lock' is also to reflect this.) * '<-' and '->' instead of 'Lt' and 'Rt' abbreviation as the latter is not widely seen and arrows shapes are obvious. :) * 'Esc' key for 'Done' in this context may not be intuitive, comparing to 'F10'. While I wish there be a Cancel/Undo function for 'Esc', it wouldn't hurt if we write 'F10' for 'Done' on functions bar for now.
Diffstat (limited to 'MetersPanel.c')
-rw-r--r--MetersPanel.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/MetersPanel.c b/MetersPanel.c
index c76603f3..22449f3d 100644
--- a/MetersPanel.c
+++ b/MetersPanel.c
@@ -33,13 +33,17 @@ struct MetersPanel_ {
// Note: In code the meters are known to have bar/text/graph "Modes", but in UI
// we call them "Styles".
-static const char* MetersFunctions[] = {"Style ", "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};
+static const char* MetersFunctions[] = {"Style ", "Move ", " ", "Delete", "Done ", NULL};
+static const char* 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* MetersMovingFunctions[] = {"Style ", "Lock ", "Up ", "Down ", "Left ", "Right ", " ", "Delete", "Done ", NULL};
+static const char* 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) {

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