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
newboolean
Paul 3 years ago committed by Harley Acheson
parent 78071d0cdf
commit b374b24f1b

@ -1 +1 @@
Subproject commit 5402eec9637b5c360e35bdd936d9e7a076d5df7f
Subproject commit a2fb7b56b6c99ca14aa1dd09659ad0242c1b1589

@ -238,6 +238,7 @@ const bTheme U_theme_default = {
.menu_shadow_fac = 0.3f,
.menu_shadow_width = 4,
.editor_outline = RGBA(0x1f1f1fff),
.widget_text_cursor = RGBA(0x3399e6ff),
.icon_alpha = 1.0f,
.icon_saturation = 0.5f,
.xaxis = RGBA(0xff3352ff),

@ -1 +1 @@
Subproject commit 249288e02afdcd024a64480ec29fa61be53dc5ec
Subproject commit 14d4b8f4e936d37eb783ae7368549f6b98d34761

@ -1 +1 @@
Subproject commit f3beaf241996d17feec0dee5f0888b0e9f55b4e3
Subproject commit a7fe2ba6378e81c7e8a9f73167567141882834c1

@ -932,6 +932,7 @@ class USERPREF_PT_theme_interface_styles(PreferencePanel, Panel):
flow.prop(ui, "icon_alpha")
flow.prop(ui, "icon_saturation")
flow.prop(ui, "editor_outline")
flow.prop(ui, "widget_text_cursor")
flow.prop(ui, "menu_shadow_width")
flow.prop(ui, "widget_emboss")

@ -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

@ -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 */

@ -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;

@ -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;

@ -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];

@ -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");

Loading…
Cancel
Save