Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-02-18 16:57:54 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2011-02-18 16:57:54 +0300
commit8856b598fdb411bac0dd65053a1d91093c8cac3b (patch)
tree2272db65f171eeee0723eef8b8fb677dfe0c159d /source/blender/editors/space_text
parent5531f3093a62bffe4a0220180e740fa8ea3d76ef (diff)
Another small text space usability: option to show right margin (aka print marign)
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r--source/blender/editors/space_text/space_text.c1
-rw-r--r--source/blender/editors/space_text/text_draw.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index 85b9f1b68e6..3a9b8924eed 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -71,6 +71,7 @@ static SpaceLink *text_new(const bContext *UNUSED(C))
stext->lheight= 12;
stext->tabnumber= 4;
+ stext->margin_column= 80;
/* header */
ar= MEM_callocN(sizeof(ARegion), "header for text");
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index bc0eb0a773f..b3e6920aa29 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1779,6 +1779,15 @@ void draw_text_main(SpaceText *st, ARegion *ar)
wrap_skip= 0;
}
+ if(st->flags&ST_SHOW_MARGIN) {
+ UI_ThemeColor(TH_HILITE);
+
+ glBegin(GL_LINES);
+ glVertex2i(x+st->cwidth*st->margin_column, 0);
+ glVertex2i(x+st->cwidth*st->margin_column, ar->winy - 2);
+ glEnd();
+ }
+
/* draw other stuff */
draw_brackets(st, ar);
draw_markers(st, ar);