about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-10-07 00:59:17 +0100
committerJames Booth <boothj5@gmail.com>2013-10-07 00:59:17 +0100
commit2d534fb278e85b9618852a8a4312eda0352666f8 (patch)
tree136d50a32b3a2fb09d19bbe3fae93529ec1a7eca
parentacf1afe02538d51b7b613b75334c824e2d314cf4 (diff)
downloadprofani-tty-2d534fb278e85b9618852a8a4312eda0352666f8.tar.gz
Added win_page_off
-rw-r--r--src/ui/core.c14
-rw-r--r--src/ui/window.c15
-rw-r--r--src/ui/window.h1
3 files changed, 18 insertions, 12 deletions
diff --git a/src/ui/core.c b/src/ui/core.c
index 24e8b822..6a49bfb4 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -744,18 +744,8 @@ void
 ui_current_page_off(void)
 {
     ProfWin *current = wins_get_current();
-    current->paged = 0;
-
-    int rows = getmaxy(stdscr);
-    int y = getcury(current->win);
-    int size = rows - 3;
-
-    current->y_pos = y - (size - 1);
-    if (current->y_pos < 0) {
-        current->y_pos = 0;
-    }
-
-    wins_refresh_current();
+    win_page_off(current);
+    win_refresh(current);
 }
 
 void
diff --git a/src/ui/window.c b/src/ui/window.c
index caad2531..135eac17 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -133,6 +133,21 @@ win_refresh(ProfWin *window)
 }
 
 void
+win_page_off(ProfWin *window)
+{
+    window->paged = 0;
+
+    int rows = getmaxy(stdscr);
+    int y = getcury(window->win);
+    int size = rows - 3;
+
+    window->y_pos = y - (size - 1);
+    if (window->y_pos < 0) {
+        window->y_pos = 0;
+    }
+}
+
+void
 win_presence_colour_on(ProfWin *window, const char * const presence)
 {
     if (g_strcmp0(presence, "online") == 0) {
diff --git a/src/ui/window.h b/src/ui/window.h
index 00e905e1..dea6214d 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -63,6 +63,7 @@ void win_free(ProfWin *window);
 void win_print_line(ProfWin *self, const char show_char, int attrs,
     const char * const msg, ...);
 void win_refresh(ProfWin *window);
+void win_page_off(ProfWin *window);
 void win_print_time(ProfWin *window, char show_char);
 void win_presence_colour_on(ProfWin *window, const char * const presence);
 void win_presence_colour_off(ProfWin *window, const char * const presence);