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
path: root/source
diff options
context:
space:
mode:
authorPaul (Thirio) <paul@paulcoops.com>2019-11-25 19:36:05 +0300
committerHarley Acheson <harley.acheson@gmail.com>2019-11-25 19:36:05 +0300
commitb374b24f1b2dea4360f318fe3c86bede00bdaae4 (patch)
tree81e74e8b8103c9dca6f21bf00036367c1d470bf3 /source
parent78071d0cdfe53bf9dd7baa1a7204b1e148b7574b (diff)
UI: Widget Text Cursor Color
Adds a theme setting to specify color of widget text insertion cursor (caret). Differential Revision: https://developer.blender.org/D6024 Reviewed by Campbell Barton
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c1
-rw-r--r--source/blender/editors/include/UI_resources.h2
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
-rw-r--r--source/blender/editors/interface/resources.c3
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c6
6 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index ac7fcdd3769..ad06d512266 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -162,6 +162,7 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
{
FROM_DEFAULT_V4_UCHAR(space_sequencer.anim_preview_range);
FROM_DEFAULT_V4_UCHAR(space_text.line_numbers);
+ FROM_DEFAULT_V4_UCHAR(tui.widget_text_cursor);
}
#undef FROM_DEFAULT_V4_UCHAR
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index c909c9b8d58..738a91c085d 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -293,7 +293,7 @@ typedef enum ThemeColorID {
TH_NLA_SOUND_SEL,
TH_WIDGET_EMBOSS,
-
+ TH_WIDGET_TEXT_CURSOR,
TH_EDITOR_OUTLINE,
TH_AXIS_X, /* X/Y/Z Axis */
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index df2b78e0a6f..f2027d491fb 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2227,7 +2227,7 @@ static void widget_draw_text(const uiFontStyle *fstyle,
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformColor3f(0.2f, 0.6f, 0.9f);
+ immUniformThemeColor(TH_WIDGET_TEXT_CURSOR);
but_cursor_shape.xmin = (rect->xmin + t) - U.pixelsize;
but_cursor_shape.ymin = rect->ymin + U.pixelsize;
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index a4dd0cb5c9f..99833e9200d 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -872,6 +872,9 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case TH_EDITOR_OUTLINE:
cp = btheme->tui.editor_outline;
break;
+ case TH_WIDGET_TEXT_CURSOR:
+ cp = btheme->tui.widget_text_cursor;
+ break;
case TH_AXIS_X:
cp = btheme->tui.xaxis;
break;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 3e10e817946..11a0e441392 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -173,7 +173,7 @@ typedef struct ThemeUI {
float icon_alpha;
float icon_saturation;
- char _pad[4];
+ unsigned char widget_text_cursor[4];
/* Axis Colors */
unsigned char xaxis[4], yaxis[4], zaxis[4];
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 66ed6ca1431..3ccf53db180 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1487,6 +1487,12 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
prop, "Editor Outline", "Color of the outline of the editors and their round corners");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+ prop = RNA_def_property(srna, "widget_text_cursor", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "widget_text_cursor");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Text Cursor", "Color of the interface widgets text insertion cursor (caret)");
+ RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
+
/* axis */
prop = RNA_def_property(srna, "axis_x", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "xaxis");