about summary refs log tree commit diff stats
path: root/src/teliva.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-02-07 22:54:17 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-02-07 22:54:17 -0800
commit504573a0de604bfeb04d4fe938fca8f42da55eca (patch)
tree896786f542ee92007703561875aa2be516f2a27f /src/teliva.c
parent0d16c7c690c0608630082a0470c500d9b3f25f8a (diff)
downloadteliva-504573a0de604bfeb04d4fe938fca8f42da55eca.tar.gz
move most Teliva menus to the right
The problem I'm running into is that apps might want to perform their
own editing. So I can't take up prime estate like the ctrl-e hotkey or a
menu name of 'edit'.

I'm still prioritizing rendering Teliva's edit and permissions menu. If
the window is too narrow the app's settings will be overwritten and
Teliva's hotkeys will be preferentially displayed. Seems safer.
Diffstat (limited to 'src/teliva.c')
-rw-r--r--src/teliva.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/teliva.c b/src/teliva.c
index c21e4af..fd8d105 100644
--- a/src/teliva.c
+++ b/src/teliva.c
@@ -68,8 +68,6 @@ static void draw_menu(lua_State* L) {
     mvaddch(LINES-1, x, ' ');
   menu_column = 2;
   draw_menu_item("^x", "exit");
-  draw_menu_item("^e", "edit");
-  draw_menu_item("^p", "perms");
 
   /* if app ran successfully, render any app-specific items */
   if (Previous_message == NULL) {
@@ -96,7 +94,13 @@ static void draw_menu(lua_State* L) {
     attroff(COLOR_PAIR(COLOR_PAIR_ERROR));
   }
 
-  /* render app permissions on the right */
+  /* render stuff common to all apps on the right */
+  menu_column = COLS-37;
+  draw_menu_item("^u", "edit app");
+  draw_menu_item("^p", "perms");
+
+  attrset(A_NORMAL);
+  mvaddstr(LINES-1, COLS-12, "");
   render_permissions(L);
 
   attrset(A_NORMAL);
@@ -110,8 +114,6 @@ const char* character_name(char c) {
 }
 
 static void render_permissions(lua_State* L) {
-  attrset(A_NORMAL);
-  mvaddstr(LINES-1, COLS-12, "");
   int file_colors = COLOR_PAIR_SAFE;
   if (file_operations_predicate_body && strcmp("return false", trim(file_operations_predicate_body)) != 0)
     file_colors = COLOR_PAIR_WARN;