about summary refs log tree commit diff stats
path: root/src/ui/statusbar.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-09-19 23:40:45 +0100
committerJames Booth <boothj5@gmail.com>2016-09-19 23:40:45 +0100
commit0aa758cbfb0ec50b3d2eb6024515442882cdf63c (patch)
tree1ae80b6e29b9b99f828f910dddc912bbb3e10bf8 /src/ui/statusbar.c
parentc4d3f19d94e94bb08136e9ecc95ccdad0c76a81d (diff)
downloadprofani-tty-0aa758cbfb0ec50b3d2eb6024515442882cdf63c.tar.gz
Add /inputwin top|bottom command
closes #853
Diffstat (limited to 'src/ui/statusbar.c')
-rw-r--r--src/ui/statusbar.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ui/statusbar.c b/src/ui/statusbar.c
index 6a1a72e9..9b87ecdc 100644
--- a/src/ui/statusbar.c
+++ b/src/ui/statusbar.c
@@ -89,7 +89,13 @@ create_status_bar(void)
 
     int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);
 
-    status_bar = newwin(1, cols, rows-2, 0);
+    char *pos = prefs_get_string(PREF_INPUTWIN);
+    if (g_strcmp0(pos, "top") == 0) {
+        status_bar = newwin(1, cols, rows-1, 0);
+    } else {
+        status_bar = newwin(1, cols, rows-2, 0);
+    }
+    prefs_free_string(pos);
     wbkgd(status_bar, theme_attrs(THEME_STATUS_TEXT));
     wattron(status_bar, bracket_attrs);
     mvwprintw(status_bar, 0, cols - 34, _active);
@@ -122,7 +128,13 @@ status_bar_resize(void)
 
     int bracket_attrs = theme_attrs(THEME_STATUS_BRACKET);
 
-    mvwin(status_bar, rows-2, 0);
+    char *pos = prefs_get_string(PREF_INPUTWIN);
+    if (g_strcmp0(pos, "top") == 0) {
+        mvwin(status_bar, rows-1, 0);
+    } else {
+        mvwin(status_bar, rows-2, 0);
+    }
+    prefs_free_string(pos);
     wresize(status_bar, 1, cols);
     wbkgd(status_bar, theme_attrs(THEME_STATUS_TEXT));
     wattron(status_bar, bracket_attrs);