mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-25 17:18:49 -07:00
toggle axis visibility on canvas (#9666)
* toggle axis visibility on canvas * set show_axes config on toggle
This commit is contained in:
parent
bcb0387e0e
commit
2ae3378605
9 changed files with 774 additions and 12 deletions
167
resources/images/axis_toggle.svg
Normal file
167
resources/images/axis_toggle.svg
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
<?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>
|
||||
|
After Width: | Height: | Size: 7 KiB |
167
resources/images/axis_toggle_dark.svg
Normal file
167
resources/images/axis_toggle_dark.svg
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
<?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>
|
||||
|
After Width: | Height: | Size: 7.1 KiB |
167
resources/images/axis_toggle_hover.svg
Normal file
167
resources/images/axis_toggle_hover.svg
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
<?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>
|
||||
|
After Width: | Height: | Size: 7 KiB |
167
resources/images/axis_toggle_hover_dark.svg
Normal file
167
resources/images/axis_toggle_hover_dark.svg
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
<?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>
|
||||
|
After Width: | Height: | Size: 7 KiB |
|
|
@ -214,6 +214,9 @@ void AppConfig::set_defaults()
|
|||
|
||||
if (get("show_outline").empty())
|
||||
set_bool("show_outline", false);
|
||||
|
||||
if (get("show_axes").empty())
|
||||
set_bool("show_axes", true);
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
|
|
|
|||
|
|
@ -1258,6 +1258,8 @@ bool GLCanvas3D::init()
|
|||
// init dark mode status
|
||||
on_change_color_mode(wxGetApp().app_config->get("dark_color_mode") == "1", false);
|
||||
|
||||
m_show_world_axes = wxGetApp().app_config->get("show_axes") == "true";
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) <<__FUNCTION__<< " enter";
|
||||
glsafe(::glClearColor(1.0f, 1.0f, 1.0f, 1.0f));
|
||||
glsafe(::glClearDepth(1.0f));
|
||||
|
|
@ -1534,6 +1536,17 @@ ModelInstanceEPrintVolumeState GLCanvas3D::check_volumes_outside_state(ObjectFil
|
|||
return state;
|
||||
}
|
||||
|
||||
void GLCanvas3D::toggle_world_axes_visibility(bool force_show)
|
||||
{
|
||||
if (force_show) {
|
||||
m_show_world_axes = true;
|
||||
} else {
|
||||
m_show_world_axes = !m_show_world_axes;
|
||||
}
|
||||
wxGetApp().app_config->set_bool("show_axes", m_show_world_axes);
|
||||
set_as_dirty();
|
||||
}
|
||||
|
||||
void GLCanvas3D::toggle_selected_volume_visibility(bool selected_visible)
|
||||
{
|
||||
m_render_sla_auxiliaries = !selected_visible;
|
||||
|
|
@ -2085,7 +2098,7 @@ void GLCanvas3D::render(bool only_init)
|
|||
_render_background();
|
||||
|
||||
//BBS add partplater rendering logic
|
||||
bool only_current = false, only_body = false, show_axes = true, no_partplate = false;
|
||||
bool only_current = false, only_body = false, no_partplate = false;
|
||||
bool show_grid = true;
|
||||
GLGizmosManager::EType gizmo_type = m_gizmos.get_current_type();
|
||||
if (!m_main_toolbar.is_enabled()) {
|
||||
|
|
@ -2105,7 +2118,7 @@ void GLCanvas3D::render(bool only_init)
|
|||
_render_sla_slices();
|
||||
_render_selection();
|
||||
if (!no_partplate)
|
||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), show_axes);
|
||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), m_show_world_axes);
|
||||
if (!no_partplate) //BBS: add outline logic
|
||||
_render_platelist(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), only_current, only_body, hover_id, true, show_grid);
|
||||
_render_objects(GLVolumeCollection::ERenderType::Transparent, !m_gizmos.is_running());
|
||||
|
|
@ -2115,7 +2128,7 @@ void GLCanvas3D::render(bool only_init)
|
|||
_render_objects(GLVolumeCollection::ERenderType::Opaque, !m_gizmos.is_running());
|
||||
_render_sla_slices();
|
||||
_render_selection();
|
||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), show_axes);
|
||||
_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), m_show_world_axes);
|
||||
_render_platelist(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), only_current, true, hover_id);
|
||||
// BBS: GUI refactor: add canvas size as parameters
|
||||
_render_gcode(cnv_size.get_width(), cnv_size.get_height());
|
||||
|
|
@ -2123,9 +2136,9 @@ void GLCanvas3D::render(bool only_init)
|
|||
/* assemble render*/
|
||||
else if (m_canvas_type == ECanvasType::CanvasAssembleView) {
|
||||
//BBS: add outline logic
|
||||
if (m_show_world_axes) {
|
||||
m_axes.render();
|
||||
}
|
||||
//if (m_show_world_axes) {
|
||||
// m_axes.render();
|
||||
//}
|
||||
_render_objects(GLVolumeCollection::ERenderType::Opaque, !m_gizmos.is_running());
|
||||
_render_selection();
|
||||
//_render_bed(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), show_axes);
|
||||
|
|
@ -6069,6 +6082,7 @@ void GLCanvas3D::_render_3d_navigator()
|
|||
}
|
||||
|
||||
const float size = 128 * sc;
|
||||
m_axis_button_pos[0] = size - 10;
|
||||
const auto result = ImGuizmo::ViewManipulate(cameraView, cameraProjection, ImGuizmo::OPERATION::ROTATE, ImGuizmo::MODE::WORLD, nullptr,
|
||||
camDistance, ImVec2(viewManipulateLeft, viewManipulateTop - size), ImVec2(size, size),
|
||||
0x00101010);
|
||||
|
|
@ -6104,6 +6118,7 @@ void GLCanvas3D::_render_3d_navigator()
|
|||
|
||||
request_extra_frame();
|
||||
}
|
||||
_render_camera_toolbar();
|
||||
}
|
||||
|
||||
#define ENABLE_THUMBNAIL_GENERATOR_DEBUG_OUTPUT 0
|
||||
|
|
@ -8604,6 +8619,51 @@ void GLCanvas3D::_render_return_toolbar() const
|
|||
imgui.end();
|
||||
}
|
||||
|
||||
void GLCanvas3D::_render_camera_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 window_width = button_icon_size.x + imgui.scaled(2.0f);
|
||||
float window_height = button_icon_size.y + imgui.scaled(2.0f);
|
||||
|
||||
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
|
||||
|
||||
imgui.begin(_L("Toggle Axis"), 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);
|
||||
|
||||
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::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(2);
|
||||
|
||||
imgui.end();
|
||||
}
|
||||
|
||||
void GLCanvas3D::_render_separator_toolbar_right() const
|
||||
{
|
||||
if (!m_separator_toolbar.is_enabled())
|
||||
|
|
|
|||
|
|
@ -542,6 +542,8 @@ 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 float m_sc{1};
|
||||
mutable float m_paint_toolbar_width;
|
||||
|
||||
//BBS: add canvas type for assemble view usage
|
||||
|
|
@ -625,7 +627,7 @@ private:
|
|||
|
||||
PrinterTechnology current_printer_technology() const;
|
||||
|
||||
bool m_show_world_axes{false};
|
||||
bool m_show_world_axes{true};
|
||||
Bed3D::Axes m_axes;
|
||||
//BBS:record key botton frequency
|
||||
int auto_orient_count = 0;
|
||||
|
|
@ -821,7 +823,7 @@ public:
|
|||
void set_color_clip_plane(const Vec3d& cp_normal, double offset) { m_volumes.set_color_clip_plane(cp_normal, offset); }
|
||||
void set_color_clip_plane_colors(const std::array<ColorRGBA, 2>& colors) { m_volumes.set_color_clip_plane_colors(colors); }
|
||||
|
||||
void set_show_world_axes(bool flag) { m_show_world_axes = flag; }
|
||||
void toggle_world_axes_visibility(bool force_show = false);
|
||||
void refresh_camera_scene_box();
|
||||
void set_color_by(const std::string& value);
|
||||
|
||||
|
|
@ -1243,6 +1245,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_separator_toolbar_right() const;
|
||||
void _render_separator_toolbar_left() const;
|
||||
void _render_collapse_toolbar() const;
|
||||
|
|
|
|||
|
|
@ -183,8 +183,9 @@ void GLGizmosManager::switch_gizmos_icon_filename()
|
|||
|
||||
bool GLGizmosManager::init()
|
||||
{
|
||||
bool result = init_icon_textures();
|
||||
if (!result) return result;
|
||||
if (!m_gizmos.empty())
|
||||
return true;
|
||||
init_icon_textures();
|
||||
|
||||
m_background_texture.metadata.filename = m_is_dark ? "toolbar_background_dark.png" : "toolbar_background.png";
|
||||
m_background_texture.metadata.left = 16;
|
||||
|
|
@ -241,9 +242,12 @@ bool GLGizmosManager::init()
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::map<int, void *> GLGizmosManager::icon_list = {};
|
||||
bool GLGizmosManager::init_icon_textures()
|
||||
{
|
||||
if (icon_list.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
ImTextureID texture_id;
|
||||
|
||||
icon_list.clear();
|
||||
|
|
@ -277,6 +281,26 @@ 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));
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
else
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ private:
|
|||
void on_set_color_timer(wxTimerEvent& evt);
|
||||
|
||||
// key MENU_ICON_NAME, value = ImtextureID
|
||||
std::map<int, void*> icon_list;
|
||||
static std::map<int, void*> icon_list;
|
||||
|
||||
bool m_is_dark = false;
|
||||
|
||||
|
|
@ -170,6 +170,10 @@ 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,
|
||||
};
|
||||
|
||||
explicit GLGizmosManager(GLCanvas3D& parent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue