mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
Improve display of filter indicator in status bar, add option for color
This commit is contained in:
@@ -127,6 +127,7 @@ struct t_config_option *config_color_chat_text_found_bg;
|
||||
struct t_config_option *config_color_chat_value;
|
||||
struct t_config_option *config_color_status_number;
|
||||
struct t_config_option *config_color_status_name;
|
||||
struct t_config_option *config_color_status_filter;
|
||||
struct t_config_option *config_color_status_data_msg;
|
||||
struct t_config_option *config_color_status_data_private;
|
||||
struct t_config_option *config_color_status_data_highlight;
|
||||
@@ -1649,6 +1650,12 @@ config_weechat_init_options ()
|
||||
N_("text color for current buffer name in status bar"),
|
||||
NULL, -1, 0, "white", NULL, 0,
|
||||
NULL, NULL, &config_change_color, NULL, NULL, NULL);
|
||||
config_color_status_filter = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"status_filter", "color",
|
||||
N_("text color for filter indicator in status bar"),
|
||||
NULL, -1, 0, "green", NULL, 0,
|
||||
NULL, NULL, &config_change_color, NULL, NULL, NULL);
|
||||
config_color_status_data_msg = config_file_new_option (
|
||||
weechat_config_file, ptr_section,
|
||||
"status_data_msg", "color",
|
||||
|
||||
@@ -133,6 +133,7 @@ extern struct t_config_option *config_color_chat_text_found_bg;
|
||||
extern struct t_config_option *config_color_chat_value;
|
||||
extern struct t_config_option *config_color_status_number;
|
||||
extern struct t_config_option *config_color_status_name;
|
||||
extern struct t_config_option *config_color_status_filter;
|
||||
extern struct t_config_option *config_color_status_data_msg;
|
||||
extern struct t_config_option *config_color_status_data_private;
|
||||
extern struct t_config_option *config_color_status_data_highlight;
|
||||
|
||||
@@ -881,13 +881,12 @@ gui_bar_item_default_buffer_filter (void *data, struct t_gui_bar_item *item,
|
||||
if (!window)
|
||||
window = gui_current_window;
|
||||
|
||||
if (!gui_filters_enabled || !gui_filters)
|
||||
if (!gui_filters_enabled || !gui_filters || !window->buffer->lines_hidden)
|
||||
return NULL;
|
||||
|
||||
snprintf (buf, sizeof (buf),
|
||||
"F%s%s",
|
||||
(window->buffer->lines_hidden) ? "," : "",
|
||||
(window->buffer->lines_hidden) ? _("filtered") : "");
|
||||
"%s*",
|
||||
gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_status_filter))));
|
||||
|
||||
return strdup (buf);
|
||||
}
|
||||
|
||||
+3
-3
@@ -1977,9 +1977,9 @@ gui_bar_create_default_status ()
|
||||
+ 1 /* ":" */
|
||||
+ strlen (gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NAME])
|
||||
+ strlen (gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT])
|
||||
+ strlen (gui_bar_item_names[GUI_BAR_ITEM_BUFFER_FILTER])
|
||||
+ 3 /* "lag" */
|
||||
+ strlen (gui_bar_item_names[GUI_BAR_ITEM_HOTLIST])
|
||||
+ strlen (gui_bar_item_names[GUI_BAR_ITEM_BUFFER_FILTER])
|
||||
+ strlen (gui_bar_item_names[GUI_BAR_ITEM_COMPLETION])
|
||||
+ strlen (gui_bar_item_names[GUI_BAR_ITEM_SCROLL])
|
||||
+ (12 * 4) /* all items delimiters: ",:+[]()" */
|
||||
@@ -1987,15 +1987,15 @@ gui_bar_create_default_status ()
|
||||
buf = malloc (length);
|
||||
if (buf)
|
||||
{
|
||||
snprintf (buf, length, "[%s],[%s],[%s],%s+:+%s+{%s},[lag],[%s],[%s],%s,%s",
|
||||
snprintf (buf, length, "[%s],[%s],[%s],%s+:+%s+{%s}+%s,[lag],[%s],%s,%s",
|
||||
gui_bar_item_names[GUI_BAR_ITEM_TIME],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_COUNT],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_PLUGIN],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NUMBER],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NAME],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_NICKLIST_COUNT],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_HOTLIST],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_BUFFER_FILTER],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_HOTLIST],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_COMPLETION],
|
||||
gui_bar_item_names[GUI_BAR_ITEM_SCROLL]);
|
||||
if (gui_bar_new (GUI_BAR_DEFAULT_NAME_STATUS,
|
||||
|
||||
Reference in New Issue
Block a user