summaryrefslogtreecommitdiff
path: root/src/gui/gtk/gui-gtk-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/gtk/gui-gtk-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/gtk/gui-gtk-window.c')
-rw-r--r--src/gui/gtk/gui-gtk-window.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/gui/gtk/gui-gtk-window.c b/src/gui/gtk/gui-gtk-window.c
index 5db023317..cecfa8ce7 100644
--- a/src/gui/gtk/gui-gtk-window.c
+++ b/src/gui/gtk/gui-gtk-window.c
@@ -441,11 +441,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;
@@ -454,47 +454,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_height - 1);
+ if (window->win_nick_start <= 1)
+ window->win_nick_start = 0;
gui_nicklist_draw (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_height;
- 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_height)
+ && (window->win_nick_start + window->win_nick_height - 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_height - 1);
+ else
+ window->win_nick_start += (window->win_nick_height - 2);
gui_nicklist_draw (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;
@@ -503,34 +501,36 @@ gui_window_nick_page_up (struct t_gui_window *window)
{
if (window->win_nick_start > 0)
{
- window->win_nick_start -= (window->win_nick_height - 1);
- if (window->win_nick_start <= 1)
- window->win_nick_start = 0;
+ window->win_nick_start = 0;
gui_nicklist_draw (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_height)
- && (window->win_nick_start + window->win_nick_height - 1
- < window->buffer->nicklist_visible_count))
+ new_start =
+ window->buffer->nicklist_visible_count - window->win_nick_height;
+ 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_height - 1);
- else
- window->win_nick_start += (window->win_nick_height - 2);
+ window->win_nick_start = new_start;
gui_nicklist_draw (window->buffer, 1);
}
}