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:
authorPablo Vazquez <venomgfx@gmail.com>2018-11-03 05:47:25 +0300
committerPablo Vazquez <venomgfx@gmail.com>2018-11-03 05:47:25 +0300
commitdf0058061d599ce45dad3589299349ca6f5813b9 (patch)
treeeb29819533766f5f65c9f964338701898bc2dd1e /source/blender/editors/space_view3d/view3d_draw.c
parent2b6ae64257f18dacbacc6b1dfaeae88dac1341b2 (diff)
UI: Soft drop shadow on 3D Viewport info text.
Soft shadow similar to the title of pie menus to increase readability. For the full white background issue an extra box container might be needed.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index d107cfaf169..93354914390 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1081,6 +1081,8 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, const rcti *rect)
{
RegionView3D *rv3d = ar->regiondata;
const char *name = view3d_get_name(v3d, rv3d);
+ const int font_id = BLF_default();
+
/* increase size for unicode languages (Chinese in utf-8...) */
#ifdef WITH_INTERNATIONAL
char tmpstr[96];
@@ -1088,6 +1090,10 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, const rcti *rect)
char tmpstr[32];
#endif
+ BLF_enable(font_id, BLF_SHADOW);
+ BLF_shadow(font_id, 5, (const float[4]){0.0f, 0.0f, 0.0f, 1.0f});
+ BLF_shadow_offset(font_id, 1, -1);
+
if (v3d->localvd) {
BLI_snprintf(tmpstr, sizeof(tmpstr), IFACE_("%s (Local)"), name);
name = tmpstr;
@@ -1099,6 +1105,8 @@ static void draw_viewport_name(ARegion *ar, View3D *v3d, const rcti *rect)
#else
BLF_draw_default_ascii(U.widget_unit + rect->xmin, rect->ymax - U.widget_unit, 0.0f, name, sizeof(tmpstr));
#endif
+
+ BLF_disable(font_id, BLF_SHADOW);
}
/**
@@ -1206,7 +1214,13 @@ static void draw_selected_name(Scene *scene, Object *ob, rcti *rect)
s += sprintf(s, " <%s>", markern);
}
+ BLF_enable(font_id, BLF_SHADOW);
+ BLF_shadow(font_id, 5, (const float[4]){0.0f, 0.0f, 0.0f, 1.0f});
+ BLF_shadow_offset(font_id, 1, -1);
+
BLF_draw_default(rect->xmin + UI_UNIT_X, rect->ymax - (2 * U.widget_unit), 0.0f, info, sizeof(info));
+
+ BLF_disable(font_id, BLF_SHADOW);
}
/* ******************** view loop ***************** */