Introduce canvas menu (#11618)

* init

* update

* Update GLCanvas3D.cpp

* Update GLCanvas3D.cpp

* cleanup

* fix icon size

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
yw4z
2025-12-30 19:02:48 +03:00
committed by GitHub
parent 81dd153798
commit 0330e86007
18 changed files with 209 additions and 714 deletions

View File

@@ -1,167 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="100%"
height="100%"
viewBox="0 0 18 18"
version="1.1"
xml:space="preserve"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"
id="svg4"
sodipodi:docname="axis_toggle.svg"
inkscape:version="1.4 (86a8ad7, 2024-10-11)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview4"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="true"
inkscape:zoom="64.833333"
inkscape:cx="9"
inkscape:cy="8.6915168"
inkscape:window-width="2560"
inkscape:window-height="1369"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g15"><inkscape:grid
id="grid4"
units="px"
originx="0"
originy="0"
spacingx="1"
spacingy="1"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="5"
enabled="true"
visible="false" /><inkscape:grid
type="axonomgrid"
id="grid8"
units="pt"
originx="9"
originy="9"
spacingx="3.7795276"
spacingy="1.3333333"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="4"
dotted="false"
gridanglex="36"
gridanglez="36"
enabled="true"
visible="true" /><inkscape:grid
type="modular"
id="grid9"
units="px"
originx="0"
originy="0"
spacingx="151.1811"
spacingy="151.1811"
empcolor="#0047cb"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="0"
marginx="0"
marginy="0"
gapx="37.795276"
gapy="37.795276"
enabled="true"
visible="true" /><inkscape:grid
type="axonomgrid"
id="grid10"
units="px"
originx="0"
originy="0"
spacingx="3.7795276"
spacingy="3.7795276"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="5"
dotted="false"
gridanglex="30"
gridanglez="30"
enabled="false"
visible="true" /></sodipodi:namedview><defs
id="defs4" />
<g
id="g15"
transform="matrix(0.129199,0,0,0.129199,22.9215,0.522556)">
<g
transform="matrix(8.25599,0,0,8.25599,-182.056,-21.0726)"
id="g1"
style="display:inline">
<circle
cx="9"
cy="10.5"
r="7.5"
style="display:inline;fill:#c4c4c4"
id="circle1" />
</g>
<g
id="g19"
inkscape:label="grid"
style="display:inline;stroke:#8d8d8d;stroke-opacity:1;stroke-linecap:square"><path
id="path3"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -157.72198 101.92044 L -57.660489 29.22151 " /><path
id="path8"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -130.16207 123.17697 L -45.951829 61.994656 " /><path
id="path10"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -169.42074 62.090704 L -85.342701 123.17697 " /><path
id="path21"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -169.42074 69.140098 L -85.210515 7.9577807 " /><path
id="path23"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -130.16206 8.0538225 L -46.084024 69.140097 " /><path
id="path25"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -57.782786 101.92044 L -157.72198 29.310363 " /><circle
cx="9"
cy="10.5"
r="7.5"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;fill:none;stroke:#000000;stroke-opacity:1;stroke-width:0.28125025;stroke-dasharray:none;stroke-dashoffset:0"
id="circle2"
transform="matrix(8.2559904,0,0,8.2559904,-182.056,-21.0726)" /></g><path
style="display:inline;fill:#ff3c5b;fill-opacity:1;stroke:#ff3c5b;stroke-width:10.32;stroke-dasharray:none;paint-order:fill markers stroke"
d="m -114.85451,70.775398 -31.59786,22.95719"
id="path6"
sodipodi:nodetypes="cc" /><path
style="display:inline;fill:#64c818;fill-opacity:1;stroke:#64c818;stroke-width:10.32;stroke-dasharray:none;paint-order:fill markers stroke"
d="m -100.65025,70.775398 31.597858,22.95719"
id="path5"
sodipodi:nodetypes="cc" /><path
style="clip-rule:evenodd;display:inline;fill:#2f88e9;fill-opacity:1;fill-rule:evenodd;stroke:#2f88e9;stroke-width:1.33333;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;stroke-dasharray:none;paint-order:fill markers stroke"
d="M 8.9999995,8 V 3"
id="path4"
sodipodi:nodetypes="cc"
transform="matrix(7.739998,0,0,7.739998,-177.41236,-4.0445824)" /><path
style="display:none;fill:#e6e6e6;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m -86.44599,50.135404 -21.30639,-15.479996 -21.30638,15.479996 21.30638,15.479996 z"
id="path11" /><path
style="display:none;fill:#b3b3b3;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m -129.05876,50.135404 v 30.959992 l 21.30638,15.479996 V 65.6154 Z"
id="path12" /><path
style="display:none;fill:#999999;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="M -107.75238,96.575392 -86.44599,81.095396 V 50.135404 L -107.75238,65.6154 Z"
id="path13" /></g>
</svg>

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -1,167 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="100%"
height="100%"
viewBox="0 0 18 18"
version="1.1"
xml:space="preserve"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"
id="svg4"
sodipodi:docname="axis_toggle_dark_test.svg"
inkscape:version="1.4 (86a8ad7, 2024-10-11)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview4"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="true"
inkscape:zoom="64.833333"
inkscape:cx="9"
inkscape:cy="8.6915168"
inkscape:window-width="2560"
inkscape:window-height="1369"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g19"><inkscape:grid
id="grid4"
units="px"
originx="0"
originy="0"
spacingx="1"
spacingy="1"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="5"
enabled="true"
visible="false" /><inkscape:grid
type="axonomgrid"
id="grid8"
units="pt"
originx="9"
originy="9"
spacingx="3.7795276"
spacingy="1.3333333"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="4"
dotted="false"
gridanglex="36"
gridanglez="36"
enabled="true"
visible="true" /><inkscape:grid
type="modular"
id="grid9"
units="px"
originx="0"
originy="0"
spacingx="151.1811"
spacingy="151.1811"
empcolor="#0047cb"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="0"
marginx="0"
marginy="0"
gapx="37.795276"
gapy="37.795276"
enabled="true"
visible="true" /><inkscape:grid
type="axonomgrid"
id="grid10"
units="px"
originx="0"
originy="0"
spacingx="3.7795276"
spacingy="3.7795276"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="5"
dotted="false"
gridanglex="30"
gridanglez="30"
enabled="false"
visible="true" /></sodipodi:namedview><defs
id="defs4" />
<g
id="g15"
transform="matrix(0.129199,0,0,0.129199,22.9215,0.522556)">
<g
transform="matrix(8.25599,0,0,8.25599,-182.056,-21.0726)"
id="g1"
style="display:inline">
<circle
cx="9"
cy="10.5"
r="7.5"
style="display:inline;fill:#3b3b3b"
id="circle1" />
</g>
<g
id="g19"
inkscape:label="grid"
style="display:inline;stroke:#8d8d8d;stroke-opacity:1;stroke-linecap:square"><path
id="path3"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -157.72198 101.92044 L -57.660489 29.22151 " /><path
id="path8"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -130.16207 123.17697 L -45.951829 61.994656 " /><path
id="path10"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -169.42074 62.090704 L -85.342701 123.17697 " /><path
id="path21"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -169.42074 69.140098 L -85.210515 7.9577807 " /><path
id="path23"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -130.16206 8.0538225 L -46.084024 69.140097 " /><path
id="path25"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -57.782786 101.92044 L -157.72198 29.310363 " /><circle
cx="9"
cy="10.5"
r="7.5"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;fill:none;stroke:#000000;stroke-opacity:1;stroke-width:0.28125025;stroke-dasharray:none;stroke-dashoffset:0"
id="circle2"
transform="matrix(8.2559904,0,0,8.2559904,-182.056,-21.0726)" /></g><path
style="display:inline;fill:#ff3c5b;fill-opacity:1;stroke:#ff3c5b;stroke-width:10.32;stroke-dasharray:none;paint-order:fill markers stroke"
d="m -114.85451,70.775398 -31.59786,22.95719"
id="path6"
sodipodi:nodetypes="cc" /><path
style="display:inline;fill:#64c818;fill-opacity:1;stroke:#64c818;stroke-width:10.32;stroke-dasharray:none;paint-order:fill markers stroke"
d="m -100.65025,70.775398 31.597858,22.95719"
id="path5"
sodipodi:nodetypes="cc" /><path
style="clip-rule:evenodd;display:inline;fill:#2f88e9;fill-opacity:1;fill-rule:evenodd;stroke:#2f88e9;stroke-width:1.33333;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;stroke-dasharray:none;paint-order:fill markers stroke"
d="m 8.9999995,8 0,-5"
id="path4"
sodipodi:nodetypes="cc"
transform="matrix(7.739998,0,0,7.739998,-177.41236,-4.0445824)" /><path
style="display:none;fill:#e6e6e6;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m -86.44599,50.135404 -21.30639,-15.479996 -21.30638,15.479996 21.30638,15.479996 z"
id="path11" /><path
style="display:none;fill:#b3b3b3;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m -129.05876,50.135404 v 30.959992 l 21.30638,15.479996 V 65.6154 Z"
id="path12" /><path
style="display:none;fill:#999999;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="M -107.75238,96.575392 -86.44599,81.095396 V 50.135404 L -107.75238,65.6154 Z"
id="path13" /></g>
</svg>

Before

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -1,167 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="100%"
height="100%"
viewBox="0 0 18 18"
version="1.1"
xml:space="preserve"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"
id="svg4"
sodipodi:docname="axis_toggle_hover.svg"
inkscape:version="1.4 (86a8ad7, 2024-10-11)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview4"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="true"
inkscape:zoom="64.833333"
inkscape:cx="9"
inkscape:cy="8.6915168"
inkscape:window-width="2560"
inkscape:window-height="1369"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g15"><inkscape:grid
id="grid4"
units="px"
originx="0"
originy="0"
spacingx="1"
spacingy="1"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="5"
enabled="true"
visible="false" /><inkscape:grid
type="axonomgrid"
id="grid8"
units="pt"
originx="9"
originy="9"
spacingx="3.7795276"
spacingy="1.3333333"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="4"
dotted="false"
gridanglex="36"
gridanglez="36"
enabled="true"
visible="true" /><inkscape:grid
type="modular"
id="grid9"
units="px"
originx="0"
originy="0"
spacingx="151.1811"
spacingy="151.1811"
empcolor="#0047cb"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="0"
marginx="0"
marginy="0"
gapx="37.795276"
gapy="37.795276"
enabled="true"
visible="true" /><inkscape:grid
type="axonomgrid"
id="grid10"
units="px"
originx="0"
originy="0"
spacingx="3.7795276"
spacingy="3.7795276"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="5"
dotted="false"
gridanglex="30"
gridanglez="30"
enabled="false"
visible="true" /></sodipodi:namedview><defs
id="defs4" />
<g
id="g15"
transform="matrix(0.129199,0,0,0.129199,22.9215,0.522556)">
<g
transform="matrix(8.25599,0,0,8.25599,-182.056,-21.0726)"
id="g1"
style="display:inline">
<circle
cx="9"
cy="10.5"
r="7.5"
style="display:inline;fill:#c4c4c4"
id="circle1" />
</g>
<g
id="g19"
inkscape:label="grid"
style="display:inline;stroke:#8d8d8d;stroke-opacity:1;stroke-linecap:square"><path
id="path3"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -157.72198 101.92044 L -57.660489 29.22151 " /><path
id="path8"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -130.16207 123.17697 L -45.951829 61.994656 " /><path
id="path10"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -169.42074 62.090704 L -85.342701 123.17697 " /><path
id="path21"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -169.42074 69.140098 L -85.210515 7.9577807 " /><path
id="path23"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -130.16206 8.0538225 L -46.084024 69.140097 " /><path
id="path25"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -57.782786 101.92044 L -157.72198 29.310363 " /><circle
cx="9"
cy="10.5"
r="7.5"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;fill:none;stroke:#000000;stroke-opacity:1;stroke-width:0.28125025;stroke-dasharray:none;stroke-dashoffset:0"
id="circle2"
transform="matrix(8.2559904,0,0,8.2559904,-182.056,-21.0726)" /></g><path
style="display:none;fill:#ff3c5b;fill-opacity:1;stroke:#ff3c5b;stroke-width:10.32;stroke-dasharray:none;paint-order:fill markers stroke"
d="m -114.85451,70.775398 -31.59786,22.95719"
id="path6"
sodipodi:nodetypes="cc" /><path
style="display:none;fill:#64c818;fill-opacity:1;stroke:#64c818;stroke-width:10.32;stroke-dasharray:none;paint-order:fill markers stroke"
d="m -100.65025,70.775398 31.597858,22.95719"
id="path5"
sodipodi:nodetypes="cc" /><path
style="clip-rule:evenodd;display:none;fill:#2f88e9;fill-opacity:1;fill-rule:evenodd;stroke:#2f88e9;stroke-width:1.33333;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;stroke-dasharray:none;paint-order:fill markers stroke"
d="M 8.9999995,8 V 3"
id="path4"
sodipodi:nodetypes="cc"
transform="matrix(7.739998,0,0,7.739998,-177.41236,-4.0445824)" /><path
style="display:none;fill:#e6e6e6;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m -86.44599,50.135404 -21.30639,-15.479996 -21.30638,15.479996 21.30638,15.479996 z"
id="path11" /><path
style="display:none;fill:#b3b3b3;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m -129.05876,50.135404 v 30.959992 l 21.30638,15.479996 V 65.6154 Z"
id="path12" /><path
style="display:none;fill:#999999;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="M -107.75238,96.575392 -86.44599,81.095396 V 50.135404 L -107.75238,65.6154 Z"
id="path13" /></g>
</svg>

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -1,167 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="100%"
height="100%"
viewBox="0 0 18 18"
version="1.1"
xml:space="preserve"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"
id="svg4"
sodipodi:docname="axis_toggle_hover_dark.svg"
inkscape:version="1.4 (86a8ad7, 2024-10-11)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview4"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="true"
inkscape:zoom="64.833333"
inkscape:cx="9"
inkscape:cy="8.6915168"
inkscape:window-width="2560"
inkscape:window-height="1369"
inkscape:window-x="-8"
inkscape:window-y="-8"
inkscape:window-maximized="1"
inkscape:current-layer="g19"><inkscape:grid
id="grid4"
units="px"
originx="0"
originy="0"
spacingx="1"
spacingy="1"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="5"
enabled="true"
visible="false" /><inkscape:grid
type="axonomgrid"
id="grid8"
units="pt"
originx="9"
originy="9"
spacingx="3.7795276"
spacingy="1.3333333"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="4"
dotted="false"
gridanglex="36"
gridanglez="36"
enabled="true"
visible="true" /><inkscape:grid
type="modular"
id="grid9"
units="px"
originx="0"
originy="0"
spacingx="151.1811"
spacingy="151.1811"
empcolor="#0047cb"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="0"
marginx="0"
marginy="0"
gapx="37.795276"
gapy="37.795276"
enabled="true"
visible="true" /><inkscape:grid
type="axonomgrid"
id="grid10"
units="px"
originx="0"
originy="0"
spacingx="3.7795276"
spacingy="3.7795276"
empcolor="#0099e5"
empopacity="0.30196078"
color="#0099e5"
opacity="0.14901961"
empspacing="5"
dotted="false"
gridanglex="30"
gridanglez="30"
enabled="false"
visible="true" /></sodipodi:namedview><defs
id="defs4" />
<g
id="g15"
transform="matrix(0.129199,0,0,0.129199,22.9215,0.522556)">
<g
transform="matrix(8.25599,0,0,8.25599,-182.056,-21.0726)"
id="g1"
style="display:inline">
<circle
cx="9"
cy="10.5"
r="7.5"
style="display:inline;fill:#3b3b3b"
id="circle1" />
</g>
<g
id="g19"
inkscape:label="grid"
style="display:inline;stroke:#8d8d8d;stroke-opacity:1;stroke-linecap:square"><path
id="path3"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -157.72198 101.92044 L -57.660489 29.22151 " /><path
id="path8"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -130.16207 123.17697 L -45.951829 61.994656 " /><path
id="path10"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -169.42074 62.090704 L -85.342701 123.17697 " /><path
id="path21"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -169.42074 69.140098 L -85.210515 7.9577807 " /><path
id="path23"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -130.16206 8.0538225 L -46.084024 69.140097 " /><path
id="path25"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;stroke:#8d8d8d;stroke-opacity:1;fill:none;fill-opacity:0.7;stroke-width:1.032;stroke-dasharray:none;paint-order:fill markers stroke"
d="M -57.782786 101.92044 L -157.72198 29.310363 " /><circle
cx="9"
cy="10.5"
r="7.5"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;display:inline;fill:none;stroke:#000000;stroke-opacity:1;stroke-width:0.28125025;stroke-dasharray:none;stroke-dashoffset:0"
id="circle2"
transform="matrix(8.2559904,0,0,8.2559904,-182.056,-21.0726)" /></g><path
style="display:none;fill:#ff3c5b;fill-opacity:1;stroke:#ff3c5b;stroke-width:10.32;stroke-dasharray:none;paint-order:fill markers stroke"
d="m -114.85451,70.775398 -31.59786,22.95719"
id="path6"
sodipodi:nodetypes="cc" /><path
style="display:none;fill:#64c818;fill-opacity:1;stroke:#64c818;stroke-width:10.32;stroke-dasharray:none;paint-order:fill markers stroke"
d="m -100.65025,70.775398 31.597858,22.95719"
id="path5"
sodipodi:nodetypes="cc" /><path
style="clip-rule:evenodd;display:none;fill:#2f88e9;fill-opacity:1;fill-rule:evenodd;stroke:#2f88e9;stroke-width:1.33333;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;stroke-dasharray:none;paint-order:fill markers stroke"
d="M 8.9999995,8 V 3"
id="path4"
sodipodi:nodetypes="cc"
transform="matrix(7.739998,0,0,7.739998,-177.41236,-4.0445824)" /><path
style="display:none;fill:#e6e6e6;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m -86.44599,50.135404 -21.30639,-15.479996 -21.30638,15.479996 21.30638,15.479996 z"
id="path11" /><path
style="display:none;fill:#b3b3b3;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="m -129.05876,50.135404 v 30.959992 l 21.30638,15.479996 V 65.6154 Z"
id="path12" /><path
style="display:none;fill:#999999;fill-opacity:0.7;stroke:#1a1a1a;stroke-width:1.032;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke"
d="M -107.75238,96.575392 -86.44599,81.095396 V 50.135404 L -107.75238,65.6154 Z"
id="path13" /></g>
</svg>

Before

Width:  |  Height:  |  Size: 7.0 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="17.5" cy="17.5" r="17.5" style="fill:#fafafa;"/><line x1="10.5" y1="11.5" x2="24.5" y2="11.5" style="fill:none; stroke:#2b3436; stroke-linecap:round; stroke-linejoin:round;"/><line x1="10.5" y1="17.5" x2="24.5" y2="17.5" style="fill:none; stroke:#2b3436; stroke-linecap:round; stroke-linejoin:round;"/><line x1="10.5" y1="23.5" x2="24.5" y2="23.5" style="fill:none; stroke:#2b3436; stroke-linecap:round; stroke-linejoin:round;"/></svg>

After

Width:  |  Height:  |  Size: 575 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="17.5" cy="17.5" r="17.5" style="fill:#393c42;"/><line x1="10.5" y1="11.5" x2="24.5" y2="11.5" style="fill:none; stroke:#b6b6b6; stroke-linecap:round; stroke-linejoin:round;"/><line x1="10.5" y1="17.5" x2="24.5" y2="17.5" style="fill:none; stroke:#b6b6b6; stroke-linecap:round; stroke-linejoin:round;"/><line x1="10.5" y1="23.5" x2="24.5" y2="23.5" style="fill:none; stroke:#b6b6b6; stroke-linecap:round; stroke-linejoin:round;"/></svg>

After

Width:  |  Height:  |  Size: 575 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="17.5" cy="17.5" r="17.5" style="fill:#283232;"/><line x1="10.5" y1="11.5" x2="24.5" y2="11.5" style="fill:none; stroke:#b6b6b6; stroke-linecap:round; stroke-linejoin:round;"/><line x1="10.5" y1="17.5" x2="24.5" y2="17.5" style="fill:none; stroke:#b6b6b6; stroke-linecap:round; stroke-linejoin:round;"/><line x1="10.5" y1="23.5" x2="24.5" y2="23.5" style="fill:none; stroke:#b6b6b6; stroke-linecap:round; stroke-linejoin:round;"/></svg>

After

Width:  |  Height:  |  Size: 575 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="17.5" cy="17.5" r="17.5" style="fill:#e5f0ee;"/><line x1="10.5" y1="11.5" x2="24.5" y2="11.5" style="fill:none; stroke:#2b3436; stroke-linecap:round; stroke-linejoin:round;"/><line x1="10.5" y1="17.5" x2="24.5" y2="17.5" style="fill:none; stroke:#2b3436; stroke-linecap:round; stroke-linejoin:round;"/><line x1="10.5" y1="23.5" x2="24.5" y2="23.5" style="fill:none; stroke:#2b3436; stroke-linecap:round; stroke-linejoin:round;"/></svg>

After

Width:  |  Height:  |  Size: 575 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="17" cy="17" r="17" style="fill:#fafafa;"/><circle cx="16.03" cy="15.97" r="6.47" style="fill:none; stroke:#2b3436; stroke-miterlimit:10;"/><path d="M11.56,15.97c0-2.47,2-4.47,4.47-4.47" style="fill:none; stroke:#2b3436; stroke-miterlimit:10;"/><line x1="20.53" y1="20.47" x2="24.5" y2="24.5" style="fill:none; stroke:#2b3436; stroke-miterlimit:10;"/></svg>

After

Width:  |  Height:  |  Size: 496 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="17.5" cy="17.5" r="17.5" style="fill:#393c42;"/><circle cx="16.03" cy="15.97" r="6.47" style="fill:none; stroke:#b6b6b6; stroke-miterlimit:10; stroke-width:1.08px;"/><path d="M11.56,15.97c0-2.47,2-4.47,4.47-4.47" style="fill:none; stroke:#b6b6b6; stroke-miterlimit:10; stroke-width:.75px;"/><line x1="20.53" y1="20.47" x2="24.5" y2="24.5" style="fill:none; stroke:#b6b6b6; stroke-miterlimit:10;"/></svg>

After

Width:  |  Height:  |  Size: 543 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="17.5" cy="17.5" r="17.5" style="fill:#283232;"/><circle cx="16.03" cy="15.97" r="6.47" style="fill:none; stroke:#b6b6b6; stroke-miterlimit:10; stroke-width:1.08px;"/><path d="M11.56,15.97c0-2.47,2-4.47,4.47-4.47" style="fill:none; stroke:#b6b6b6; stroke-miterlimit:10; stroke-width:.75px;"/><line x1="20.53" y1="20.47" x2="24.5" y2="24.5" style="fill:none; stroke:#b6b6b6; stroke-miterlimit:10;"/></svg>

After

Width:  |  Height:  |  Size: 543 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><svg id="a" xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 36 36"><circle cx="17.5" cy="17.5" r="17.5" style="fill:#e5f0ee;"/><circle cx="16.03" cy="15.97" r="6.47" style="fill:none; stroke:#2b3436; stroke-miterlimit:10;"/><path d="M11.56,15.97c0-2.47,2-4.47,4.47-4.47" style="fill:none; stroke:#2b3436; stroke-miterlimit:10;"/><line x1="20.53" y1="20.47" x2="24.5" y2="24.5" style="fill:none; stroke:#2b3436; stroke-miterlimit:10;"/></svg>

After

Width:  |  Height:  |  Size: 502 B

View File

@@ -314,6 +314,10 @@ void AppConfig::set_defaults()
set("auto_calculate_flush","all");
}
if (get("show_canvas_zoom_button").empty()) {
set_bool("show_canvas_zoom_button", true);
}
if (get("remember_printer_config").empty()) {
set_bool("remember_printer_config", true);
}

