diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-08 10:06:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-09 11:02:10 +0300 |
commit | 00f22403ac9dce95117cb6ef5c948f1da881f05d (patch) | |
tree | d02eb2b0a6cb46e0b13a0d250456972c50f45d23 /source/blender/editors/space_view3d/view3d_manipulator_camera.c | |
parent | fdb1c81117a3595044d65aef5e6ecfafe30471e7 (diff) |
Manipulator: replace hard coded color w/ theme
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_manipulator_camera.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_manipulator_camera.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/source/blender/editors/space_view3d/view3d_manipulator_camera.c b/source/blender/editors/space_view3d/view3d_manipulator_camera.c index 51467775298..26af554f13a 100644 --- a/source/blender/editors/space_view3d/view3d_manipulator_camera.c +++ b/source/blender/editors/space_view3d/view3d_manipulator_camera.c @@ -37,6 +37,8 @@ #include "ED_screen.h" #include "ED_manipulator_library.h" +#include "UI_resources.h" + #include "MEM_guardedalloc.h" #include "RNA_access.h" @@ -105,37 +107,32 @@ static void WIDGETGROUP_camera_setup(const bContext *C, wmManipulatorGroup *mgro /* dof distance */ { wmManipulator *mpr; - const float color[4] = {1.0f, 0.3f, 0.0f, 1.0f}; - const float color_hi[4] = {1.0f, 0.3f, 0.0f, 1.0f}; - mpr = camgroup->dop_dist = WM_manipulator_new_ptr(wt_arrow, mgroup, NULL); RNA_enum_set(mpr->ptr, "draw_style", ED_MANIPULATOR_ARROW_STYLE_CROSS); WM_manipulator_set_flag(mpr, WM_MANIPULATOR_DRAW_HOVER, true); - WM_manipulator_set_color(mpr, color); - WM_manipulator_set_color_highlight(mpr, color_hi); + + UI_GetThemeColor3fv(TH_MANIPULATOR_A, mpr->color); + UI_GetThemeColor3fv(TH_MANIPULATOR_HI, mpr->color_hi); } /* focal length * - logic/calculations are similar to BKE_camera_view_frame_ex, better keep in sync */ { wmManipulator *mpr; - const float color[4] = {1.0f, 1.0, 0.27f, 0.5f}; - const float color_hi[4] = {1.0f, 1.0, 0.27f, 1.0f}; - mpr = camgroup->focal_len = WM_manipulator_new_ptr(wt_arrow, mgroup, NULL); RNA_enum_set(mpr->ptr, "draw_style", ED_MANIPULATOR_ARROW_STYLE_CONE); RNA_enum_set(mpr->ptr, "draw_options", ED_MANIPULATOR_ARROW_STYLE_CONSTRAINED); - WM_manipulator_set_color(mpr, color); - WM_manipulator_set_color_highlight(mpr, color_hi); + UI_GetThemeColor3fv(TH_MANIPULATOR_PRIMARY, mpr->color); + UI_GetThemeColor3fv(TH_MANIPULATOR_HI, mpr->color_hi); cameragroup_property_setup(mpr, ob, ca, false); mpr = camgroup->ortho_scale = WM_manipulator_new_ptr(wt_arrow, mgroup, NULL); RNA_enum_set(mpr->ptr, "draw_style", ED_MANIPULATOR_ARROW_STYLE_CONE); RNA_enum_set(mpr->ptr, "draw_options", ED_MANIPULATOR_ARROW_STYLE_CONSTRAINED); - WM_manipulator_set_color(mpr, color); - WM_manipulator_set_color_highlight(mpr, color_hi); + UI_GetThemeColor3fv(TH_MANIPULATOR_PRIMARY, mpr->color); + UI_GetThemeColor3fv(TH_MANIPULATOR_HI, mpr->color_hi); cameragroup_property_setup(mpr, ob, ca, true); } } |