diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-27 20:15:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-09-27 21:11:10 +0300 |
commit | 6baea955bf562399caa9c6186601815af29b584d (patch) | |
tree | 8a7e330dd0a7600613ade4fd91582c5d77195236 | |
parent | 0b4c440baa567a02669c3fd790bb0b778efaaeff (diff) |
UI: use new 3D viewport navigation icons and image icon in add menu.
I had to make the viewport navigation icons a bit smaller in the SVG since
the edges were being clipped off, we only support 16x16 icons currently.
They are a bit blurry because of this.
22 files changed, 210 insertions, 107 deletions
diff --git a/release/datafiles/blender_icons.svg b/release/datafiles/blender_icons.svg index e65131c7308..7352fec7964 100644 --- a/release/datafiles/blender_icons.svg +++ b/release/datafiles/blender_icons.svg @@ -14,7 +14,7 @@ height="640" id="svg2" sodipodi:version="0.32" - inkscape:version="0.92.2 5c3e80d, 2017-08-06" + inkscape:version="0.92.3 (2405546, 2018-03-11)" version="1.0" sodipodi:docname="blender_icons.svg" inkscape:output_extension="org.inkscape.output.svg.inkscape" @@ -30105,6 +30105,48 @@ fx="74.518959" fy="499.99969" r="3.1650217" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient40455-7" + id="radialGradient37553-3" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.7881042,0.01544832,-0.01690407,0.7184169,-16.705439,29.204304)" + cx="-73.135666" + cy="95.970413" + fx="-73.135666" + fy="95.970413" + r="4.9999957" /> + <radialGradient + inkscape:collect="always" + xlink:href="#linearGradient18495" + id="radialGradient37555-3" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.4604901,-0.4901463,0.6187826,0.5813434,279.52277,457.42224)" + cx="756.98285" + cy="206.8443" + fx="756.98285" + fy="206.8443" + r="6.9000001" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient58334" + id="linearGradient14523" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(670.49503,-32.964641)" + x1="89.012573" + y1="243.96121" + x2="93.0625" + y2="249" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient16500" + id="linearGradient14525" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(1,-94.999998)" + x1="754.28558" + y1="300.83292" + x2="758.62622" + y2="305.53677" /> </defs> <sodipodi:namedview id="base" @@ -30116,16 +30158,16 @@ objecttolerance="10000" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="1.7675782" - inkscape:cx="474.09045" - inkscape:cy="240.94738" + inkscape:zoom="16" + inkscape:cx="357.41339" + inkscape:cy="196.12466" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" - inkscape:window-width="1145" - inkscape:window-height="1339" - inkscape:window-x="1254" - inkscape:window-y="0" + inkscape:window-width="3775" + inkscape:window-height="2080" + inkscape:window-x="65" + inkscape:window-y="38" inkscape:snap-nodes="true" inkscape:snap-bbox="true" showguides="true" @@ -30134,7 +30176,7 @@ inkscape:object-paths="false" inkscape:snap-intersection-line-segments="true" inkscape:snap-intersection-grid-guide="false" - inkscape:window-maximized="0" + inkscape:window-maximized="1" inkscape:bbox-paths="false" inkscape:snap-global="true" inkscape:snap-bbox-midpoints="false" @@ -85909,18 +85951,6 @@ d="m 36,544 h 1 v 2 h -1 z" id="path5004" /> </g> - <image - y="688.74585" - x="-97.166298" - id="image14434" - xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEcAAAAKCAYAAADmdkOtAAAABHNCSVQICAgIfAhkiAAAADlJREFU -SInt0DEKACAQA0Hv8P9fjo2VyLZa7ED6sJUkQzfdrx/8zDjAOMA4wDjAOMA4wDhg7ulQVVnqPgUa -9kvoAAAAAABJRU5ErkJggg== -" - style="image-rendering:optimizeSpeed" - preserveAspectRatio="none" - height="10" - width="71" /> <path sodipodi:nodetypes="ccc" id="path13481" @@ -86694,7 +86724,7 @@ SInt0DEKACAQA0Hv8P9fjo2VyLZa7ED6sJUkQzfdrx/8zDjAOMA4wDjAOMA4wDhg7ulQVVnqPgUa inkscape:export-xdpi="96" inkscape:export-ydpi="96" /> <g - transform="translate(-1.8135029e-6)" + transform="matrix(0.88,0,0,0.88,64.558313,2.1616853)" style="display:inline;enable-background:new" id="g15624"> <path @@ -86709,7 +86739,7 @@ SInt0DEKACAQA0Hv8P9fjo2VyLZa7ED6sJUkQzfdrx/8zDjAOMA4wDjAOMA4wDhg7ulQVVnqPgUa id="path15447" /> </g> <g - transform="translate(-1.8135029e-6)" + transform="matrix(0.88,0,0,0.88,61.981895,2.1608086)" style="display:inline;enable-background:new" id="g15620"> <path @@ -86724,7 +86754,7 @@ SInt0DEKACAQA0Hv8P9fjo2VyLZa7ED6sJUkQzfdrx/8zDjAOMA4wDjAOMA4wDhg7ulQVVnqPgUa inkscape:connector-curvature="0" /> </g> <g - transform="translate(-1.8135029e-6)" + transform="matrix(0.88,0,0,0.88,56.999998,2.16)" style="display:inline;enable-background:new" id="g15612"> <path @@ -86739,7 +86769,7 @@ SInt0DEKACAQA0Hv8P9fjo2VyLZa7ED6sJUkQzfdrx/8zDjAOMA4wDjAOMA4wDhg7ulQVVnqPgUa style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.00000012;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0.5;stroke-opacity:1;marker:none;paint-order:fill markers stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> </g> <g - transform="translate(-1.8135029e-6)" + transform="matrix(0.88,0,0,0.88,54.479998,2.22)" style="display:inline;enable-background:new" id="g15608"> <path @@ -86754,7 +86784,7 @@ SInt0DEKACAQA0Hv8P9fjo2VyLZa7ED6sJUkQzfdrx/8zDjAOMA4wDjAOMA4wDhg7ulQVVnqPgUa inkscape:connector-curvature="0" /> </g> <g - transform="translate(-1.8135029e-6)" + transform="matrix(0.88,0,0,0.88,59.519998,2.1601513)" style="display:inline;enable-background:new" id="g15616"> <path @@ -87923,6 +87953,128 @@ SInt0DEKACAQA0Hv8P9fjo2VyLZa7ED6sJUkQzfdrx/8zDjAOMA4wDjAOMA4wDhg7ulQVVnqPgUa id="rect12202" style="display:inline;overflow:visible;visibility:visible;opacity:0;fill:#000000;stroke:none;stroke-width:3;marker:none;enable-background:accumulate" /> </g> + <g + style="display:inline;enable-background:new" + id="ICON_FILE_IMAGE-9" + transform="translate(-431.96906,226.0094)"> + <path + inkscape:export-ydpi="90" + inkscape:export-xdpi="90" + inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png" + sodipodi:nodetypes="cccccc" + id="path37516-3" + d="m 757.01257,204.46121 9.48743,0.0388 V 219.5 h -13 l 0.0126,-11.53879 3.5,-3.5 z" + style="display:inline;fill:#dcdcdc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none" + inkscape:connector-curvature="0" /> + <g + id="g37518-6" + style="display:inline;enable-background:new" + transform="matrix(2.0006615,0,0,1,921.06748,111.96121)"> + <g + id="g37520-0" + transform="matrix(0.49807352,0,0,1,-41.659898,0)"> + <rect + style="display:inline;overflow:visible;visibility:visible;fill:#ffb36b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80141318;marker:none;enable-background:accumulate" + id="rect37522-6" + width="10.03535" + height="12" + x="-83" + y="94" /> + <rect + y="101" + x="-83" + height="4.9999976" + width="9.9999924" + id="rect37524-2" + style="display:inline;overflow:visible;visibility:visible;opacity:0.5;fill:#fd961b;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;enable-background:accumulate" /> + <rect + y="94" + x="-83" + height="6.8499999" + width="9.9999914" + id="rect37526-6" + style="display:inline;overflow:visible;visibility:visible;opacity:0.3;fill:url(#radialGradient37553-3);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;enable-background:accumulate" /> + <path + sodipodi:nodetypes="cccccccccccc" + id="path37528-1" + d="m -83,100.00002 h 1 l 1,0.74999 1,-0.74999 1,0.99999 h 2 l 1.5,-0.75 1.5,0.75 h 0.999991 L -73,102 h -9.999991 z" + style="display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;enable-background:accumulate" + inkscape:connector-curvature="0" /> + <rect + style="display:inline;overflow:visible;visibility:visible;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.1;marker:none;enable-background:accumulate" + id="rect37530-8" + width="2.0000029" + height="2.0000038" + x="-77" + y="96" /> + <path + style="display:inline;overflow:visible;visibility:visible;opacity:0.3;fill:#2b0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.80000001;marker:none;enable-background:accumulate" + d="m -83,102 h 10 v 1 h -10 z" + id="path37532-79" + sodipodi:nodetypes="ccccc" + inkscape:connector-curvature="0" /> + <path + sodipodi:nodetypes="ccccc" + id="path37534-2" + d="m -77,102 h 2.000003 L -75.75,106 h -0.5 z" + style="display:inline;overflow:visible;visibility:visible;opacity:0.5;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.1;marker:none;enable-background:accumulate" + inkscape:connector-curvature="0" /> + </g> + </g> + <g + id="g37536-0" + style="display:inline;enable-background:new" + transform="translate(838.01257,111.96121)"> + <path + sodipodi:nodetypes="ccc" + id="path37538-2" + d="m -82.5,105.5 v -11 h 9" + style="display:inline;opacity:0.25;fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:round;enable-background:new" + inkscape:connector-curvature="0" /> + <path + style="display:inline;opacity:0.2;fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:round;enable-background:new" + d="m -82.5,105.5 v -11 h 9 v 11 z" + id="path37540-3" + sodipodi:nodetypes="ccc" + inkscape:connector-curvature="0" /> + </g> + <path + style="display:inline;overflow:visible;visibility:visible;opacity:0.5;fill:url(#radialGradient37555-3);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;enable-background:accumulate" + d="m 757.51257,204.46121 9,1e-5 v 14.99999 h -13 v -11 z" + id="path37542-7" + sodipodi:nodetypes="cccccc" + inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png" + inkscape:export-xdpi="90" + inkscape:export-ydpi="90" + inkscape:connector-curvature="0" /> + <path + sodipodi:nodetypes="cccc" + d="m 755.0076,209.99657 -0.0126,8.53879 m 4.51257,-13.03879 6.48743,0.0388" + style="display:inline;opacity:0.1;fill:#dcdcdc;fill-opacity:1;stroke:url(#linearGradient14523);stroke-width:1px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1" + id="path37544-5" + inkscape:connector-curvature="0" /> + <path + style="display:inline;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none" + d="m 753.01257,208.96121 h 5 v -5 z" + id="path37546-9" + sodipodi:nodetypes="cccc" + inkscape:connector-curvature="0" /> + <path + inkscape:export-ydpi="90" + inkscape:export-xdpi="90" + inkscape:export-filename="C:\Documents and Settings\Tata\Pulpit\BLENDER ICONSET\Kopia blender\.blender\icons\jendrzych's iconset.png" + d="M 753.51257,207.96121 753.5,219.5 h 13 v -14.99999 l -9.48743,-0.0388 z" + style="fill:none;stroke:#422200;stroke-width:0.80000001;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="path37549-2" + sodipodi:nodetypes="cccccc" + inkscape:connector-curvature="0" /> + <path + sodipodi:nodetypes="ccc" + id="path37551-28" + d="m 758.51257,206.46121 v 3 h -3" + style="fill:none;stroke:url(#linearGradient14525);stroke-width:1px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1" + inkscape:connector-curvature="0" /> + </g> </g> <g inkscape:groupmode="layer" diff --git a/release/datafiles/blender_icons16/icon16_disclosure_tri_down.dat b/release/datafiles/blender_icons16/icon16_disclosure_tri_down.dat Binary files differindex 83b05465b0f..9e18550f5eb 100644 --- a/release/datafiles/blender_icons16/icon16_disclosure_tri_down.dat +++ b/release/datafiles/blender_icons16/icon16_disclosure_tri_down.dat diff --git a/release/datafiles/blender_icons16/icon16_disclosure_tri_right.dat b/release/datafiles/blender_icons16/icon16_disclosure_tri_right.dat Binary files differindex 9e18550f5eb..83b05465b0f 100644 --- a/release/datafiles/blender_icons16/icon16_disclosure_tri_right.dat +++ b/release/datafiles/blender_icons16/icon16_disclosure_tri_right.dat diff --git a/release/datafiles/blender_icons16/icon16_outliner_ob_image.dat b/release/datafiles/blender_icons16/icon16_outliner_ob_image.dat Binary files differnew file mode 100644 index 00000000000..f45e2b81401 --- /dev/null +++ b/release/datafiles/blender_icons16/icon16_outliner_ob_image.dat diff --git a/release/datafiles/blender_icons16/icon16_view_camera.dat b/release/datafiles/blender_icons16/icon16_view_camera.dat Binary files differindex 1749a33cf8f..6d2c769f585 100644 --- a/release/datafiles/blender_icons16/icon16_view_camera.dat +++ b/release/datafiles/blender_icons16/icon16_view_camera.dat diff --git a/release/datafiles/blender_icons16/icon16_view_ortho.dat b/release/datafiles/blender_icons16/icon16_view_ortho.dat Binary files differindex e4e44e6e40d..967e1887381 100644 --- a/release/datafiles/blender_icons16/icon16_view_ortho.dat +++ b/release/datafiles/blender_icons16/icon16_view_ortho.dat diff --git a/release/datafiles/blender_icons16/icon16_view_pan.dat b/release/datafiles/blender_icons16/icon16_view_pan.dat Binary files differindex 2e09c9ccb9e..3b1d05fcf3b 100644 --- a/release/datafiles/blender_icons16/icon16_view_pan.dat +++ b/release/datafiles/blender_icons16/icon16_view_pan.dat diff --git a/release/datafiles/blender_icons16/icon16_view_perspective.dat b/release/datafiles/blender_icons16/icon16_view_perspective.dat Binary files differindex c34e06f0ab4..6afa4ce8138 100644 --- a/release/datafiles/blender_icons16/icon16_view_perspective.dat +++ b/release/datafiles/blender_icons16/icon16_view_perspective.dat diff --git a/release/datafiles/blender_icons16/icon16_view_zoom.dat b/release/datafiles/blender_icons16/icon16_view_zoom.dat Binary files differindex 75d2dc04dbe..be0dc67065b 100644 --- a/release/datafiles/blender_icons16/icon16_view_zoom.dat +++ b/release/datafiles/blender_icons16/icon16_view_zoom.dat diff --git a/release/datafiles/blender_icons32/icon32_disclosure_tri_down.dat b/release/datafiles/blender_icons32/icon32_disclosure_tri_down.dat Binary files differindex c8f9237d4e6..de7a029a56b 100644 --- a/release/datafiles/blender_icons32/icon32_disclosure_tri_down.dat +++ b/release/datafiles/blender_icons32/icon32_disclosure_tri_down.dat diff --git a/release/datafiles/blender_icons32/icon32_disclosure_tri_right.dat b/release/datafiles/blender_icons32/icon32_disclosure_tri_right.dat Binary files differindex de7a029a56b..c8f9237d4e6 100644 --- a/release/datafiles/blender_icons32/icon32_disclosure_tri_right.dat +++ b/release/datafiles/blender_icons32/icon32_disclosure_tri_right.dat diff --git a/release/datafiles/blender_icons32/icon32_outliner_ob_image.dat b/release/datafiles/blender_icons32/icon32_outliner_ob_image.dat Binary files differnew file mode 100644 index 00000000000..9d503e5e839 --- /dev/null +++ b/release/datafiles/blender_icons32/icon32_outliner_ob_image.dat diff --git a/release/datafiles/blender_icons32/icon32_view_camera.dat b/release/datafiles/blender_icons32/icon32_view_camera.dat Binary files differindex d17b4acd92f..f906dcf10dc 100644 --- a/release/datafiles/blender_icons32/icon32_view_camera.dat +++ b/release/datafiles/blender_icons32/icon32_view_camera.dat diff --git a/release/datafiles/blender_icons32/icon32_view_ortho.dat b/release/datafiles/blender_icons32/icon32_view_ortho.dat Binary files differindex a7826cc095d..42bb767eb15 100644 --- a/release/datafiles/blender_icons32/icon32_view_ortho.dat +++ b/release/datafiles/blender_icons32/icon32_view_ortho.dat diff --git a/release/datafiles/blender_icons32/icon32_view_pan.dat b/release/datafiles/blender_icons32/icon32_view_pan.dat Binary files differindex 00ecf120c12..03825165d70 100644 --- a/release/datafiles/blender_icons32/icon32_view_pan.dat +++ b/release/datafiles/blender_icons32/icon32_view_pan.dat diff --git a/release/datafiles/blender_icons32/icon32_view_perspective.dat b/release/datafiles/blender_icons32/icon32_view_perspective.dat Binary files differindex 933c2a79cfb..012e86c2710 100644 --- a/release/datafiles/blender_icons32/icon32_view_perspective.dat +++ b/release/datafiles/blender_icons32/icon32_view_perspective.dat diff --git a/release/datafiles/blender_icons32/icon32_view_zoom.dat b/release/datafiles/blender_icons32/icon32_view_zoom.dat Binary files differindex 86df01622ba..e230cc8b93c 100644 --- a/release/datafiles/blender_icons32/icon32_view_zoom.dat +++ b/release/datafiles/blender_icons32/icon32_view_zoom.dat diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 898f22a8ca9..0d141a0dd6c 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -1521,7 +1521,7 @@ class VIEW3D_MT_add(Menu): sublayout = layout.column() sublayout.operator_context = 'INVOKE_DEFAULT' - sublayout.operator("object.load_image_as_empty", text="Image", icon="IMAGE_DATA") + sublayout.operator("object.load_image_as_empty", text="Image", icon="OUTLINER_OB_IMAGE") layout.separator() layout.operator("object.speaker_add", text="Speaker", icon='OUTLINER_OB_SPEAKER') diff --git a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c index 6ba85037b8b..e16deb71304 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c @@ -192,22 +192,27 @@ static void button2d_draw_intern( GPU_polygon_smooth(true); } else if (button->icon != ICON_NONE) { - button2d_geom_draw_backdrop(gz, color, select); - float size[2]; + if (draw_options & ED_GIZMO_BUTTON_SHOW_BACKDROP) { + button2d_geom_draw_backdrop(gz, color, select); + } + + float pos[2]; if (is_3d) { const float fac = 2.0f; GPU_matrix_translate_2f(-(fac / 2), -(fac / 2)); GPU_matrix_scale_2f(fac / (ICON_DEFAULT_WIDTH * UI_DPI_FAC), fac / (ICON_DEFAULT_HEIGHT * UI_DPI_FAC)); - size[0] = 1.0f; - size[1] = 1.0f; + pos[0] = 1.0f; + pos[1] = 1.0f; } else { - size[0] = gz->matrix_basis[3][0] - (ICON_DEFAULT_WIDTH / 2.0) * UI_DPI_FAC; - size[1] = gz->matrix_basis[3][1] - (ICON_DEFAULT_HEIGHT / 2.0) * UI_DPI_FAC; + pos[0] = gz->matrix_basis[3][0] - (ICON_DEFAULT_WIDTH / 2.0) * UI_DPI_FAC; + pos[1] = gz->matrix_basis[3][1] - (ICON_DEFAULT_HEIGHT / 2.0) * UI_DPI_FAC; GPU_matrix_pop(); need_to_pop = false; } - UI_icon_draw(size[0], size[1], button->icon); + + float alpha = (highlight) ? 1.0f : 0.8f; + UI_icon_draw_alpha(pos[0], pos[1], button->icon, alpha); } GPU_blend(false); } @@ -299,6 +304,7 @@ static void GIZMO_GT_button_2d(wmGizmoType *gzt) /* rna */ static EnumPropertyItem rna_enum_draw_options[] = { {ED_GIZMO_BUTTON_SHOW_OUTLINE, "OUTLINE", 0, "Outline", ""}, + {ED_GIZMO_BUTTON_SHOW_BACKDROP, "BACKDROP", 0, "Backdrop", ""}, {ED_GIZMO_BUTTON_SHOW_HELPLINE, "HELPLINE", 0, "Help Line", ""}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/editors/include/ED_gizmo_library.h b/source/blender/editors/include/ED_gizmo_library.h index 983f3b89771..45ada740c1c 100644 --- a/source/blender/editors/include/ED_gizmo_library.h +++ b/source/blender/editors/include/ED_gizmo_library.h @@ -215,11 +215,12 @@ enum { enum { ED_GIZMO_BUTTON_SHOW_OUTLINE = (1 << 0), + ED_GIZMO_BUTTON_SHOW_BACKDROP = (1 << 1), /** * Draw a line from the origin to the offset (similar to an arrow) * sometimes needed to show what the button edits. */ - ED_GIZMO_BUTTON_SHOW_HELPLINE = (1 << 1), + ED_GIZMO_BUTTON_SHOW_HELPLINE = (1 << 2), }; diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index 89f14bba5c7..45cc1046932 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -299,7 +299,7 @@ DEF_ICON(OUTLINER_OB_FORCE_FIELD) DEF_ICON(OUTLINER_OB_GROUP_INSTANCE) DEF_ICON(OUTLINER_OB_GREASEPENCIL) DEF_ICON(OUTLINER_OB_LIGHTPROBE) -DEF_ICON_BLANK(124) +DEF_ICON(OUTLINER_OB_IMAGE) DEF_ICON_BLANK(125) DEF_ICON(RESTRICT_COLOR_OFF) DEF_ICON(RESTRICT_COLOR_ON) diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c index 66faac49304..4eee7251022 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c @@ -51,13 +51,13 @@ * \{ */ /* Offset from screen edge. */ -#define GIZMO_OFFSET_FAC 1.2f +#define GIZMO_OFFSET_FAC 1.1f /* Size of main icon. */ #define GIZMO_SIZE 80 -/* Factor for size of smaller button. */ -#define GIZMO_MINI_FAC 0.35f +/* Size of the smaller icons. */ +#define GIZMO_ICON_SIZE 20 /* How much mini buttons offset from the primary. */ -#define GIZMO_MINI_OFFSET_FAC 0.42f +#define GIZMO_MINI_OFFSET_FAC 0.32f enum { @@ -74,94 +74,40 @@ enum { MPR_TOTAL = 6, }; -/* Vector icons compatible with 'GPU_batch_from_poly_2d_encoded' */ -static const uchar shape_camera[] = { - 0xa3, 0x19, 0x78, 0x55, 0x4d, 0x19, 0x4f, 0x0a, 0x7f, 0x00, 0xb0, 0x0a, 0xa9, 0x19, - 0xa9, 0x19, 0x25, 0xda, 0x0a, 0xb0, 0x00, 0x7f, 0x0a, 0x4f, 0x25, 0x25, 0x4f, 0x0a, - 0x4d, 0x19, 0x47, 0x19, 0x65, 0x55, 0x41, 0x55, 0x41, 0x9e, 0x43, 0xa8, 0x38, 0xb3, - 0x34, 0xc3, 0x38, 0xd2, 0x43, 0xdd, 0x53, 0xe1, 0x62, 0xdd, 0x6d, 0xd2, 0x72, 0xc3, - 0x78, 0xc3, 0x7c, 0xd2, 0x87, 0xdd, 0x96, 0xe1, 0xa6, 0xdd, 0xb1, 0xd2, 0xb5, 0xc3, - 0xb1, 0xb3, 0xa6, 0xa8, 0xa9, 0x9e, 0xa9, 0x8c, 0xbb, 0x8c, 0xbb, 0x86, 0xc7, 0x86, - 0xe0, 0x9e, 0xe0, 0x55, 0xc7, 0x6d, 0xbb, 0x6d, 0xbb, 0x67, 0xa9, 0x67, 0xa9, 0x55, - 0x8a, 0x55, 0xa9, 0x19, 0xb0, 0x0a, 0xda, 0x25, 0xf5, 0x4f, 0xff, 0x80, 0xf5, 0xb0, - 0xda, 0xda, 0xb0, 0xf5, 0x80, 0xff, 0x4f, 0xf5, 0x4f, 0xf5, 0x7c, 0xb3, 0x78, 0xc3, - 0x72, 0xc3, 0x6d, 0xb3, 0x62, 0xa8, 0x53, 0xa4, 0x43, 0xa8, 0x41, 0x9e, 0xa9, 0x9e, - 0xa6, 0xa8, 0x96, 0xa4, 0x87, 0xa8, 0x87, 0xa8, -}; -static const uchar shape_ortho[] = { - 0x85, 0x15, 0x85, 0x7c, 0xde, 0xb3, 0xde, 0xb8, 0xd9, 0xba, 0x80, 0x85, 0x27, 0xba, - 0x22, 0xb8, 0x22, 0xb3, 0x7b, 0x7c, 0x7b, 0x15, 0x80, 0x12, 0x80, 0x12, 0x1d, 0xba, - 0x80, 0xf2, 0x80, 0xff, 0x4f, 0xf5, 0x25, 0xda, 0x0a, 0xb0, 0x00, 0x7f, 0x0a, 0x4f, - 0x25, 0x25, 0x4f, 0x0a, 0x7f, 0x00, 0x80, 0x0d, 0x1d, 0x45, 0x1d, 0x45, 0xb0, 0x0a, - 0xda, 0x25, 0xf5, 0x4f, 0xff, 0x80, 0xf5, 0xb0, 0xda, 0xda, 0xb0, 0xf5, 0x80, 0xff, - 0x80, 0xf2, 0xe3, 0xba, 0xe3, 0x45, 0x80, 0x0d, 0x7f, 0x00, 0x7f, 0x00, -}; -static const uchar shape_pan[] = { - 0xbf, 0x4c, 0xbf, 0x66, 0x99, 0x66, 0x99, 0x40, 0xb2, 0x40, 0x7f, 0x0d, 0x7f, 0x00, - 0xb0, 0x0a, 0xda, 0x25, 0xf5, 0x4f, 0xff, 0x80, 0xf5, 0xb0, 0xda, 0xda, 0xb0, 0xf5, - 0x80, 0xff, 0x80, 0xf2, 0xb3, 0xbf, 0x99, 0xbf, 0x99, 0x99, 0xbf, 0x99, 0xbf, 0xb2, - 0xf2, 0x7f, 0xf2, 0x7f, 0x40, 0xb3, 0x40, 0x99, 0x66, 0x99, 0x66, 0xbf, 0x4d, 0xbf, - 0x80, 0xf2, 0x80, 0xff, 0x4f, 0xf5, 0x25, 0xda, 0x0a, 0xb0, 0x00, 0x7f, 0x0a, 0x4f, - 0x25, 0x25, 0x4f, 0x0a, 0x7f, 0x00, 0x7f, 0x0d, 0x4c, 0x40, 0x66, 0x40, 0x66, 0x66, - 0x40, 0x66, 0x40, 0x4d, 0x0d, 0x80, 0x0d, 0x80, -}; -static const uchar shape_persp[] = { - 0xda, 0xda, 0xb0, 0xf5, 0x80, 0xff, 0x4f, 0xf5, 0x25, 0xda, 0x0a, 0xb0, 0x00, 0x7f, - 0x0a, 0x4f, 0x25, 0x25, 0x4f, 0x0a, 0x7f, 0x00, 0x80, 0x07, 0x30, 0x50, 0x18, 0xbd, - 0x80, 0xdb, 0xe8, 0xbd, 0xf5, 0xb0, 0xf5, 0xb0, 0x83, 0x0f, 0x87, 0x7b, 0xe2, 0xb7, - 0xe3, 0xba, 0xe0, 0xbb, 0x80, 0x87, 0x20, 0xbb, 0x1d, 0xba, 0x1d, 0xb7, 0x78, 0x7b, - 0x7d, 0x0f, 0x80, 0x0c, 0x80, 0x0c, 0xd0, 0x50, 0x80, 0x07, 0x7f, 0x00, 0xb0, 0x0a, - 0xda, 0x25, 0xf5, 0x4f, 0xff, 0x80, 0xf5, 0xb0, 0xe8, 0xbd, 0xe8, 0xbd, -}; -static const uchar shape_zoom[] = { - 0xad, 0x7f, 0xf1, 0x7f, 0xff, 0x80, 0xf5, 0xb0, 0xda, 0xda, 0xb0, 0xf5, 0x80, 0xff, - 0x4f, 0xf5, 0x25, 0xda, 0x0a, 0xb0, 0x00, 0x7f, 0x0d, 0x7f, 0x52, 0x7f, 0x69, 0xb7, - 0x48, 0xb7, 0x80, 0xd8, 0xb8, 0xb7, 0x96, 0xb7, 0x96, 0xb7, 0x7f, 0x2f, 0x0d, 0x7f, - 0x00, 0x7f, 0x0a, 0x4f, 0x25, 0x25, 0x4f, 0x0a, 0x7f, 0x00, 0xb0, 0x0a, 0xda, 0x25, - 0xf5, 0x4f, 0xff, 0x80, 0xf1, 0x7f, 0xf1, 0x7f, -}; - - struct NavigateGizmoInfo { const char *opname; const char *gizmo; - const unsigned char *shape; - uint shape_size; + uint icon; }; -#define SHAPE_VARS(shape_id) shape = shape_id, .shape_size = ARRAY_SIZE(shape_id) - static struct NavigateGizmoInfo g_navigate_params[MPR_TOTAL] = { { .opname = "VIEW3D_OT_move", .gizmo = "GIZMO_GT_button_2d", - .SHAPE_VARS(shape_pan), + ICON_VIEW_PAN, }, { .opname = "VIEW3D_OT_rotate", .gizmo = "VIEW3D_GT_navigate_rotate", - .shape = NULL, - .shape_size = 0, + 0, }, { .opname = "VIEW3D_OT_zoom", .gizmo = "GIZMO_GT_button_2d", - .SHAPE_VARS(shape_zoom), + ICON_VIEW_ZOOM, }, { .opname = "VIEW3D_OT_view_persportho", .gizmo = "GIZMO_GT_button_2d", - .SHAPE_VARS(shape_persp), + ICON_VIEW_PERSPECTIVE, }, { .opname = "VIEW3D_OT_view_persportho", .gizmo = "GIZMO_GT_button_2d", - .SHAPE_VARS(shape_ortho), + ICON_VIEW_ORTHO, }, { .opname = "VIEW3D_OT_view_camera", .gizmo = "GIZMO_GT_button_2d", - .SHAPE_VARS(shape_camera), + ICON_VIEW_CAMERA, }, }; -#undef SHAPE_VARS - struct NavigateWidgetGroup { wmGizmo *gz_array[MPR_TOTAL]; /* Store the view state to check for changes. */ @@ -216,12 +162,10 @@ static void WIDGETGROUP_navigate_setup(const bContext *UNUSED(C), wmGizmoGroup * /* may be overwritten later */ - gz->scale_basis = (GIZMO_SIZE * GIZMO_MINI_FAC) / 2; - if (info->shape != NULL) { - PropertyRNA *prop = RNA_struct_find_property(gz->ptr, "shape"); - RNA_property_string_set_bytes( - gz->ptr, prop, - (const char *)info->shape, info->shape_size); + gz->scale_basis = (GIZMO_ICON_SIZE) / 2; + if (info->icon != 0) { + PropertyRNA *prop = RNA_struct_find_property(gz->ptr, "icon"); + RNA_property_enum_set(gz->ptr, prop, info->icon); RNA_enum_set(gz->ptr, "draw_options", ED_GIZMO_BUTTON_SHOW_OUTLINE); } |