mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Added capability to draw single or double lines.
Fixed tty_print_alt_char() to draw single or double vertical or horizintal lines. Added argument to tty_print_one_hline() and tty_print_one_vline() functions to draw single or double lines. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
cc2f5670ec
commit
9a145a88ce
@ -343,9 +343,9 @@ void
|
||||
tty_print_alt_char (int c, gboolean single)
|
||||
{
|
||||
if ((chtype) c == ACS_VLINE)
|
||||
c = mc_tty_ugly_frm[MC_TTY_FRM_thinvert];
|
||||
c = mc_tty_ugly_frm[single ? MC_TTY_FRM_thinvert: MC_TTY_FRM_vert];
|
||||
else if ((chtype) c == ACS_HLINE)
|
||||
c = mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz];
|
||||
c = mc_tty_ugly_frm[single ? MC_TTY_FRM_thinhoriz : MC_TTY_FRM_horiz];
|
||||
else if ((chtype) c == ACS_LTEE)
|
||||
c = mc_tty_ugly_frm[single ? MC_TTY_FRM_grpleftmiddle : MC_TTY_FRM_leftmiddle];
|
||||
else if ((chtype) c == ACS_RTEE)
|
||||
|
@ -503,10 +503,10 @@ tty_print_alt_char (int c, gboolean single)
|
||||
: SLsmg_write_char ((unsigned int) y)
|
||||
switch (c) {
|
||||
case ACS_VLINE:
|
||||
DRAW (c, mc_tty_ugly_frm[MC_TTY_FRM_thinvert]);
|
||||
DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_thinvert : MC_TTY_FRM_vert]);
|
||||
break;
|
||||
case ACS_HLINE:
|
||||
DRAW (c, mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz]);
|
||||
DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_thinhoriz : MC_TTY_FRM_horiz]);
|
||||
break;
|
||||
case ACS_LTEE:
|
||||
DRAW (c, mc_tty_ugly_frm[single ? MC_TTY_FRM_grpleftmiddle : MC_TTY_FRM_leftmiddle]);
|
||||
|
@ -126,15 +126,15 @@ tty_got_interrupt (void)
|
||||
}
|
||||
|
||||
void
|
||||
tty_print_one_hline (void)
|
||||
tty_print_one_hline (gboolean single)
|
||||
{
|
||||
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_thinhoriz], FALSE);
|
||||
tty_print_alt_char (ACS_HLINE, single);
|
||||
}
|
||||
|
||||
void
|
||||
tty_print_one_vline (void)
|
||||
tty_print_one_vline (gboolean single)
|
||||
{
|
||||
tty_print_alt_char (mc_tty_ugly_frm[MC_TTY_FRM_thinvert], FALSE);
|
||||
tty_print_alt_char (ACS_VLINE, single);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -71,8 +71,8 @@ extern void tty_print_anychar (int c);
|
||||
extern void tty_print_string (const char *s);
|
||||
extern void tty_printf (const char *s, ...);
|
||||
|
||||
extern void tty_print_one_vline (void);
|
||||
extern void tty_print_one_hline (void);
|
||||
extern void tty_print_one_vline (gboolean single);
|
||||
extern void tty_print_one_hline (gboolean single);
|
||||
extern void tty_draw_hline (int y, int x, int ch, int len);
|
||||
extern void tty_draw_vline (int y, int x, int ch, int len);
|
||||
extern void tty_draw_box (int y, int x, int rows, int cols);
|
||||
|
@ -747,7 +747,7 @@ format_file (char *dest, int limit, WPanel * panel, int file_index, int width, i
|
||||
tty_setcolor (SELECTED_COLOR);
|
||||
else
|
||||
tty_setcolor (NORMAL_COLOR);
|
||||
tty_print_one_vline ();
|
||||
tty_print_one_vline (TRUE);
|
||||
length++;
|
||||
}
|
||||
}
|
||||
@ -803,7 +803,7 @@ repaint_file (WPanel * panel, int file_index, int mv, int attr, int isstatus)
|
||||
else
|
||||
{
|
||||
tty_setcolor (NORMAL_COLOR);
|
||||
tty_print_one_vline ();
|
||||
tty_print_one_vline (TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1515,7 +1515,7 @@ paint_frame (WPanel * panel)
|
||||
if (side)
|
||||
{
|
||||
tty_setcolor (NORMAL_COLOR);
|
||||
tty_print_one_vline ();
|
||||
tty_print_one_vline (TRUE);
|
||||
width = panel->widget.cols - panel->widget.cols / 2 - 1;
|
||||
}
|
||||
else if (panel->split)
|
||||
@ -1551,7 +1551,7 @@ paint_frame (WPanel * panel)
|
||||
else
|
||||
{
|
||||
tty_setcolor (NORMAL_COLOR);
|
||||
tty_print_one_vline ();
|
||||
tty_print_one_vline (TRUE);
|
||||
width--;
|
||||
}
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ mcview_display_hex (mcview_t * view)
|
||||
{
|
||||
if (view->data_area.width >= 80 && col < width)
|
||||
{
|
||||
tty_print_one_vline ();
|
||||
tty_print_one_vline (TRUE);
|
||||
col += 1;
|
||||
}
|
||||
if (col < width)
|
||||
|
@ -2254,14 +2254,14 @@ listbox_drawscroll (WListbox * l)
|
||||
/* Are we at the top? */
|
||||
widget_move (&l->widget, 0, l->widget.cols);
|
||||
if (l->top == 0)
|
||||
tty_print_one_vline ();
|
||||
tty_print_one_vline (TRUE);
|
||||
else
|
||||
tty_print_char ('^');
|
||||
|
||||
/* Are we at the bottom? */
|
||||
widget_move (&l->widget, max_line, l->widget.cols);
|
||||
if ((l->top + l->widget.lines == l->count) || (l->widget.lines >= l->count))
|
||||
tty_print_one_vline ();
|
||||
tty_print_one_vline (TRUE);
|
||||
else
|
||||
tty_print_char ('v');
|
||||
|
||||
@ -2273,7 +2273,7 @@ listbox_drawscroll (WListbox * l)
|
||||
{
|
||||
widget_move (&l->widget, i, l->widget.cols);
|
||||
if (i != line)
|
||||
tty_print_one_vline ();
|
||||
tty_print_one_vline (TRUE);
|
||||
else
|
||||
tty_print_char ('*');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user