diff options
-rw-r--r-- | source/blender/editors/screen/area.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_intern.h | 5 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_text_types.h | 2 |
5 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index f83af1d5167..9e7034b6475 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1390,6 +1390,8 @@ void ED_region_panels_init(wmWindowManager *wm, ARegion *ar) // XXX quick hacks for files saved with 2.5 already (i.e. the builtin defaults file) // scrollbars for button regions ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); + ar->v2d.scroll |= V2D_SCROLL_HORIZONTAL_HIDE; + ar->v2d.scroll &= ~V2D_SCROLL_VERTICAL_HIDE; ar->v2d.keepzoom |= V2D_KEEPZOOM; // correctly initialised User-Prefs? diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index b74e1f6cfb2..48e860ed88a 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -456,10 +456,11 @@ def wrap(line, view_width, wrap_chars): int wrap_width(SpaceText *st, ARegion *ar) { + int winx= ar->winx - TXT_SCROLL_WIDTH; int x, max; x= st->showlinenrs ? TXT_OFFSET + TEXTXLOC : TXT_OFFSET; - max= (ar->winx-x)/st->cwidth; + max= (winx-x)/st->cwidth; return max>8 ? max : 8; } @@ -1209,7 +1210,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) TextLine *tmp; rcti scroll; char linenr[12]; - int i, x, y, linecount= 0; + int i, x, y, winx, linecount= 0; /* if no text, nothing to do */ if(!text) @@ -1252,6 +1253,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) x= TXT_OFFSET; } y= ar->winy-st->lheight; + winx= ar->winx - TXT_SCROLL_WIDTH; /* draw cursor */ draw_cursor(st, ar); @@ -1279,7 +1281,7 @@ void draw_text_main(SpaceText *st, ARegion *ar) if(st->wordwrap) { /* draw word wrapped text */ - int lines = text_draw_wrapped(st, tmp->line, x, y, ar->winx-x, tmp->format); + int lines = text_draw_wrapped(st, tmp->line, x, y, winx-x, tmp->format); y -= lines*st->lheight; } else { @@ -1325,6 +1327,8 @@ void text_update_cursor_moved(bContext *C) for(ar=sa->regionbase.first; ar; ar= ar->next) if(ar->regiontype==RGN_TYPE_WINDOW) winx= ar->winx; + + winx -= TXT_SCROLL_WIDTH; if(!text || !text->curl) return; diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 5e3070c4718..59ca649dee8 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -58,6 +58,11 @@ void text_update_edited(struct Text *text); void text_update_character_width(struct SpaceText *st); void text_update_cursor_moved(struct bContext *C); + /* TXT_OFFSET used to be 35 when the scrollbar was on the left... */ +#define TXT_OFFSET 15 +#define TXT_SCROLL_WIDTH 20 +#define TXT_SCROLL_SPACE 2 + #define TEXTXLOC (st->cwidth * st->linenrs_tot) #define SUGG_LIST_SIZE 7 diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 58d8e6b3363..d0a3fd3c1d9 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1882,7 +1882,8 @@ static int scroll_bar_invoke(bContext *C, wmOperator *op, wmEvent *event) return scroll_exec(C, op); /* verify we are in the right zone */ - if(!(mval[0]>ar->winx-20 && mval[0]<ar->winx-2 && mval[1]>2 && mval[1]<ar->winy)) + if(!(mval[0]>ar->winx-TXT_SCROLL_WIDTH && mval[0]<ar->winx-TXT_SCROLL_SPACE + && mval[1]>TXT_SCROLL_SPACE && mval[1]<ar->winy)) return OPERATOR_PASS_THROUGH; tsc= MEM_callocN(sizeof(TextScroll), "TextScroll"); diff --git a/source/blender/makesdna/DNA_text_types.h b/source/blender/makesdna/DNA_text_types.h index 9a9daf56e8a..f37e8d01776 100644 --- a/source/blender/makesdna/DNA_text_types.h +++ b/source/blender/makesdna/DNA_text_types.h @@ -70,8 +70,6 @@ typedef struct Text { double mtime; } Text; - /* TXT_OFFSET used to be 35 when the scrollbar was on the left... */ -#define TXT_OFFSET 15 #define TXT_TABSIZE 4 #define TXT_INIT_UNDO 1024 #define TXT_MAX_UNDO (TXT_INIT_UNDO*TXT_INIT_UNDO) |