mirror of https://github.com/MidnightCommander/mc
Thu Mar 18 16:09:09 1999 Timur Bakeyev <mc@bat.ru>
* panel.h, screen.c: Add an ability to center justify fields in panel, in addition to left and right justificatin. Just for fun. Try =name in user format. * util.c (name_quote): Quote "~@^|;:". Hope, that's all :)
This commit is contained in:
parent
470d754497
commit
79c0c8442f
|
@ -1,3 +1,11 @@
|
|||
Thu Mar 18 16:09:09 1999 Timur Bakeyev <mc@bat.ru>
|
||||
|
||||
* panel.h, screen.c: Add an ability to center justify fields in
|
||||
panel, in addition to left and right justificatin. Just for fun.
|
||||
Try =name in user format.
|
||||
|
||||
* util.c (name_quote): Quote "~@^|;:". Hope, that's all :)
|
||||
|
||||
1999-03-17 Jonathan Blandford <jrb@redhat.com>
|
||||
|
||||
* main.c (main): Put in a warning when run as root.
|
||||
|
|
|
@ -37,6 +37,7 @@ enum panel_display_enum {
|
|||
#define J_CENTER 3
|
||||
|
||||
#define IS_FIT(x) ((x) & 0x0004)
|
||||
#define MAKE_FIT(x) ((x) | 0x0004)
|
||||
#define HIDE_FIT(x) ((x) & 0x0003)
|
||||
|
||||
#define J_LEFT_FIT 5
|
||||
|
|
26
src/screen.c
26
src/screen.c
|
@ -1221,9 +1221,21 @@ parse_display_format (WPanel *panel, char *format, char **error, int isstatus, i
|
|||
|
||||
format = skip_separators (format);
|
||||
|
||||
if (*format == '<' || *format == '>'){
|
||||
if (strchr ("<=>", *format)){
|
||||
set_justify = 1;
|
||||
justify = *format == '<' ? J_LEFT : J_RIGHT;
|
||||
switch (*format)
|
||||
{
|
||||
case '<':
|
||||
justify = J_LEFT;
|
||||
break;
|
||||
case '=':
|
||||
justify = J_CENTER;
|
||||
break;
|
||||
case '>':
|
||||
default:
|
||||
justify = J_RIGHT;
|
||||
break;
|
||||
}
|
||||
format = skip_separators (format+1);
|
||||
} else
|
||||
set_justify = 0;
|
||||
|
@ -1248,12 +1260,14 @@ parse_display_format (WPanel *panel, char *format, char **error, int isstatus, i
|
|||
darr->title = "";
|
||||
darr->id = formats [i].id;
|
||||
darr->expand = formats [i].expands;
|
||||
darr->just_mode = formats [i].default_just;
|
||||
|
||||
if (set_justify)
|
||||
darr->just_mode = justify;
|
||||
else
|
||||
darr->just_mode = formats [i].default_just;
|
||||
|
||||
if (IS_FIT(darr->just_mode))
|
||||
darr->just_mode = MAKE_FIT(justify);
|
||||
else
|
||||
darr->just_mode = justify;
|
||||
|
||||
found = 1;
|
||||
|
||||
format = skip_separators (format);
|
||||
|
|
24
src/util.c
24
src/util.c
|
@ -174,23 +174,29 @@ name_quote (const char *s, int quote_percent)
|
|||
case '\r':
|
||||
case '\n':
|
||||
case '\t':
|
||||
case '$':
|
||||
case '"':
|
||||
case ':':
|
||||
case ';':
|
||||
case ' ':
|
||||
case '?':
|
||||
case '*':
|
||||
case '(':
|
||||
case ')':
|
||||
case '|':
|
||||
case '[':
|
||||
case ']':
|
||||
case '{':
|
||||
case '}':
|
||||
case '<':
|
||||
case '>':
|
||||
case '"':
|
||||
case '!':
|
||||
case '&':
|
||||
case '#':
|
||||
case '`':
|
||||
case ' ':
|
||||
case '~':
|
||||
case '!':
|
||||
case '@':
|
||||
case '#':
|
||||
case '$':
|
||||
case '^':
|
||||
case '&':
|
||||
case '*':
|
||||
case '(':
|
||||
case ')':
|
||||
*d++ = '\\';
|
||||
}
|
||||
*d = *s;
|
||||
|
|
Loading…
Reference in New Issue