Skip to content

Commit c4eb272

Browse files
committed
UI: add menu control key indicators
1 parent 46bd333 commit c4eb272

File tree

1 file changed

+34
-28
lines changed

1 file changed

+34
-28
lines changed

src/ui/system.cpp

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -58,31 +58,37 @@
5858
#define FONT_MIN 20
5959
#define FONT_MAX 200
6060

61-
#define MENU_STR_AUDIO "Audio [%s]"
62-
#define MENU_STR_BACK "Back ^b"
63-
#define MENU_STR_CONSOLE "Console"
64-
#define MENU_STR_CONTROL "Control Mode [%s]"
65-
#define MENU_STR_COPY "Copy ^c"
66-
#define MENU_STR_CUT "Cut ^x"
67-
#define MENU_STR_DEBUG "Debug"
68-
#define MENU_STR_EDITOR "Editor [%s]"
69-
#define MENU_STR_FONT "Font Size %d%%"
70-
#define MENU_STR_HELP "Help"
71-
#define MENU_STR_KEYPAD "Show Keypad"
61+
#if defined(_SDL)
62+
#define MK_MENU(l, a) " " l " " a " "
63+
#else
64+
#define MK_MENU(l, a) " " l
65+
#endif
66+
67+
#define MENU_STR_BACK MK_MENU("Back", "^b")
68+
#define MENU_STR_COPY MK_MENU("Copy", "^c")
69+
#define MENU_STR_CUT MK_MENU("Cut", "^x")
70+
#define MENU_STR_PASTE MK_MENU("Paste", "^v")
71+
#define MENU_STR_REDO MK_MENU("Redo", "^y")
72+
#define MENU_STR_RUN MK_MENU("Run", "^r")
73+
#define MENU_STR_SAVE MK_MENU("Save", "^s")
74+
#define MENU_STR_UNDO MK_MENU("Undo", "^z")
75+
#define MENU_STR_SCREEN MK_MENU("Screenshot", "^p")
76+
#define MENU_STR_SELECT MK_MENU("Select All", "^a")
7277
#define MENU_STR_OFF "OFF"
7378
#define MENU_STR_ON "ON"
74-
#define MENU_STR_OUTPUT "Show Output"
75-
#define MENU_STR_PASTE "Paste ^v"
76-
#define MENU_STR_REDO "Redo ^y"
77-
#define MENU_STR_RESTART "Restart"
78-
#define MENU_STR_RUN "Run ^r"
79-
#define MENU_STR_SAVE "Save ^s"
80-
#define MENU_STR_SCREEN "Screenshot ^p"
81-
#define MENU_STR_SELECT "Select All ^a"
82-
#define MENU_STR_SHARE "Share"
83-
#define MENU_STR_SHORT "Desktop Shortcut"
84-
#define MENU_STR_SOURCE "View Source"
85-
#define MENU_STR_UNDO "Undo ^z"
79+
#define MENU_STR_AUDIO " Audio [%s] "
80+
#define MENU_STR_EDITOR " Editor [%s] "
81+
#define MENU_STR_CONSOLE " Console "
82+
#define MENU_STR_CONTROL " Control Mode [%s] "
83+
#define MENU_STR_DEBUG " Debug "
84+
#define MENU_STR_FONT " Font Size %d%% "
85+
#define MENU_STR_HELP " Help "
86+
#define MENU_STR_KEYPAD " Show Keypad "
87+
#define MENU_STR_OUTPUT " Show Output "
88+
#define MENU_STR_RESTART " Restart "
89+
#define MENU_STR_SHARE " Share "
90+
#define MENU_STR_SHORT " Desktop Shortcut "
91+
#define MENU_STR_SOURCE " View Source "
8692

8793
System *g_system;
8894

@@ -989,8 +995,6 @@ void System::showMenu() {
989995
items->add(new String(MENU_STR_KEYPAD));
990996
_systemMenu[index++] = MENU_KEYPAD;
991997
#endif
992-
items->add(new String(MENU_STR_SCREEN));
993-
_systemMenu[index++] = MENU_SCREENSHOT;
994998
if (_mainBas) {
995999
sprintf(buffer, MENU_STR_FONT, _fontScale - FONT_SCALE_INTERVAL);
9961000
items->add(new String(buffer));
@@ -1002,6 +1006,9 @@ void System::showMenu() {
10021006
items->add(new String(buffer));
10031007
_systemMenu[index++] = MENU_EDITMODE;
10041008
}
1009+
sprintf(buffer, MENU_STR_AUDIO, (opt_mute_audio ? MENU_STR_OFF : MENU_STR_ON));
1010+
items->add(new String(buffer));
1011+
_systemMenu[index++] = MENU_AUDIO;
10051012
#if !defined(_SDL) && !defined(_FLTK)
10061013
if (!_mainBas && !_activeFile.empty()) {
10071014
items->add(new String(MENU_STR_SHORT));
@@ -1010,9 +1017,8 @@ void System::showMenu() {
10101017
_systemMenu[index++] = MENU_SHARE;
10111018
}
10121019
#endif
1013-
sprintf(buffer, MENU_STR_AUDIO, (opt_mute_audio ? MENU_STR_OFF : MENU_STR_ON));
1014-
items->add(new String(buffer));
1015-
_systemMenu[index++] = MENU_AUDIO;
1020+
items->add(new String(MENU_STR_SCREEN));
1021+
_systemMenu[index++] = MENU_SCREENSHOT;
10161022
#if defined(_SDL) || defined(_FLTK)
10171023
items->add(new String(MENU_STR_BACK));
10181024
_systemMenu[index++] = MENU_BACK;

0 commit comments

Comments
 (0)