[Bf-blender-cvs] [86061520ec1] master: UI: make text editor scrollbar with consistent with other editors.
Harley Acheson
noreply at git.blender.org
Fri Jan 4 15:29:45 CET 2019
Commit: 86061520ec1180b4c0c59603aa36f0c7bf8933fc
Author: Harley Acheson
Date: Fri Jan 4 15:11:59 2019 +0100
Branches: master
https://developer.blender.org/rB86061520ec1180b4c0c59603aa36f0c7bf8933fc
UI: make text editor scrollbar with consistent with other editors.
Differential Revision: https://developer.blender.org/D4144
===================================================================
M source/blender/editors/space_text/text_draw.c
===================================================================
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index aa499d52589..765bfbd9b83 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -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) {
More information about the Bf-blender-cvs
mailing list