diff options
Diffstat (limited to 'src/gui/curses')
-rw-r--r-- | src/gui/curses/gui-curses-bar-window.c | 12 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-chat.c | 9 | ||||
-rw-r--r-- | src/gui/curses/gui-curses-window.c | 21 | ||||
-rw-r--r-- | src/gui/curses/gui-curses.h | 1 |
4 files changed, 35 insertions, 8 deletions
diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index 768a00d9e..5e96381d1 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -405,7 +405,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, int length_on_screen, chars_available; int length_screen_before_cursor, length_screen_after_cursor; int total_length_screen, diff, max_length, optimal_number_of_lines; - int some_data_not_displayed; + int some_data_not_displayed, hline_char; if (!gui_init_ok) return; @@ -615,6 +615,8 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, wnoutrefresh (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar); + hline_char = gui_window_get_hline_char (); + if (CONFIG_INTEGER(bar_window->bar->options[GUI_BAR_OPTION_SEPARATOR])) { switch (CONFIG_INTEGER(bar_window->bar->options[GUI_BAR_OPTION_POSITION])) @@ -622,14 +624,16 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, case GUI_BAR_POSITION_BOTTOM: gui_window_set_weechat_color (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, GUI_COLOR_SEPARATOR); - mvwhline (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, 0, 0, ACS_HLINE, - bar_window->width); + mvwhline (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, 0, 0, + hline_char, bar_window->width); break; case GUI_BAR_POSITION_TOP: gui_window_set_weechat_color (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, GUI_COLOR_SEPARATOR); mvwhline (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, - 0, 0, ACS_HLINE, bar_window->width); + 0, 0, + hline_char, + bar_window->width); break; case GUI_BAR_POSITION_LEFT: gui_window_set_weechat_color (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index aac84aad1..f4bd74224 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -128,7 +128,9 @@ gui_chat_display_new_line (struct t_gui_window *window, int num_lines, int count void gui_chat_display_horizontal_line (struct t_gui_window *window, int simulate) { - int i, n; + int i, n, hline_char; + + hline_char = gui_window_get_hline_char (); if (!simulate) { @@ -139,8 +141,7 @@ gui_chat_display_horizontal_line (struct t_gui_window *window, int simulate) case CONFIG_LOOK_READ_MARKER_LINE: mvwhline (GUI_WINDOW_OBJECTS(window)->win_chat, window->win_chat_cursor_y, window->win_chat_cursor_x, - ACS_HLINE, - window->win_chat_width - 1); + hline_char, window->win_chat_width - 1); break; case CONFIG_LOOK_READ_MARKER_DOTTED_LINE: wmove (GUI_WINDOW_OBJECTS(window)->win_chat, @@ -152,7 +153,7 @@ gui_chat_display_horizontal_line (struct t_gui_window *window, int simulate) if (i % 2 == n) mvwhline (GUI_WINDOW_OBJECTS(window)->win_chat, window->win_chat_cursor_y, i, - ACS_HLINE, 1); + hline_char, 1); } break; default: diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 2db24ab52..823969071 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -34,6 +34,7 @@ #include "../../core/wee-hook.h" #include "../../core/wee-log.h" #include "../../core/wee-string.h" +#include "../../core/wee-utf8.h" #include "../../plugins/plugin.h" #include "../gui-window.h" #include "../gui-bar.h" @@ -160,6 +161,26 @@ gui_window_utf_char_valid (const char *utf_char) } /* + * gui_window_get_hline_char: get char used to draw horizontal lines + * Note: ACS_HLINE from ncurses is better for + * render, but it introduces bug with URLs + * selected by terminal: below this line, + * some URLs are not visible or shifted + */ + +int +gui_window_get_hline_char () +{ + const char *hline_char; + + hline_char = CONFIG_STRING(config_look_hline_char); + if (!hline_char || !hline_char[0]) + return ACS_HLINE; + + return utf8_char_int (hline_char); +} + +/* * gui_window_wprintw: decode then display string with wprintw */ diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h index 70f89b5cc..30ac8f71d 100644 --- a/src/gui/curses/gui-curses.h +++ b/src/gui/curses/gui-curses.h @@ -77,6 +77,7 @@ extern int gui_keyboard_read_cb (void *data, int fd); extern void gui_window_read_terminal_size (); extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer); extern int gui_window_utf_char_valid (const char *utf_char); +extern int gui_window_get_hline_char (); extern void gui_window_clear (WINDOW *window, int bg); extern void gui_window_reset_style (WINDOW *window, int num_color); extern void gui_window_set_color_style (WINDOW *window, int style); |