View File

@@ -6044,6 +6044,7 @@ static const float cameraProjection[16] = {1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.
void GLCanvas3D::_render_3d_navigator()
{
if (!wxGetApp().show_3d_navigator()) {
m_canvas_toolbar_pos[0] = 0;
return;
}
@@ -6090,7 +6091,7 @@ void GLCanvas3D::_render_3d_navigator()
}
const float size = 128 * sc;
m_axis_button_pos[0] = size - 10;
m_canvas_toolbar_pos[0] = size;
const auto result = ImGuizmo::ViewManipulate(cameraView, cameraProjection, ImGuizmo::OPERATION::ROTATE, ImGuizmo::MODE::WORLD, nullptr,
camDistance, ImVec2(viewManipulateLeft, viewManipulateTop - size), ImVec2(size, size),
0x00101010);
@@ -6126,7 +6127,6 @@ void GLCanvas3D::_render_3d_navigator()
request_extra_frame();
}
_render_camera_toolbar();
}
#define ENABLE_THUMBNAIL_GENERATOR_DEBUG_OUTPUT 0
@@ -7989,6 +7989,8 @@ void GLCanvas3D::_render_overlays()
m_labels.render(sorted_instances);
_render_3d_navigator();
_render_canvas_toolbar();
}
void GLCanvas3D::_render_style_editor()
@@ -8627,47 +8629,169 @@ void GLCanvas3D::_render_return_toolbar() const
imgui.end();
}
void GLCanvas3D::_render_camera_toolbar()
void GLCanvas3D::_render_canvas_toolbar()
{
float font_size = ImGui::GetFontSize();
float sc = get_scale();
ImVec2 button_icon_size = ImVec2(font_size * 2.5, font_size * 2.5);
ImGuiWrapper &imgui = *wxGetApp().imgui();
float sc = get_scale();
ImGuiWrapper &imgui = *wxGetApp().imgui();
float window_width = button_icon_size.x + imgui.scaled(2.0f);
float window_height = button_icon_size.y + imgui.scaled(2.0f);
#ifdef WIN32
const int dpi = get_dpi_for_window(wxGetApp().GetTopWindow());
sc *= (float) dpi / (float) DPI_DEFAULT;
#endif // WIN32
Size cnv_size = get_canvas_size();
m_axis_button_pos[1] = cnv_size.get_height() - button_icon_size[1] - 20 * sc;
imgui.set_next_window_pos(m_axis_button_pos[0], m_axis_button_pos[1], ImGuiCond_Always, 0, 0);
#ifdef __WINDOWS__
imgui.set_next_window_size(window_width, window_height, ImGuiCond_Always);
#endif
ImVec2 btn_size = ImVec2(36.f, 36.f) * sc;
ImVec2 margin = ImVec2(m_canvas_toolbar_pos[0] > 0 ? 0.f : (10.f * sc), 10.f * sc);
ImVec2 spacing = ImVec2(6.f, 6.f) * sc;
ImVec2 padding = ImVec2(2.f, 2.f) * sc;
Vec2i32 pos = {
m_canvas_toolbar_pos[0] + margin.x,
get_canvas_size().get_height() - margin.y
};
bool zoom_btn = wxGetApp().show_canvas_zoom_button();
imgui.begin(_L("Toggle Axis"), ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoMove |
imgui.set_next_window_pos(pos[0], pos[1], ImGuiCond_Always, 0, 1); // pivot bottom-left
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0 );
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding , {0,0});
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing , {0,0});
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding , padding); // without padding images clipping
imgui.begin(_L("Canvas Toolbar"), ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoMove |
ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse);//
ImTextureID normal_id = m_gizmos.get_icon_texture_id(m_is_dark ? GLGizmosManager::MENU_ICON_NAME::IC_AXIS_TOGGLE_DARK : GLGizmosManager::MENU_ICON_NAME::IC_AXIS_TOGGLE);
ImTextureID hover_id = m_gizmos.get_icon_texture_id(m_is_dark ? GLGizmosManager::MENU_ICON_NAME::IC_AXIS_TOGGLE_DARK_HOVER : GLGizmosManager::MENU_ICON_NAME::IC_AXIS_TOGGLE_HOVER);
ImTextureID m_normal_id = m_gizmos.get_icon_texture_id(m_is_dark ? GLGizmosManager::MENU_ICON_NAME::IC_CANVAS_MENU_DARK : GLGizmosManager::MENU_ICON_NAME::IC_CANVAS_MENU);
ImTextureID m_hover_id = m_gizmos.get_icon_texture_id(m_is_dark ? GLGizmosManager::MENU_ICON_NAME::IC_CANVAS_MENU_DARK_HOVER : GLGizmosManager::MENU_ICON_NAME::IC_CANVAS_MENU_HOVER);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, {0, 0});
if (ImGui::ImageButton3(normal_id, hover_id, button_icon_size, ImVec2(0, 0), ImVec2(1, 1), -1,
ImVec4(0, 0, 0, 0), ImVec4(1, 1, 1, 1), ImVec2(10, 0))) {
//select_view("plate");
if (m_canvas_type == ECanvasType::CanvasView3D || m_canvas_type == ECanvasType::CanvasPreview) {
toggle_world_axes_visibility(false);
if (ImGui::ImageButton3(m_normal_id, m_hover_id, btn_size)) {
if(!ImGui::IsPopupOpen("CanvasToolbarMenu")){
ImGui::SetNextWindowPos(ImVec2(pos[0] + padding.x, pos[1] - padding.y - (zoom_btn ? (btn_size.y + spacing.y) : 0.f)), ImGuiCond_Always, ImVec2(0, 1)); // pivot bottom-left
ImGui::OpenPopup("CanvasToolbarMenu");
}
}
if(zoom_btn){
ImGui::Dummy({ 0, spacing.y});
ImTextureID z_normal_id = m_gizmos.get_icon_texture_id(m_is_dark ? GLGizmosManager::MENU_ICON_NAME::IC_CANVAS_ZOOM_DARK : GLGizmosManager::MENU_ICON_NAME::IC_CANVAS_ZOOM);
ImTextureID z_hover_id = m_gizmos.get_icon_texture_id(m_is_dark ? GLGizmosManager::MENU_ICON_NAME::IC_CANVAS_ZOOM_DARK_HOVER : GLGizmosManager::MENU_ICON_NAME::IC_CANVAS_ZOOM_HOVER);
if (ImGui::ImageButton3(z_normal_id, z_hover_id, btn_size)) {
select_view("plate");
if (m_selection.is_empty()) {
if (m_canvas_type == ECanvasType::CanvasAssembleView)
zoom_to_volumes();
else
zoom_to_bed();
} else {
zoom_to_selection();
}
} else if (ImGui::IsItemHovered()) {
auto tooltip = _L("Fit camera to scene or selected object.");
auto width = ImGui::CalcTextSize(tooltip.c_str()).x + imgui.scaled(2.0f);
imgui.tooltip(tooltip, width);
}
}
if (ImGui::IsItemHovered()) {
auto temp_tooltip = _L("Toggle Axis");
auto width = ImGui::CalcTextSize(temp_tooltip.c_str()).x + imgui.scaled(2.0f);
imgui.tooltip(temp_tooltip, width);
ImGui::PopStyleVar(4); // Window
ImGui::PushStyleColor(ImGuiCol_PopupBg , m_is_dark ? ImGuiWrapper::COL_TOOLBAR_BG_DARK : ImGuiWrapper::COL_TOOLBAR_BG);
ImGui::PushStyleColor(ImGuiCol_Separator , m_is_dark ? ImVec4(1, 1, 1, .20f) : ImVec4(0, 0, 0, .2f));
ImGui::PushStyleColor(ImGuiCol_Text , m_is_dark ? ImVec4(1, 1, 1, .88f) : ImVec4(50 / 255.f, 58 / 255.f, 61 / 255.f, 1.f));
ImGui::PushStyleColor(ImGuiCol_TextDisabled , m_is_dark ? ImVec4(1, 1, 1, .44f) : ImVec4(50 / 255.f, 58 / 255.f, 61 / 255.f, .5f));
ImGui::PushStyleColor(ImGuiCol_HeaderHovered , ImVec4(0, 0, 0, 0.f)); // bg color for menu item
ImGui::PushStyleColor(ImGuiCol_BorderActive , ImGuiWrapper::COL_ORCA);
ImGui::PushStyleVar(ImGuiStyleVar_PopupBorderSize, 0.f );
ImGui::PushStyleVar(ImGuiStyleVar_PopupRounding , 8.f * sc);
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.f * sc);
ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding , 2.f * sc);
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding , ImVec2(4.f, 10.f) * sc);
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing , ImVec2(0.f, 8.f ) * sc);
if (ImGui::BeginPopup("CanvasToolbarMenu")) {
ImGui::PushItemFlag(ImGuiItemFlags_SelectableDontClosePopup, true);
Plater* p = wxGetApp().plater();
AppConfig* cfg = wxGetApp().app_config;
auto create_menu_item = [this, sc](
const std::string& name,
bool enable,
bool condition,
const std::function<void()>& action
) {
ImGui::Dummy({2.f * sc,0});
ImGui::SameLine();
if (ImGui::BBLMenuItem((" " + _u8L(name)).c_str(), nullptr, false, enable, ImGui::CalcTextSize(_u8L(name).c_str()).y))
action();
ImGui::SameLine(12.f * sc);
ImGui::TextColored(enable ? ImVec4(1,1,1,1) : ImGui::GetStyleColorVec4(ImGuiCol_TextDisabled), "%s", into_u8(condition ? ImGui::VisibleIcon : ImGui::HiddenIcon).c_str());
};
create_menu_item( "3D Navigator",
m_canvas_type != ECanvasType::CanvasAssembleView, // not work on assembly
wxGetApp().show_3d_navigator(),
[this]{
wxGetApp().toggle_show_3d_navigator();
ImGui::CloseCurrentPopup(); // Close popup to show changes on UI
}
);
create_menu_item( "Zoom button",
true, // work on all
wxGetApp().show_canvas_zoom_button(),
[this]{
wxGetApp().toggle_canvas_zoom_button();
ImGui::CloseCurrentPopup(); // Close popup to show changes on UI
}
);
ImGui::Separator();
create_menu_item( "Overhangs",
m_canvas_type == ECanvasType::CanvasView3D, // work only on prepare
p->is_view3D_overhang_shown(),
[this, p]{p->show_view3D_overhang(!p->is_view3D_overhang_shown());}
);
create_menu_item( "Outline",
m_canvas_type != ECanvasType::CanvasPreview, // not work on preview
wxGetApp().show_outline(),
[this]{wxGetApp().toggle_show_outline();}
);
ImGui::Separator();
create_menu_item( "Perspective",
true, // work on all
cfg->get_bool("use_perspective_camera"),
[this, &cfg]{
cfg->set_bool("use_perspective_camera", !(cfg->get_bool("use_perspective_camera")));
wxGetApp().update_ui_from_settings();
}
);
ImGui::Separator();
create_menu_item( "Axes",
m_canvas_type != ECanvasType::CanvasAssembleView, // not work on assembly
m_show_world_axes,
[this]{toggle_world_axes_visibility(false);}
);
// will add an option for gridlines in here
create_menu_item( "Labels",
m_canvas_type == ECanvasType::CanvasView3D, // work only on prepare
p->are_view3D_labels_shown(),
[this, p]{p->show_view3D_labels(!p->are_view3D_labels_shown());}
);
ImGui::PopItemFlag();
ImGui::EndPopup();
}
ImGui::PopStyleVar(2);
ImGui::PopStyleColor(6);
ImGui::PopStyleVar(6);
imgui.end();
}

