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:
authorMike Erwin <significant.bit@gmail.com>2017-02-05 08:54:21 +0300
committerMike Erwin <significant.bit@gmail.com>2017-02-05 08:54:21 +0300
commit5ad5bb235bf8c8a9b41a5fbb37f1fb1cdbbd392e (patch)
treef06002c006bff843cb344a48a03a94cf11d21677 /source/blender/editors/space_view3d
parent590838201120b32a4d1e2453b199806a527968bf (diff)
fix most UI text color
There are still many places to fix. I'll miss the bright yellow! This commit also uses the new BLF_default function where possible. Part of T49043 since we call glColor less often.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c22
2 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 21a7e26998e..c374bd7ae6f 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -698,7 +698,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
/* camera name - draw in highlighted text color */
if (ca && (ca->flag & CAM_SHOWNAME)) {
- UI_ThemeColor(TH_TEXT_HI);
+ UI_FontThemeColor(BLF_default(), TH_TEXT_HI);
BLF_draw_default(
x1i, y1i - (0.7f * U.widget_unit), 0.0f,
v3d->camera->id.name + 2, sizeof(v3d->camera->id.name) - 2);
@@ -1644,11 +1644,11 @@ static void draw_view_axis(RegionView3D *rv3d, rcti *rect)
int i = axis_order[axis_i];
const char axis_text[2] = {'x' + i, '\0'};
- glColor4ubv(axis_col[i]); /* text shader still uses gl_Color */
+ BLF_color4ubv(BLF_default(), axis_col[i]);
BLF_draw_default_ascii(axis_pos[i][0] + 2, axis_pos[i][1] + 2, 0.0f, axis_text, 1);
}
- /* BLF_draw_default disabled blending for us */
+ /* BLF_draw disabled blending for us */
}
#ifdef WITH_INPUT_NDOF
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 639be36d739..b3f1804398b 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -291,7 +291,7 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, rcti *rect)
name = tmpstr;
}
- UI_ThemeColor(TH_TEXT_HI);
+ UI_FontThemeColor(BLF_default(), TH_TEXT_HI);
#ifdef WITH_INTERNATIONAL
BLF_draw_default(U.widget_unit + rect->xmin, rect->ymax - U.widget_unit, 0.0f, name, sizeof(tmpstr));
#else
@@ -309,6 +309,8 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
const char *msg_pin = " (Pinned)";
const char *msg_sep = " : ";
+ const int font_id = BLF_default();
+
char info[300];
char *s = info;
short offset = 1.5f * UI_UNIT_X + rect->xmin;
@@ -384,18 +386,18 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
/* color depends on whether there is a keyframe */
if (id_frame_has_keyframe((ID *)ob, /* BKE_scene_frame_get(scene) */ (float)cfra, ANIMFILTER_KEYS_LOCAL))
- UI_ThemeColor(TH_TIME_KEYFRAME);
+ UI_FontThemeColor(font_id, TH_TIME_KEYFRAME);
else if (ED_gpencil_has_keyframe_v3d(scene, ob, cfra))
- UI_ThemeColor(TH_TIME_GP_KEYFRAME);
+ UI_FontThemeColor(font_id, TH_TIME_GP_KEYFRAME);
else
- UI_ThemeColor(TH_TEXT_HI);
+ UI_FontThemeColor(font_id, TH_TEXT_HI);
}
else {
/* no object */
if (ED_gpencil_has_keyframe_v3d(scene, NULL, cfra))
- UI_ThemeColor(TH_TIME_GP_KEYFRAME);
+ UI_FontThemeColor(font_id, TH_TIME_GP_KEYFRAME);
else
- UI_ThemeColor(TH_TEXT_HI);
+ UI_FontThemeColor(font_id, TH_TEXT_HI);
}
if (markern) {
@@ -2348,13 +2350,15 @@ void ED_scene_draw_fps(Scene *scene, const rcti *rect)
}
#endif
+ const int font_id = BLF_default();
+
/* is this more than half a frame behind? */
if (fps + 0.5f < (float)(FPS)) {
- UI_ThemeColor(TH_REDALERT);
+ UI_FontThemeColor(font_id, TH_REDALERT);
BLI_snprintf(printable, sizeof(printable), IFACE_("fps: %.2f"), fps);
}
else {
- UI_ThemeColor(TH_TEXT_HI);
+ UI_FontThemeColor(font_id, TH_TEXT_HI);
BLI_snprintf(printable, sizeof(printable), IFACE_("fps: %i"), (int)(fps + 0.5f));
}
@@ -2683,7 +2687,7 @@ static void view3d_main_region_draw_info(const bContext *C, Scene *scene,
if (grid_unit) { /* draw below the viewport name */
char numstr[32] = "";
- UI_ThemeColor(TH_TEXT_HI);
+ UI_FontThemeColor(BLF_default(), TH_TEXT_HI);
if (v3d->grid != 1.0f) {
BLI_snprintf(numstr, sizeof(numstr), "%s x %.4g", grid_unit, v3d->grid);
}