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:
authorHarley Acheson <harley.acheson@gmail.com>2019-11-20 23:59:19 +0300
committerHarley Acheson <harley.acheson@gmail.com>2019-11-20 23:59:19 +0300
commit8c6ce742391b2b8798143a4a2c2224ebbeb7f1ec (patch)
tree19a14cc1b2fdf37d71d0112955ec33d725126b97 /source/blender/editors/space_text/text_intern.h
parent0418e2894467ee53a319b1f865422d8e5b139a03 (diff)
UI: Text Editor Visual Changes
Various small changes to Text Editor, mostly to do with scaling, alignment, and theme support. Differential Revision: https://developer.blender.org/D6268 Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/space_text/text_intern.h')
-rw-r--r--source/blender/editors/space_text/text_intern.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h
index 7a1dd312d02..fb81f9a9553 100644
--- a/source/blender/editors/space_text/text_intern.h
+++ b/source/blender/editors/space_text/text_intern.h
@@ -44,11 +44,25 @@ void text_scroll_to_cursor(struct SpaceText *st, struct ARegion *ar, const bool
void text_scroll_to_cursor__area(struct SpaceText *st, struct ScrArea *sa, const bool center);
void text_update_cursor_moved(struct bContext *C);
-#define TXT_OFFSET ((int)(0.5f * U.widget_unit))
+/* Padding around line numbers in character widths. */
+#define TXT_NUMCOL_PAD 1.0f
+/* Total width of the optional line numbers column. */
+#define TXT_NUMCOL_WIDTH(st) (st->cwidth * (st->linenrs_tot + (2 * TXT_NUMCOL_PAD)))
+
+/* Padding on left of body text in character units. */
+#define TXT_BODY_LPAD 1.0f
+/* Left position of body text. */
+#define TXT_BODY_LEFT(st) (st->showlinenrs ? TXT_NUMCOL_WIDTH(st) : 0) + (TXT_BODY_LPAD * st->cwidth)
+
#define TXT_SCROLL_WIDTH U.widget_unit
#define TXT_SCROLL_SPACE ((int)(0.1f * U.widget_unit))
-#define TXT_LINE_SPACING ((int)(0.3f * st->lheight_dpi)) /* space between lines */
-#define TEXTXLOC (st->cwidth * st->linenrs_tot)
+
+/* Space between lines, in relation to letter height. */
+#define TXT_LINE_VPAD 0.3f
+/* Space between lines. */
+#define TXT_LINE_SPACING(st) ((int)(TXT_LINE_VPAD * st->lheight_dpi))
+/* Total height of each line. */
+#define TXT_LINE_HEIGHT(st) ((int)((1.0f + TXT_LINE_VPAD) * st->lheight_dpi))
#define SUGG_LIST_SIZE 7
#define SUGG_LIST_WIDTH 20