View File

@@ -543,7 +543,7 @@ private:
mutable IMToolbar m_sel_plate_toolbar;
mutable GLToolbar m_assemble_view_toolbar;
mutable IMReturnToolbar m_return_toolbar;
mutable Vec2i32 m_axis_button_pos = {128, 5};
mutable Vec2i32 m_canvas_toolbar_pos = {140, 5};
mutable float m_sc{1};
mutable float m_paint_toolbar_width;
@@ -1246,7 +1246,7 @@ private:
void _render_imgui_select_plate_toolbar();
void _render_assemble_view_toolbar() const;
void _render_return_toolbar() const;
void _render_camera_toolbar();
void _render_canvas_toolbar();
void _render_separator_toolbar_right() const;
void _render_separator_toolbar_left() const;
void _render_collapse_toolbar() const;

View File

@@ -355,6 +355,9 @@ public:
bool show_3d_navigator() const { return app_config->get_bool("show_3d_navigator"); }
void toggle_show_3d_navigator() const { app_config->set_bool("show_3d_navigator", !show_3d_navigator()); }
bool show_canvas_zoom_button() const { return app_config->get_bool("show_canvas_zoom_button"); }
void toggle_canvas_zoom_button() const { app_config->set_bool("show_canvas_zoom_button", !show_canvas_zoom_button()); }
bool show_outline() const { return app_config->get_bool("show_outline"); }
void toggle_show_outline() const { app_config->set_bool("show_outline", !show_outline()); }

