mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
Ticket #406 (show filter in panel header)
add: draw filter in panel header near "Name" if format '''Name [filter]'''
This commit is contained in:
parent
522f310871
commit
22c875657a
@ -1208,7 +1208,7 @@ paint_frame (WPanel *panel)
|
||||
int header_len;
|
||||
int side, width;
|
||||
|
||||
const char *txt;
|
||||
char *txt = NULL;
|
||||
if (!panel->split)
|
||||
adjust_top_file (panel);
|
||||
|
||||
@ -1231,7 +1231,11 @@ paint_frame (WPanel *panel)
|
||||
|
||||
for (format = panel->format; format; format = format->next){
|
||||
if (format->string_fn){
|
||||
txt = format->title;
|
||||
if (panel->filter && !strcmp (format->id, "name")) {
|
||||
txt = g_strdup_printf ("%s [%s]", format->title, panel->filter);
|
||||
} else {
|
||||
txt = g_strdup (format->title);
|
||||
}
|
||||
|
||||
header_len = strlen (txt);
|
||||
if (header_len > format->field_len)
|
||||
@ -1239,6 +1243,7 @@ paint_frame (WPanel *panel)
|
||||
|
||||
attrset (MARKED_COLOR);
|
||||
addstr (str_fit_to_term (txt, format->field_len, J_CENTER_LEFT));
|
||||
g_free(txt);
|
||||
width -= format->field_len;
|
||||
} else {
|
||||
attrset (NORMAL_COLOR);
|
||||
|
Loading…
Reference in New Issue
Block a user