about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-11-15 23:47:27 +0000
committerJames Booth <boothj5@gmail.com>2014-11-15 23:47:27 +0000
commit1479a5e134004568245996a22418dadb6b6da6f6 (patch)
tree89cb5b33d29f943334de794e07a8df032a5b8288 /src/ui
parent3a778cc974a2a561f96d926178ce18c9cc6627cb (diff)
downloadprofani-tty-1479a5e134004568245996a22418dadb6b6da6f6.tar.gz
Added /roster size and /occupants size settings
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c6
-rw-r--r--src/ui/window.c5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index d4f6bcc9..9f9b9e2a 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -883,6 +883,9 @@ _cons_occupants_setting(void)
         cons_show("Occupants (/occupants)        : show");
     else
         cons_show("Occupants (/occupants)        : hide");
+
+    int size = prefs_get_occupants_size();
+    cons_show("Occupants size (/occupants)   : %d", size);
 }
 
 static void
@@ -958,6 +961,9 @@ _cons_roster_setting(void)
         cons_show("Roster resource (/roster)     : show");
     else
         cons_show("Roster resource (/roster)     : hide");
+
+    int size = prefs_get_roster_size();
+    cons_show("Roster size (/roster)         : %d", size);
 }
 
 static void
diff --git a/src/ui/window.c b/src/ui/window.c
index 13b84b73..4cd2af66 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -53,9 +53,6 @@
 
 #define CEILING(X) (X-(int)(X) > 0 ? (int)(X+1) : (int)(X))
 
-static int roster_win_percent = 20;
-static int occupants_win_percent = 20;
-
 static void _win_print(ProfWin *window, const char show_char, const char * const date_fmt,
     int flags, int attrs, const char * const from, const char * const message);
 static void _win_print_wrapped(WINDOW *win, const char * const message);
@@ -63,6 +60,7 @@ static void _win_print_wrapped(WINDOW *win, const char * const message);
 int
 win_roster_cols(void)
 {
+    int roster_win_percent = prefs_get_roster_size();
     int cols = getmaxx(stdscr);
     return CEILING( (((double)cols) / 100) * roster_win_percent);
 }
@@ -70,6 +68,7 @@ win_roster_cols(void)
 int
 win_occpuants_cols(void)
 {
+    int occupants_win_percent = prefs_get_occupants_size();
     int cols = getmaxx(stdscr);
     return CEILING( (((double)cols) / 100) * occupants_win_percent);
 }