UI: make text editor scrollbar with consistent with other editors.
Differential Revision: https://developer.blender.org/D4144
This commit is contained in:
parent
07c61e0ad8
commit
86061520ec
|
@ -798,22 +798,22 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back)
|
|||
short barheight, barstart, hlstart, hlend, blank_lines;
|
||||
short pix_available, pix_top_margin, pix_bottom_margin, pix_bardiff;
|
||||
|
||||
pix_top_margin = 8;
|
||||
pix_bottom_margin = 4;
|
||||
pix_top_margin = (0.4 * U.widget_unit);
|
||||
pix_bottom_margin = (0.4 * U.widget_unit);
|
||||
pix_available = ar->winy - pix_top_margin - pix_bottom_margin;
|
||||
ltexth = text_get_total_lines(st, ar);
|
||||
blank_lines = st->viewlines / 2;
|
||||
|
||||
/* nicer code: use scroll rect for entire bar */
|
||||
back->xmin = ar->winx - (V2D_SCROLL_WIDTH + 1);
|
||||
back->xmin = ar->winx - (0.6 * U.widget_unit);
|
||||
back->xmax = ar->winx;
|
||||
back->ymin = 0;
|
||||
back->ymax = ar->winy;
|
||||
|
||||
scroll->xmin = ar->winx - V2D_SCROLL_WIDTH;
|
||||
scroll->xmax = ar->winx - 5;
|
||||
scroll->ymin = 4;
|
||||
scroll->ymax = 4 + pix_available;
|
||||
scroll->xmax = ar->winx - (0.2 * U.widget_unit);
|
||||
scroll->xmin = scroll->xmax - (0.4 * U.widget_unit);
|
||||
scroll->ymin = pix_top_margin;
|
||||
scroll->ymax = pix_available;
|
||||
|
||||
/* when re-sizing a view-port with the bar at the bottom to a greater height more blank lines will be added */
|
||||
if (ltexth + blank_lines < st->top + st->viewlines) {
|
||||
|
|
Loading…
Reference in New Issue