mirror of
https://github.com/weechat/weechat.git
synced 2026-07-02 15:53:12 +02:00
Keys alt-{home|end} to scroll top/bottom, alt-{f11-f12} to scroll nicklist top/bottom
This commit is contained in:
@@ -2795,6 +2795,44 @@ gui_window_scroll_down (t_gui_window *window)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_scroll_top: scroll to top of buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_scroll_top (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (!window->first_line_displayed)
|
||||
{
|
||||
window->start_line = window->buffer->lines;
|
||||
window->start_line_pos = 0;
|
||||
gui_draw_buffer_chat (window->buffer, 0);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_scroll_bottom: scroll to bottom of buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_scroll_bottom (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (window->start_line)
|
||||
{
|
||||
window->start_line = NULL;
|
||||
window->start_line_pos = 0;
|
||||
gui_draw_buffer_chat (window->buffer, 0);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_nick_beginning: go to beginning of nicklist
|
||||
*/
|
||||
|
||||
@@ -89,11 +89,13 @@ gui_input_default_key_bindings ()
|
||||
gui_key_bind ( /* pgdn */ "meta2-6~", "page_down");
|
||||
gui_key_bind ( /* m-pgup */ "meta-meta2-5~", "scroll_up");
|
||||
gui_key_bind ( /* m-pgdn */ "meta-meta2-6~", "scroll_down");
|
||||
gui_key_bind ( /* m-home */ "meta-meta2-1~", "scroll_top");
|
||||
gui_key_bind ( /* m-end */ "meta-meta2-4~", "scroll_bottom");
|
||||
gui_key_bind ( /* F10 */ "meta2-21~", "infobar_clear");
|
||||
gui_key_bind ( /* F11 */ "meta2-23~", "nick_page_up");
|
||||
gui_key_bind ( /* F12 */ "meta2-24~", "nick_page_down");
|
||||
gui_key_bind ( /* m-F11 */ "meta-meta2-1~", "nick_beginning");
|
||||
gui_key_bind ( /* m-F12 */ "meta-meta2-4~", "nick_end");
|
||||
gui_key_bind ( /* m-F11 */ "meta-meta2-23~", "nick_beginning");
|
||||
gui_key_bind ( /* m-F12 */ "meta-meta2-24~", "nick_end");
|
||||
gui_key_bind ( /* ^L */ "ctrl-L", "refresh");
|
||||
gui_key_bind ( /* m-a */ "meta-a", "jump_smart");
|
||||
gui_key_bind ( /* m-b */ "meta-b", "previous_word");
|
||||
|
||||
@@ -1475,6 +1475,44 @@ gui_window_scroll_down (t_gui_window *window)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_scroll_top: scroll to top of buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_scroll_top (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (!window->first_line_displayed)
|
||||
{
|
||||
window->start_line = window->buffer->lines;
|
||||
window->start_line_pos = 0;
|
||||
gui_draw_buffer_chat (window->buffer, 0);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_scroll_bottom: scroll to bottom of buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_window_scroll_bottom (t_gui_window *window)
|
||||
{
|
||||
if (!gui_ok)
|
||||
return;
|
||||
|
||||
if (window->start_line)
|
||||
{
|
||||
window->start_line = NULL;
|
||||
window->start_line_pos = 0;
|
||||
gui_draw_buffer_chat (window->buffer, 0);
|
||||
gui_draw_buffer_status (window->buffer, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_window_nick_beginning: go to beginning of nicklist
|
||||
*/
|
||||
@@ -2152,7 +2190,6 @@ void
|
||||
gui_init ()
|
||||
{
|
||||
GdkColor color_fg, color_bg;
|
||||
GtkRcStyle *rc_style;
|
||||
|
||||
gui_init_colors ();
|
||||
|
||||
|
||||
@@ -898,6 +898,26 @@ gui_action_scroll_down (t_gui_window *window)
|
||||
gui_window_scroll_down (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_action_scroll_top: scroll to top of buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_action_scroll_top (t_gui_window *window)
|
||||
{
|
||||
gui_window_scroll_top (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_action_scroll_bottom: scroll to bottom of buffer
|
||||
*/
|
||||
|
||||
void
|
||||
gui_action_scroll_bottom (t_gui_window *window)
|
||||
{
|
||||
gui_window_scroll_bottom (window);
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_action_nick_beginning: go to beginning of nicklist
|
||||
*/
|
||||
|
||||
@@ -91,6 +91,10 @@ t_gui_key_function gui_key_functions[] =
|
||||
N_("scroll a few lines up") },
|
||||
{ "scroll_down", gui_action_scroll_down,
|
||||
N_("scroll a few lines down") },
|
||||
{ "scroll_top", gui_action_scroll_top,
|
||||
N_("scroll to top of buffer") },
|
||||
{ "scroll_bottom", gui_action_scroll_bottom,
|
||||
N_("scroll to bottom of buffer") },
|
||||
{ "nick_beginning", gui_action_nick_beginning,
|
||||
N_("display beginning of nicklist") },
|
||||
{ "nick_end", gui_action_nick_end,
|
||||
|
||||
@@ -473,6 +473,8 @@ extern void gui_action_page_up (t_gui_window *);
|
||||
extern void gui_action_page_down (t_gui_window *);
|
||||
extern void gui_action_scroll_up (t_gui_window *);
|
||||
extern void gui_action_scroll_down (t_gui_window *);
|
||||
extern void gui_action_scroll_top (t_gui_window *);
|
||||
extern void gui_action_scroll_bottom (t_gui_window *);
|
||||
extern void gui_action_nick_beginning (t_gui_window *);
|
||||
extern void gui_action_nick_end (t_gui_window *);
|
||||
extern void gui_action_nick_page_up (t_gui_window *);
|
||||
@@ -530,6 +532,8 @@ extern void gui_window_page_up (t_gui_window *);
|
||||
extern void gui_window_page_down (t_gui_window *);
|
||||
extern void gui_window_scroll_up (t_gui_window *);
|
||||
extern void gui_window_scroll_down (t_gui_window *);
|
||||
extern void gui_window_scroll_top (t_gui_window *);
|
||||
extern void gui_window_scroll_bottom (t_gui_window *);
|
||||
extern void gui_window_nick_beginning (t_gui_window *);
|
||||
extern void gui_window_nick_end (t_gui_window *);
|
||||
extern void gui_window_nick_page_up (t_gui_window *);
|
||||
|
||||
Reference in New Issue
Block a user