diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2017-02-12 23:43:13 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2017-02-12 23:43:13 +0300 |
commit | 10b24eabbab0193f6944cdf3bec7b386c75d5445 (patch) | |
tree | 28cefb0f056191e09828cb79d2f7f728df4e2ead /source/blender/editors/interface/resources.c | |
parent | f754ce1c5e050d1637fe97d78f782d6a68da6c15 (diff) | |
parent | b104057d001d2472cc55c7fa51cff3275e331523 (diff) |
Merge branch 'blender2.8' into transform-manipulators
Conflicts:
source/blender/editors/interface/resources.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/transform/transform_manipulator.c
source/blender/gpu/CMakeLists.txt
source/blender/gpu/intern/gpu_shader.c
Diffstat (limited to 'source/blender/editors/interface/resources.c')
-rw-r--r-- | source/blender/editors/interface/resources.c | 73 |
1 files changed, 62 insertions, 11 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 8b8c842b2c7..bf7fc0b8bd5 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -54,6 +54,8 @@ #include "BIF_gl.h" +#include "BLF_api.h" + #include "UI_interface.h" #include "UI_interface_icons.h" @@ -166,6 +168,9 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case SPACE_CLIP: ts = &btheme->tclip; break; + case SPACE_COLLECTIONS: + ts = &btheme->tcollections; + break; default: ts = &btheme->tv3d; break; @@ -1207,6 +1212,11 @@ void ui_theme_init_default(void) rgba_char_args_set(btheme->tclip.strip_select, 0xff, 0x8c, 0x00, 0xff); btheme->tclip.handle_vertex_size = 5; ui_theme_space_init_handles_color(&btheme->tclip); + + /* space collection manager */ + btheme->tcollections = btheme->tv3d; + rgba_char_args_set_fl(btheme->tcollections.back, 0.42, 0.42, 0.42, 1.0); + rgba_char_args_set(btheme->tcollections.hilite, 255, 140, 25, 255); /* selected files */ } void ui_style_init_default(void) @@ -1278,18 +1288,11 @@ void UI_ThemeColor4(int colorid) /* set the color with offset for shades */ void UI_ThemeColorShade(int colorid, int offset) { - int r, g, b; - const unsigned char *cp; - - cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); - r = offset + (int) cp[0]; - CLAMP(r, 0, 255); - g = offset + (int) cp[1]; - CLAMP(g, 0, 255); - b = offset + (int) cp[2]; - CLAMP(b, 0, 255); - glColor4ub(r, g, b, cp[3]); + unsigned char col[4]; + UI_GetThemeColorShade4ubv(colorid, offset, col); + glColor4ubv(col); } + void UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset) { int r, g, b, a; @@ -1394,6 +1397,12 @@ void UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int off glColor4ub(r, g, b, a); } +void UI_FontThemeColor(int fontid, int colorid) +{ + unsigned char color[4]; + UI_GetThemeColor4ubv(colorid, color); + BLF_color4ubv(fontid, color); +} /* get individual values, not scaled */ float UI_GetThemeValuef(int colorid) @@ -1492,6 +1501,42 @@ void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]) col[2] = b; } +void UI_GetThemeColorBlendShade3ubv(int colorid1, int colorid2, float fac, int offset, unsigned char col[3]) +{ + const unsigned char *cp1, *cp2; + + cp1 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid1); + cp2 = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid2); + + CLAMP(fac, 0.0f, 1.0f); + col[0] = offset + floorf((1.0f - fac) * cp1[0] + fac * cp2[0]); + col[1] = offset + floorf((1.0f - fac) * cp1[1] + fac * cp2[1]); + col[2] = offset + floorf((1.0f - fac) * cp1[2] + fac * cp2[2]); + + CLAMP(col[0], 0, 255); + CLAMP(col[1], 0, 255); + CLAMP(col[2], 0, 255); +} + +void UI_GetThemeColorShade4ubv(int colorid, int offset, unsigned char col[4]) +{ + int r, g, b; + const unsigned char *cp; + + cp = UI_ThemeGetColorPtr(theme_active, theme_spacetype, colorid); + r = offset + (int) cp[0]; + CLAMP(r, 0, 255); + g = offset + (int) cp[1]; + CLAMP(g, 0, 255); + b = offset + (int) cp[2]; + CLAMP(b, 0, 255); + + col[0] = r; + col[1] = g; + col[2] = b; + col[3] = cp[3]; +} + void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4]) { int r, g, b, a; @@ -2818,6 +2863,12 @@ void init_userdef_do_versions(void) */ { for (bTheme *btheme = U.themes.first; btheme; btheme = btheme->next) { + btheme->tcollections = btheme->tv3d; + rgba_char_args_set_fl(btheme->tcollections.back, 0.42, 0.42, 0.42, 1.0); + rgba_char_args_set(btheme->tcollections.hilite, 255, 140, 25, 255); /* selected files */ + } + + for (bTheme *btheme = U.themes.first; btheme; btheme = btheme->next) { rgba_char_args_set_fl(btheme->tui.xaxis, 1.0f, 0.27f, 0.27f, 1.0f); /* red */ rgba_char_args_set_fl(btheme->tui.yaxis, 0.27f, 1.0f, 0.27f, 1.0f); /* green */ rgba_char_args_set_fl(btheme->tui.zaxis, 0.27f, 0.27f, 1.0f, 1.0f); /* blue */ |