View File

@@ -281,23 +281,43 @@ bool GLGizmosManager::init_icon_textures()
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/axis_toggle.svg", 64, 64, texture_id))
icon_list.insert(std::make_pair((int) IC_AXIS_TOGGLE, texture_id));
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_menu.svg", 72, 72, texture_id))
icon_list.insert(std::make_pair((int) IC_CANVAS_MENU, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/axis_toggle_hover.svg", 64, 64, texture_id))
icon_list.insert(std::make_pair((int) IC_AXIS_TOGGLE_HOVER, texture_id));
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_menu_hover.svg", 72, 72, texture_id))
icon_list.insert(std::make_pair((int) IC_CANVAS_MENU_HOVER, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/axis_toggle_dark.svg", 64, 64, texture_id))
icon_list.insert(std::make_pair((int) IC_AXIS_TOGGLE_DARK, texture_id));
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_menu_dark.svg", 72, 72, texture_id))
icon_list.insert(std::make_pair((int) IC_CANVAS_MENU_DARK, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/axis_toggle_hover_dark.svg", 64, 64, texture_id))
icon_list.insert(std::make_pair((int) IC_AXIS_TOGGLE_DARK_HOVER, texture_id));
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_menu_dark_hover.svg", 72, 72, texture_id))
icon_list.insert(std::make_pair((int) IC_CANVAS_MENU_DARK_HOVER, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_zoom.svg", 72, 72, texture_id))
icon_list.insert(std::make_pair((int) IC_CANVAS_ZOOM, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_zoom_hover.svg", 72, 72, texture_id))
icon_list.insert(std::make_pair((int) IC_CANVAS_ZOOM_HOVER, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_zoom_dark.svg", 72, 72, texture_id))
icon_list.insert(std::make_pair((int) IC_CANVAS_ZOOM_DARK, texture_id));
else
return false;
if (IMTexture::load_from_svg_file(Slic3r::resources_dir() + "/images/canvas_zoom_dark_hover.svg", 72, 72, texture_id))
icon_list.insert(std::make_pair((int) IC_CANVAS_ZOOM_DARK_HOVER, texture_id));
else
return false;

View File

@@ -170,10 +170,14 @@ public:
IC_TOOLBAR_TOOLTIP,
IC_TOOLBAR_TOOLTIP_HOVER,
IC_NAME_COUNT,
IC_AXIS_TOGGLE,
IC_AXIS_TOGGLE_HOVER,
IC_AXIS_TOGGLE_DARK,
IC_AXIS_TOGGLE_DARK_HOVER,
IC_CANVAS_MENU,
IC_CANVAS_MENU_HOVER,
IC_CANVAS_MENU_DARK,
IC_CANVAS_MENU_DARK_HOVER,
IC_CANVAS_ZOOM,
IC_CANVAS_ZOOM_HOVER,
IC_CANVAS_ZOOM_DARK,
IC_CANVAS_ZOOM_DARK_HOVER,
};
explicit GLGizmosManager(GLCanvas3D& parent);