summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2017-04-24 23:48:13 -0300
committerGitHub <noreply@github.com>2017-04-24 23:48:13 -0300
commitb1028e03c513bc9182b7cc926170ce17a2bd0ac6 (patch)
tree3e019a67d88eb1296748c8d28f991df405374f0a
parent0c168471b6884b48deb42213ce068f50ea770a32 (diff)
parent0108117d0b4f1e822f434db173e976aac20b26b5 (diff)
Merge pull request #414 from Explorer09/meters-panel-edit
Mouse-friendly functions bar for meters panel
-rw-r--r--MetersPanel.c20
-rw-r--r--MetersPanel.h6
2 files changed, 19 insertions, 7 deletions
diff --git a/MetersPanel.c b/MetersPanel.c
index fa5300e9..22449f3d 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* 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) {
diff --git a/MetersPanel.h b/MetersPanel.h
index 1736dfb4..e00169c8 100644
--- a/MetersPanel.h
+++ b/MetersPanel.h
@@ -27,6 +27,12 @@ struct MetersPanel_ {
};
+// Note: In code the meters are known to have bar/text/graph "Modes", but in UI
+// we call them "Styles".
+// 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".
void MetersPanel_setMoving(MetersPanel* this, bool moving);

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