ENH: refine set partplate bedtype dialog & button
Change-Id: Icf1ec314f04c6156e92f2f5a8646b97cf4c2220c
|
@ -1,10 +1,10 @@
|
|||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M35.9906 38.8906H3.79059C2.19059 38.8906 0.890625 37.5906 0.890625 35.9906V3.79063C0.890625 2.19063 2.19059 0.890625 3.79059 0.890625H35.9906C37.5906 0.890625 38.8906 2.19063 38.8906 3.79063V35.9906C38.8906 37.5906 37.5906 38.8906 35.9906 38.8906Z" fill="#E9E9E9"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79051 1.7811C2.68237 1.7811 1.7811 2.68238 1.7811 3.79056V35.9906C1.7811 37.0987 2.68236 38 3.79051 38H35.9905C37.0987 38 38 37.0987 38 35.9906V3.79056C38 2.6824 37.0987 1.7811 35.9905 1.7811H3.79051ZM0 3.79056C0 1.69874 1.69866 0 3.79051 0H35.9905C38.0824 0 39.7811 1.69872 39.7811 3.79056V35.9906C39.7811 38.0824 38.0823 39.7811 35.9905 39.7811H3.79051C1.69866 39.7811 0 38.0824 0 35.9906V3.79056Z" fill="#545454"/>
|
||||
<path d="M19.3542 30.127H8.43512C7.41277 30.127 6.58398 30.9557 6.58398 31.9781V31.9781C6.58398 33.0004 7.41277 33.8292 8.43512 33.8292H21.6319" stroke="#545454" stroke-width="1.8" stroke-linecap="round"/>
|
||||
<path d="M11.0792 6.9375L8.18941 9.74764C7.75263 10.1724 7.79395 10.8857 8.27686 11.2572L11.2082 13.5121C11.7285 13.9124 11.7285 14.697 11.2082 15.0973L8.39172 17.2638C7.87134 17.6641 7.87134 18.4488 8.39172 18.8491L11.2711 21.064C11.7715 21.4489 11.7943 22.1955 11.3185 22.6103L8.32213 25.2226" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M19.6944 6.9375L16.8046 9.74764C16.3679 10.1724 16.4092 10.8857 16.8921 11.2572L19.8234 13.5121C20.3438 13.9124 20.3438 14.697 19.8234 15.0973L17.007 17.2638C16.4866 17.6641 16.4866 18.4488 17.007 18.8491L19.8863 21.064C20.3867 21.4489 20.4096 22.1955 19.9337 22.6103L16.9374 25.2226" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M28.3077 6.9375L25.4179 9.74764C24.9811 10.1724 25.0225 10.8857 25.5054 11.2572L28.4367 13.5121C28.9571 13.9124 28.9571 14.697 28.4367 15.0973L24.5898 18.0564" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M36.0003 27.2947C36.0181 27.3257 36.0181 27.3638 36.0003 27.3947L32.4922 33.471C32.4743 33.5019 32.4413 33.521 32.4056 33.521L25.3893 33.521C25.3536 33.521 25.3206 33.5019 25.3027 33.471L21.7946 27.3947C21.7768 27.3638 21.7768 27.3257 21.7946 27.2947L25.3027 21.2185C25.3206 21.1876 25.3536 21.1685 25.3893 21.1685L32.4056 21.1685C32.4413 21.1685 32.4743 21.1876 32.4922 21.2185L36.0003 27.2947Z" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
<circle cx="28.897" cy="27.3452" r="2.32605" transform="rotate(90 28.897 27.3452)" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
<svg width="40" height="41" viewBox="0 0 40 41" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M35.9905 39.6718H3.79051C2.19051 39.6718 0.890549 38.3718 0.890549 36.7718V4.57181C0.890549 2.97181 2.19051 1.6718 3.79051 1.6718H35.9905C37.5905 1.6718 38.8905 2.97181 38.8905 4.57181V36.7718C38.8905 38.3718 37.5905 39.6718 35.9905 39.6718Z" fill="#E9E9E9"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79051 2.56235C2.68237 2.56235 1.7811 3.46363 1.7811 4.57181V36.7718C1.7811 37.88 2.68236 38.7812 3.79051 38.7812H35.9905C37.0987 38.7812 38 37.88 38 36.7718V4.57181C38 3.46365 37.0987 2.56235 35.9905 2.56235H3.79051ZM0 4.57181C0 2.47999 1.69866 0.78125 3.79051 0.78125H35.9905C38.0824 0.78125 39.7811 2.47997 39.7811 4.57181V36.7718C39.7811 38.8637 38.0823 40.5623 35.9905 40.5623H3.79051C1.69866 40.5623 0 38.8636 0 36.7718V4.57181Z" fill="#545454"/>
|
||||
<path d="M19.3542 30.9082H8.43512C7.41277 30.9082 6.58398 31.737 6.58398 32.7593V32.7593C6.58398 33.7817 7.41277 34.6105 8.43512 34.6105H21.6319" stroke="#545454" stroke-width="1.8" stroke-linecap="round"/>
|
||||
<path d="M11.0792 7.71875L8.18941 10.5289C7.75263 10.9536 7.79395 11.6669 8.27686 12.0384L11.2082 14.2933C11.7285 14.6936 11.7285 15.4782 11.2082 15.8785L8.39172 18.0451C7.87134 18.4454 7.87134 19.23 8.39172 19.6303L11.2711 21.8452C11.7715 22.2301 11.7943 22.9767 11.3185 23.3916L8.32213 26.0039" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M19.6944 7.71875L16.8046 10.5289C16.3679 10.9536 16.4092 11.6669 16.8921 12.0384L19.8234 14.2933C20.3438 14.6936 20.3438 15.4782 19.8234 15.8785L17.007 18.0451C16.4866 18.4454 16.4866 19.23 17.007 19.6303L19.8863 21.8452C20.3867 22.2301 20.4096 22.9767 19.9337 23.3916L16.9374 26.0039" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M28.3077 7.71875L25.4179 10.5289C24.9811 10.9536 25.0225 11.6669 25.5054 12.0384L28.4367 14.2933C28.9571 14.6936 28.9571 15.4782 28.4367 15.8785L24.5898 18.8377" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M36.0003 28.176L32.4922 34.2522C32.4743 34.2831 32.4413 34.3022 32.4056 34.3022L25.3894 34.3022C25.3536 34.3022 25.3206 34.2831 25.3028 34.2522L21.7947 28.176C21.7768 28.145 21.7768 28.1069 21.7947 28.076L25.3028 21.9998C25.3206 21.9688 25.3536 21.9498 25.3894 21.9498L32.4056 21.9498C32.4413 21.9498 32.4743 21.9688 32.4922 21.9998L36.0003 28.076C36.0182 28.1069 36.0182 28.145 36.0003 28.176Z" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
<circle cx="28.8972" cy="28.1263" r="2.32605" transform="rotate(90 28.8972 28.1263)" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
@ -0,0 +1,10 @@
|
|||
<svg width="40" height="41" viewBox="0 0 40 41" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M35.9906 39.6719H3.79059C2.19059 39.6719 0.890625 38.3719 0.890625 36.7719V4.57188C0.890625 2.97188 2.19059 1.67188 3.79059 1.67188H35.9906C37.5906 1.67188 38.8906 2.97188 38.8906 4.57188V36.7719C38.8906 38.3719 37.5906 39.6719 35.9906 39.6719Z" fill="#D6D6D6"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79051 2.56235C2.68237 2.56235 1.7811 3.46363 1.7811 4.57181V36.7718C1.7811 37.88 2.68236 38.7812 3.79051 38.7812H35.9905C37.0987 38.7812 38 37.88 38 36.7718V4.57181C38 3.46365 37.0987 2.56235 35.9905 2.56235H3.79051ZM0 4.57181C0 2.47999 1.69866 0.78125 3.79051 0.78125H35.9905C38.0824 0.78125 39.7811 2.47997 39.7811 4.57181V36.7718C39.7811 38.8637 38.0823 40.5623 35.9905 40.5623H3.79051C1.69866 40.5623 0 38.8636 0 36.7718V4.57181Z" fill="#545454"/>
|
||||
<path d="M19.3542 30.9082H8.43512C7.41277 30.9082 6.58398 31.737 6.58398 32.7593V32.7593C6.58398 33.7817 7.41277 34.6105 8.43512 34.6105H21.6319" stroke="#FF6F00" stroke-width="1.8" stroke-linecap="round"/>
|
||||
<path d="M11.0792 7.71875L8.18941 10.5289C7.75263 10.9536 7.79395 11.6669 8.27686 12.0384L11.2082 14.2933C11.7285 14.6936 11.7285 15.4782 11.2082 15.8785L8.39172 18.0451C7.87134 18.4454 7.87134 19.23 8.39172 19.6303L11.2711 21.8452C11.7715 22.2301 11.7943 22.9767 11.3185 23.3916L8.32213 26.0039" stroke="#FF6F00" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M19.6944 7.71875L16.8046 10.5289C16.3679 10.9536 16.4092 11.6669 16.8921 12.0384L19.8234 14.2933C20.3438 14.6936 20.3438 15.4782 19.8234 15.8785L17.007 18.0451C16.4866 18.4454 16.4866 19.23 17.007 19.6303L19.8863 21.8452C20.3867 22.2301 20.4096 22.9767 19.9337 23.3916L16.9374 26.0039" stroke="#FF6F00" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M28.3077 7.71875L25.4179 10.5289C24.9811 10.9536 25.0225 11.6669 25.5054 12.0384L28.4367 14.2933C28.9571 14.6936 28.9571 15.4782 28.4367 15.8785L24.5898 18.8377" stroke="#FF6F00" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M36.0003 28.176L32.4922 34.2522C32.4743 34.2831 32.4413 34.3022 32.4056 34.3022L25.3893 34.3022C25.3536 34.3022 25.3206 34.2831 25.3027 34.2522L21.7946 28.176C21.7768 28.145 21.7768 28.1069 21.7946 28.076L25.3027 21.9998C25.3206 21.9688 25.3536 21.9498 25.3893 21.9498L32.4056 21.9498C32.4413 21.9498 32.4743 21.9688 32.4922 21.9998L36.0003 28.076C36.0181 28.1069 36.0181 28.145 36.0003 28.176Z" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
<circle cx="28.897" cy="28.1264" r="2.32605" transform="rotate(90 28.897 28.1264)" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
</svg>
|
After Width: | Height: | Size: 2.7 KiB |
|
@ -1,10 +1,10 @@
|
|||
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M35.9905 38.8906H3.79051C2.19051 38.8906 0.890549 37.5906 0.890549 35.9906V3.79057C0.890549 2.19057 2.19051 0.890564 3.79051 0.890564H35.9905C37.5905 0.890564 38.8905 2.19057 38.8905 3.79057V35.9906C38.8905 37.5906 37.5905 38.8906 35.9905 38.8906Z" fill="#D6D6D6"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79051 1.7811C2.68237 1.7811 1.7811 2.68238 1.7811 3.79056V35.9906C1.7811 37.0987 2.68236 38 3.79051 38H35.9905C37.0987 38 38 37.0987 38 35.9906V3.79056C38 2.6824 37.0987 1.7811 35.9905 1.7811H3.79051ZM0 3.79056C0 1.69874 1.69866 0 3.79051 0H35.9905C38.0824 0 39.7811 1.69872 39.7811 3.79056V35.9906C39.7811 38.0824 38.0823 39.7811 35.9905 39.7811H3.79051C1.69866 39.7811 0 38.0824 0 35.9906V3.79056Z" fill="#545454"/>
|
||||
<path d="M19.3542 30.127H8.43512C7.41277 30.127 6.58398 30.9557 6.58398 31.9781V31.9781C6.58398 33.0004 7.41277 33.8292 8.43512 33.8292H21.6319" stroke="#545454" stroke-width="1.8" stroke-linecap="round"/>
|
||||
<path d="M11.0792 6.9375L8.18941 9.74764C7.75263 10.1724 7.79395 10.8857 8.27686 11.2572L11.2082 13.5121C11.7285 13.9124 11.7285 14.697 11.2082 15.0973L8.39172 17.2638C7.87134 17.6641 7.87134 18.4488 8.39172 18.8491L11.2711 21.064C11.7715 21.4489 11.7943 22.1955 11.3185 22.6103L8.32213 25.2226" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M19.6944 6.9375L16.8046 9.74764C16.3679 10.1724 16.4092 10.8857 16.8921 11.2572L19.8234 13.5121C20.3438 13.9124 20.3438 14.697 19.8234 15.0973L17.007 17.2638C16.4866 17.6641 16.4866 18.4488 17.007 18.8491L19.8863 21.064C20.3867 21.4489 20.4096 22.1955 19.9337 22.6103L16.9374 25.2226" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M28.3077 6.9375L25.4179 9.74764C24.9811 10.1724 25.0225 10.8857 25.5054 11.2572L28.4367 13.5121C28.9571 13.9124 28.9571 14.697 28.4367 15.0973L24.5898 18.0564" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M36.0003 27.3947L32.4922 33.471C32.4743 33.5019 32.4413 33.521 32.4056 33.521L25.3894 33.521C25.3536 33.521 25.3206 33.5019 25.3028 33.471L21.7947 27.3947C21.7768 27.3638 21.7768 27.3257 21.7947 27.2947L25.3028 21.2185C25.3206 21.1876 25.3536 21.1685 25.3894 21.1685L32.4056 21.1685C32.4413 21.1685 32.4743 21.1876 32.4922 21.2185L36.0003 27.2947C36.0182 27.3257 36.0182 27.3638 36.0003 27.3947Z" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
<circle cx="28.8972" cy="27.345" r="2.32605" transform="rotate(90 28.8972 27.345)" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
<svg width="40" height="41" viewBox="0 0 40 41" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M35.9905 39.6718H3.79051C2.19051 39.6718 0.890549 38.3718 0.890549 36.7718V4.57181C0.890549 2.97181 2.19051 1.6718 3.79051 1.6718H35.9905C37.5905 1.6718 38.8905 2.97181 38.8905 4.57181V36.7718C38.8905 38.3718 37.5905 39.6718 35.9905 39.6718Z" fill="#D6D6D6"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.79051 2.56235C2.68237 2.56235 1.7811 3.46363 1.7811 4.57181V36.7718C1.7811 37.88 2.68236 38.7812 3.79051 38.7812H35.9905C37.0987 38.7812 38 37.88 38 36.7718V4.57181C38 3.46365 37.0987 2.56235 35.9905 2.56235H3.79051ZM0 4.57181C0 2.47999 1.69866 0.78125 3.79051 0.78125H35.9905C38.0824 0.78125 39.7811 2.47997 39.7811 4.57181V36.7718C39.7811 38.8637 38.0823 40.5623 35.9905 40.5623H3.79051C1.69866 40.5623 0 38.8636 0 36.7718V4.57181Z" fill="#545454"/>
|
||||
<path d="M19.3542 30.9082H8.43512C7.41277 30.9082 6.58398 31.737 6.58398 32.7593V32.7593C6.58398 33.7817 7.41277 34.6105 8.43512 34.6105H21.6319" stroke="#545454" stroke-width="1.8" stroke-linecap="round"/>
|
||||
<path d="M11.0792 7.71875L8.18941 10.5289C7.75263 10.9536 7.79395 11.6669 8.27686 12.0384L11.2082 14.2933C11.7285 14.6936 11.7285 15.4782 11.2082 15.8785L8.39172 18.0451C7.87134 18.4454 7.87134 19.23 8.39172 19.6303L11.2711 21.8452C11.7715 22.2301 11.7943 22.9767 11.3185 23.3916L8.32213 26.0039" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M19.6944 7.71875L16.8046 10.5289C16.3679 10.9536 16.4092 11.6669 16.8921 12.0384L19.8234 14.2933C20.3438 14.6936 20.3438 15.4782 19.8234 15.8785L17.007 18.0451C16.4866 18.4454 16.4866 19.23 17.007 19.6303L19.8863 21.8452C20.3867 22.2301 20.4096 22.9767 19.9337 23.3916L16.9374 26.0039" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M28.3077 7.71875L25.4179 10.5289C24.9811 10.9536 25.0225 11.6669 25.5054 12.0384L28.4367 14.2933C28.9571 14.6936 28.9571 15.4782 28.4367 15.8785L24.5898 18.8377" stroke="#545454" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M36.0003 28.176L32.4922 34.2522C32.4743 34.2831 32.4413 34.3022 32.4056 34.3022L25.3894 34.3022C25.3536 34.3022 25.3206 34.2831 25.3028 34.2522L21.7947 28.176C21.7768 28.145 21.7768 28.1069 21.7947 28.076L25.3028 21.9998C25.3206 21.9688 25.3536 21.9498 25.3894 21.9498L32.4056 21.9498C32.4413 21.9498 32.4743 21.9688 32.4922 21.9998L36.0003 28.076C36.0181 28.1069 36.0181 28.145 36.0003 28.176Z" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
<circle cx="28.8972" cy="28.1263" r="2.32605" transform="rotate(90 28.8972 28.1263)" stroke="#545454" stroke-width="1.8" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.7 KiB |
|
@ -149,6 +149,7 @@ BedType PartPlate::get_bed_type() const
|
|||
|
||||
void PartPlate::set_bed_type(BedType bed_type, bool& same_as_global)
|
||||
{
|
||||
is_same_bedtype_with_global = true;
|
||||
// should be called in GUI context
|
||||
assert(m_plater != nullptr);
|
||||
|
||||
|
@ -162,11 +163,13 @@ void PartPlate::set_bed_type(BedType bed_type, bool& same_as_global)
|
|||
std::string bed_type_key = "curr_bed_type";
|
||||
BedType global_bed_type = proj_cfg.opt_enum<BedType>(bed_type_key);
|
||||
same_as_global = bed_type == global_bed_type;
|
||||
is_same_bedtype_with_global = same_as_global;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
same_as_global = false;
|
||||
is_same_bedtype_with_global = same_as_global;
|
||||
}
|
||||
|
||||
void PartPlate::reset_bed_type()
|
||||
|
@ -708,13 +711,17 @@ void PartPlate::render_icons(bool bottom, int hover_id) const
|
|||
}
|
||||
|
||||
if (m_partplate_list->render_bedtype_setting) {
|
||||
if (hover_id == 5)
|
||||
render_icon_texture(position_id, tex_coords_id, m_bedtype_icon, m_partplate_list->m_bedtype_hovered_texture, m_bedtype_vbo_id);
|
||||
else {
|
||||
if (render_bedtype_setting_warned)
|
||||
render_icon_texture(position_id, tex_coords_id, m_bedtype_icon, m_partplate_list->m_bedtype_warned_texture, m_bedtype_vbo_id);
|
||||
if (hover_id == 5) {
|
||||
if (is_same_bedtype_with_global)
|
||||
render_icon_texture(position_id, tex_coords_id, m_bedtype_icon, m_partplate_list->m_bedtype_hovered_texture, m_bedtype_vbo_id);
|
||||
else
|
||||
render_icon_texture(position_id, tex_coords_id, m_bedtype_icon, m_partplate_list->m_bedtype_changed_hovered_texture, m_bedtype_vbo_id);
|
||||
}
|
||||
else {
|
||||
if (is_same_bedtype_with_global)
|
||||
render_icon_texture(position_id, tex_coords_id, m_bedtype_icon, m_partplate_list->m_bedtype_texture, m_bedtype_vbo_id);
|
||||
else
|
||||
render_icon_texture(position_id, tex_coords_id, m_bedtype_icon, m_partplate_list->m_bedtype_changed_texture, m_bedtype_vbo_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2024,11 +2031,6 @@ void PartPlate::render(bool bottom, bool only_body, bool force_background_color,
|
|||
glsafe(::glDisable(GL_DEPTH_TEST));
|
||||
}
|
||||
|
||||
void PartPlate::set_plate_render_option(bool bedtype_setting_warned)
|
||||
{
|
||||
render_bedtype_setting_warned = bedtype_setting_warned;
|
||||
}
|
||||
|
||||
void PartPlate::set_selected() {
|
||||
m_selected = true;
|
||||
}
|
||||
|
@ -2437,10 +2439,10 @@ void PartPlateList::generate_icon_textures()
|
|||
}
|
||||
}
|
||||
|
||||
if (m_bedtype_warned_texture.get_id() == 0)
|
||||
if (m_bedtype_changed_texture.get_id() == 0)
|
||||
{
|
||||
file_name = path + "plate_set_bedtype_warned.svg";
|
||||
if (!m_bedtype_warned_texture.load_from_svg_file(file_name, true, false, false, max_tex_size / 8)) {
|
||||
file_name = path + "plate_set_bedtype_changed.svg";
|
||||
if (!m_bedtype_changed_texture.load_from_svg_file(file_name, true, false, false, max_tex_size / 8)) {
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
|
||||
}
|
||||
}
|
||||
|
@ -2453,6 +2455,14 @@ void PartPlateList::generate_icon_textures()
|
|||
}
|
||||
}
|
||||
|
||||
if (m_bedtype_changed_hovered_texture.get_id() == 0)
|
||||
{
|
||||
file_name = path + "plate_set_bedtype_changed_hover.svg";
|
||||
if (!m_bedtype_changed_hovered_texture.load_from_svg_file(file_name, true, false, false, max_tex_size / 8)) {
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(":load file %1% failed") % file_name;
|
||||
}
|
||||
}
|
||||
|
||||
auto is_font_suitable = [](std::string text_str, wxFont& font, int max_size) {
|
||||
wxMemoryDC memDC;
|
||||
wxCoord w, h;
|
||||
|
@ -2510,8 +2520,9 @@ void PartPlateList::release_icon_textures()
|
|||
m_lockopen_texture.reset();
|
||||
m_lockopen_hovered_texture.reset();
|
||||
m_bedtype_texture.reset();
|
||||
m_bedtype_warned_texture.reset();
|
||||
m_bedtype_changed_texture.reset();
|
||||
m_bedtype_hovered_texture.reset();
|
||||
m_bedtype_changed_hovered_texture.reset();
|
||||
|
||||
for (int i = 0;i < MAX_PLATE_COUNT; i++) {
|
||||
m_idx_textures[i].reset();
|
||||
|
|
|
@ -139,7 +139,7 @@ private:
|
|||
GLTexture m_texture;
|
||||
|
||||
// plate render option
|
||||
bool render_bedtype_setting_warned = false;
|
||||
bool is_same_bedtype_with_global = true;
|
||||
|
||||
mutable float m_grabber_color[4];
|
||||
float m_scale_factor{ 1.0f };
|
||||
|
@ -210,7 +210,6 @@ public:
|
|||
void clear(bool clear_sliced_result = true);
|
||||
|
||||
BedType get_bed_type() const;
|
||||
bool is_bedtype_same_as_global = true;
|
||||
void set_bed_type(BedType, bool& same_as_global);
|
||||
void reset_bed_type();
|
||||
DynamicPrintConfig* config() { return &m_config; }
|
||||
|
@ -304,7 +303,6 @@ public:
|
|||
|
||||
void render(bool bottom, bool only_body = false, bool force_background_color = false, HeightLimitMode mode = HEIGHT_LIMIT_NONE, int hover_id = -1);
|
||||
void render_for_picking() const { on_render_for_picking(); }
|
||||
void set_plate_render_option(bool bedtype_setting_warned);
|
||||
void set_selected();
|
||||
void set_unselected();
|
||||
void set_hover_id(int id) { m_hover_id = id; }
|
||||
|
@ -461,8 +459,9 @@ class PartPlateList : public ObjectBase
|
|||
GLTexture m_lockopen_texture;
|
||||
GLTexture m_lockopen_hovered_texture;
|
||||
GLTexture m_bedtype_texture;
|
||||
GLTexture m_bedtype_warned_texture;
|
||||
GLTexture m_bedtype_changed_texture;
|
||||
GLTexture m_bedtype_hovered_texture;
|
||||
GLTexture m_bedtype_changed_hovered_texture;
|
||||
GLTexture m_idx_textures[MAX_PLATE_COUNT];
|
||||
// set render option
|
||||
bool render_bedtype_logo = true;
|
||||
|
|
|
@ -5222,7 +5222,9 @@ void Plater::priv::on_select_bed_type(wxCommandEvent &evt)
|
|||
// update render
|
||||
auto plate_list = partplate_list.get_plate_list();
|
||||
for (auto plate : plate_list) {
|
||||
plate->set_plate_render_option(false);
|
||||
bool same_as_global = false;
|
||||
auto type = plate->get_bed_type();
|
||||
plate->set_bed_type(type, same_as_global);
|
||||
}
|
||||
view3D->get_canvas3d()->render();
|
||||
preview->msw_rescale();
|
||||
|
@ -10607,13 +10609,12 @@ int Plater::select_plate_by_hover_id(int hover_id, bool right_click)
|
|||
//set the plate type
|
||||
ret = select_plate(plate_index);
|
||||
if (!ret) {
|
||||
SetBedTypeDialog dlg(this, wxID_ANY, _L("Select bed type"));
|
||||
SetBedTypeDialog dlg(this, wxID_ANY, _L("Select Bed Type"));
|
||||
dlg.sync_bed_type(p->partplate_list.get_curr_plate()->get_bed_type());
|
||||
dlg.Bind(EVT_SET_BED_TYPE_CONFIRM, [this, plate_index](wxCommandEvent& e) {
|
||||
bool same_as_global = false;
|
||||
auto type = (BedType)(e.GetInt());
|
||||
p->partplate_list.get_curr_plate()->set_bed_type(type, same_as_global);
|
||||
p->partplate_list.get_curr_plate()->set_plate_render_option(same_as_global?false:true);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format("select bed type %1% for plate %2% at plate side")%type %plate_index;
|
||||
});
|
||||
dlg.ShowModal();
|
||||
|
|
|
@ -101,40 +101,40 @@ wxWindow* SetBedTypeDialog::create_item_radiobox(wxString title, wxWindow* paren
|
|||
|
||||
RadioBox *radiobox = new RadioBox(item);
|
||||
radiobox->SetPosition(wxPoint(padding_left, (item->GetSize().GetHeight() - radiobox->GetSize().GetHeight()) / 2));
|
||||
radiobox->Bind(wxEVT_LEFT_DOWN, &SetBedTypeDialog::select_curr_radiobox, this);
|
||||
radio_buttons.push_back(radiobox);
|
||||
int btn_idx = radio_buttons.size() - 1;
|
||||
radiobox->Bind(wxEVT_LEFT_DOWN, [this, btn_idx](wxMouseEvent &e) {
|
||||
SetBedTypeDialog::select_curr_radiobox(btn_idx);
|
||||
});
|
||||
|
||||
wxStaticText *text = new wxStaticText(item, wxID_ANY, title, wxDefaultPosition, wxDefaultSize);
|
||||
text->SetPosition(wxPoint(padding_left + radiobox->GetSize().GetWidth() + 10, (item->GetSize().GetHeight() - text->GetSize().GetHeight()) / 2));
|
||||
text->SetFont(Label::Body_14);
|
||||
text->SetForegroundColour(0x686868);
|
||||
text->Bind(wxEVT_LEFT_DOWN, [this, btn_idx](wxMouseEvent &e) {
|
||||
SetBedTypeDialog::select_curr_radiobox(btn_idx);
|
||||
});
|
||||
|
||||
radiobox->SetToolTip(tooltip);
|
||||
text->SetToolTip(tooltip);
|
||||
return item;
|
||||
}
|
||||
|
||||
void SetBedTypeDialog::select_curr_radiobox(wxMouseEvent &e)
|
||||
void SetBedTypeDialog::select_curr_radiobox(int btn_idx)
|
||||
{
|
||||
int len = radio_buttons.size();
|
||||
for (auto rbtn:radio_buttons) {
|
||||
if (rbtn->GetId() == e.GetId())
|
||||
rbtn->SetValue(true);
|
||||
for (int i = 0; i < len; ++i) {
|
||||
if (i == btn_idx)
|
||||
radio_buttons[i]->SetValue(true);
|
||||
else
|
||||
rbtn->SetValue(false);
|
||||
radio_buttons[i]->SetValue(false);
|
||||
}
|
||||
}
|
||||
|
||||
void SetBedTypeDialog::sync_bed_type(BedType type)
|
||||
{
|
||||
int select_type = (int)(type);
|
||||
int len = radio_buttons.size();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
if (i == select_type)
|
||||
radio_buttons[i]->SetValue(true);
|
||||
else
|
||||
radio_buttons[i]->SetValue(false);
|
||||
}
|
||||
select_curr_radiobox(select_type);
|
||||
}
|
||||
|
||||
void SetBedTypeDialog::on_dpi_changed(const wxRect& suggested_rect)
|
||||
|
|
|
@ -41,7 +41,7 @@ protected:
|
|||
std::vector<RadioBox*> radio_buttons;
|
||||
|
||||
wxWindow * create_item_radiobox(wxString title, wxWindow *parent, wxString tooltip, int padding_left, int groupid, std::string param);
|
||||
void select_curr_radiobox(wxMouseEvent &e);
|
||||
void select_curr_radiobox(int btn_idx);
|
||||
};
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
|