1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Merge pull request #1025 from vague666/prefer_window_name

Add setting to choose between window name and visible name in actlist
This commit is contained in:
ailin-nemui 2019-04-15 10:52:52 +02:00 committed by GitHub
commit 796b60dd45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,6 +78,7 @@ static char *get_activity_list(MAIN_WINDOW_REC *window, int normal, int hilight)
char *ret, *name, *value; char *ret, *name, *value;
int is_det; int is_det;
int add_name = settings_get_bool("actlist_names"); int add_name = settings_get_bool("actlist_names");
int pref_name = settings_get_bool("actlist_prefer_window_name");
str = g_string_new(NULL); str = g_string_new(NULL);
format = g_string_new(NULL); format = g_string_new(NULL);
@ -122,8 +123,11 @@ static char *get_activity_list(MAIN_WINDOW_REC *window, int normal, int hilight)
g_string_printf(format, "{sb_act_hilight_color %s %d", g_string_printf(format, "{sb_act_hilight_color %s %d",
window->hilight_color, window->hilight_color,
window->refnum); window->refnum);
if (add_name && window->active != NULL) if (add_name && window->active != NULL)
g_string_append_printf(format, ":%s", window->active->visible_name); g_string_append_printf(format, ":%s",
pref_name == 1 && window->name != NULL ?
window->name : window->active->visible_name);
g_string_append_c(format, '}'); g_string_append_c(format, '}');
value = theme_format_expand(theme, format->str); value = theme_format_expand(theme, format->str);
@ -470,6 +474,7 @@ void statusbar_items_init(void)
settings_add_time("misc", "lag_min_show", "1sec"); settings_add_time("misc", "lag_min_show", "1sec");
settings_add_str("lookandfeel", "actlist_sort", "refnum"); settings_add_str("lookandfeel", "actlist_sort", "refnum");
settings_add_bool("lookandfeel", "actlist_names", FALSE); settings_add_bool("lookandfeel", "actlist_names", FALSE);
settings_add_bool("lookandfeel", "actlist_prefer_window_name", FALSE);
statusbar_item_register("window", NULL, item_window_active); statusbar_item_register("window", NULL, item_window_active);
statusbar_item_register("window_empty", NULL, item_window_empty); statusbar_item_register("window_empty", NULL, item_window_empty);