summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-curses-window.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-04-18 12:56:21 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-04-18 12:56:21 +0200
commitb31c3efc8afafea429b11644e3509bda76188558 (patch)
tree47a5f29ecf4ad7dbc6d708066771cfa8d10b6261 /src/gui/curses/gui-curses-window.c
parente349ae491a9ce9bebd38b14e41c95aabe694a7ed (diff)
downloadweechat-b31c3efc8afafea429b11644e3509bda76188558.zip
Use of /window command for some key bindings with actions on current window (like scroll, ..)
Diffstat (limited to 'src/gui/curses/gui-curses-window.c')
-rw-r--r--src/gui/curses/gui-curses-window.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index bfd018190..8f6bfed97 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -969,11 +969,11 @@ gui_window_scroll_topic_right (struct t_gui_window *window)
}
/*
- * gui_window_nick_beginning: go to beginning of nicklist
+ * gui_window_nicklist_page_up: scroll one page up in nicklist
*/
void
-gui_window_nick_beginning (struct t_gui_window *window)
+gui_window_nicklist_page_up (struct t_gui_window *window)
{
if (!gui_ok)
return;
@@ -982,47 +982,45 @@ gui_window_nick_beginning (struct t_gui_window *window)
{
if (window->win_nick_start > 0)
{
- window->win_nick_start = 0;
+ window->win_nick_start -= (window->win_nick_num_max - 1);
+ if (window->win_nick_start <= 1)
+ window->win_nick_start = 0;
gui_buffer_ask_nicklist_refresh (window->buffer, 1);
}
}
}
/*
- * gui_window_nick_end: go to the end of nicklist
+ * gui_window_nicklist_page_down: scroll one page down in nicklist
*/
void
-gui_window_nick_end (struct t_gui_window *window)
+gui_window_nicklist_page_down (struct t_gui_window *window)
{
- int new_start;
-
if (!gui_ok)
return;
if (window->buffer->nicklist)
{
- new_start =
- window->buffer->nicklist_visible_count - window->win_nick_num_max;
- if (new_start < 0)
- new_start = 0;
- else if (new_start >= 1)
- new_start++;
-
- if (new_start != window->win_nick_start)
+ if ((window->buffer->nicklist_visible_count > window->win_nick_num_max)
+ && (window->win_nick_start + window->win_nick_num_max - 1
+ < window->buffer->nicklist_visible_count))
{
- window->win_nick_start = new_start;
+ if (window->win_nick_start == 0)
+ window->win_nick_start += (window->win_nick_num_max - 1);
+ else
+ window->win_nick_start += (window->win_nick_num_max - 2);
gui_buffer_ask_nicklist_refresh (window->buffer, 1);
}
}
}
/*
- * gui_window_nick_page_up: scroll one page up in nicklist
+ * gui_window_nicklist_beginning: go to beginning of nicklist
*/
void
-gui_window_nick_page_up (struct t_gui_window *window)
+gui_window_nicklist_beginning (struct t_gui_window *window)
{
if (!gui_ok)
return;
@@ -1031,34 +1029,36 @@ gui_window_nick_page_up (struct t_gui_window *window)
{
if (window->win_nick_start > 0)
{
- window->win_nick_start -= (window->win_nick_num_max - 1);
- if (window->win_nick_start <= 1)
- window->win_nick_start = 0;
+ window->win_nick_start = 0;
gui_buffer_ask_nicklist_refresh (window->buffer, 1);
}
}
}
/*
- * gui_window_nick_page_down: scroll one page down in nicklist
+ * gui_window_nicklist_end: go to the end of nicklist
*/
void
-gui_window_nick_page_down (struct t_gui_window *window)
+gui_window_nicklist_end (struct t_gui_window *window)
{
+ int new_start;
+
if (!gui_ok)
return;
if (window->buffer->nicklist)
{
- if ((window->buffer->nicklist_visible_count > window->win_nick_num_max)
- && (window->win_nick_start + window->win_nick_num_max - 1
- < window->buffer->nicklist_visible_count))
+ new_start =
+ window->buffer->nicklist_visible_count - window->win_nick_num_max;
+ if (new_start < 0)
+ new_start = 0;
+ else if (new_start >= 1)
+ new_start++;
+
+ if (new_start != window->win_nick_start)
{
- if (window->win_nick_start == 0)
- window->win_nick_start += (window->win_nick_num_max - 1);
- else
- window->win_nick_start += (window->win_nick_num_max - 2);
+ window->win_nick_start = new_start;
gui_buffer_ask_nicklist_refresh (window->buffer, 1);
}
}