about summary refs log tree commit diff stats
path: root/src/ui/titlebar.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/titlebar.c')
-rw-r--r--src/ui/titlebar.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/ui/titlebar.c b/src/ui/titlebar.c
index 90775ce7..436b574c 100644
--- a/src/ui/titlebar.c
+++ b/src/ui/titlebar.c
@@ -46,6 +46,7 @@
 #include "ui/inputwin.h"
 #include "ui/window_list.h"
 #include "ui/window.h"
+#include "ui/screen.h"
 #include "xmpp/roster_list.h"
 #include "xmpp/chat_session.h"
 
@@ -67,13 +68,8 @@ create_title_bar(void)
 {
     int cols = getmaxx(stdscr);
 
-    char *pos = prefs_get_string(PREF_INPUTWIN);
-    if (g_strcmp0(pos, "top") == 0) {
-        win = newwin(1, cols, 1, 0);
-    } else {
-        win = newwin(1, cols, 0, 0);
-    }
-    prefs_free_string(pos);
+    int row = screen_titlebar_row();
+    win = newwin(1, cols, row, 0);
     wbkgd(win, theme_attrs(THEME_TITLE_TEXT));
     title_bar_console();
     title_bar_set_presence(CONTACT_OFFLINE);
@@ -109,13 +105,8 @@ title_bar_resize(void)
 
     werase(win);
 
-    char *pos = prefs_get_string(PREF_INPUTWIN);
-    if (g_strcmp0(pos, "top") == 0) {
-        mvwin(win, 1, 0);
-    } else {
-        mvwin(win, 0, 0);
-    }
-    prefs_free_string(pos);
+    int row = screen_titlebar_row();
+    mvwin(win, row, 0);
 
     wresize(win, 1, cols);
     wbkgd(win, theme_attrs(THEME_TITLE_TEXT));