FIX:fix bug of SyncAmsInfoDialog

jira: STUDIO-9948 STUDIO-9950
Change-Id: Ic97dfb7787c9e27386003b2dc3f88f1003456245
This commit is contained in:
zhou.xu 2025-01-17 19:41:59 +08:00 committed by lane.wei
parent 9514b6225f
commit 081df8f580
10 changed files with 101 additions and 70 deletions

View File

@ -1,3 +1,3 @@
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M27.1947 16.4647C27.1947 19.3379 26.0534 22.0934 24.0217 24.125C21.9901 26.1566 19.2346 27.298 16.3614 27.298C13.4882 27.298 10.7327 26.1566 8.70109 24.125C6.66944 22.0934 5.52808 19.3379 5.52808 16.4647C5.52808 13.5915 6.66944 10.836 8.70109 8.80436C10.7327 6.77271 13.4882 5.63135 16.3614 5.63135C19.2346 5.63135 21.9901 6.77271 24.0217 8.80436C26.0534 10.836 27.1947 13.5915 27.1947 16.4647ZM3.02808 16.4647C3.02808 20.0009 4.43283 23.3923 6.93332 25.8928C9.4338 28.3933 12.8252 29.798 16.3614 29.798C19.8976 29.798 23.289 28.3933 25.7895 25.8928C28.29 23.3923 29.6947 20.0009 29.6947 16.4647C29.6947 12.9285 28.29 9.53708 25.7895 7.03659C23.289 4.53611 19.8976 3.13135 16.3614 3.13135C12.8252 3.13135 9.4338 4.53611 6.93332 7.03659C4.43283 9.53708 3.02808 12.9285 3.02808 16.4647ZM15.5802 22.7668L20.9968 17.3501C21.4864 16.8605 21.4864 16.0688 20.9968 15.5845L15.5802 10.1626C15.0906 9.67301 14.2989 9.67301 13.8145 10.1626C13.3302 10.6522 13.325 11.4438 13.8145 11.9282L18.3458 16.4595L13.8145 20.9907C13.325 21.4803 13.325 22.272 13.8145 22.7563C14.3041 23.2407 15.0958 23.2459 15.5802 22.7563V22.7668Z" fill="#ACACAC"/>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26.8334 15.9998C26.8334 18.873 25.6921 21.6285 23.6604 23.6602C21.6288 25.6918 18.8733 26.8332 16.0001 26.8332C13.1269 26.8332 10.3714 25.6918 8.33976 23.6602C6.30811 21.6285 5.16675 18.873 5.16675 15.9998C5.16675 13.1267 6.30811 10.3712 8.33976 8.33951C10.3714 6.30787 13.1269 5.1665 16.0001 5.1665C18.8733 5.1665 21.6288 6.30787 23.6604 8.33951C25.6921 10.3712 26.8334 13.1267 26.8334 15.9998ZM2.66675 15.9998C2.66675 19.5361 4.07151 22.9274 6.57199 25.4279C9.07248 27.9284 12.4639 29.3332 16.0001 29.3332C19.5363 29.3332 22.9277 27.9284 25.4282 25.4279C27.9287 22.9274 29.3334 19.5361 29.3334 15.9998C29.3334 12.4636 27.9287 9.07223 25.4282 6.57175C22.9277 4.07126 19.5363 2.6665 16.0001 2.6665C12.4639 2.6665 9.07248 4.07126 6.57199 6.57175C4.07151 9.07223 2.66675 12.4636 2.66675 15.9998ZM15.2188 22.3019L20.6355 16.8853C21.1251 16.3957 21.1251 15.604 20.6355 15.1196L15.2188 9.69775C14.7292 9.20817 13.9376 9.20817 13.4532 9.69775C12.9688 10.1873 12.9636 10.979 13.4532 11.4634L17.9845 15.9946L13.4532 20.5259C12.9636 21.0155 12.9636 21.8071 13.4532 22.2915C13.9428 22.7759 14.7345 22.7811 15.2188 22.2915V22.3019Z" fill="#ACACAC"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26.8334 15.9998C26.8334 18.873 25.6921 21.6285 23.6604 23.6602C21.6288 25.6918 18.8733 26.8332 16.0001 26.8332C13.1269 26.8332 10.3714 25.6918 8.33976 23.6602C6.30811 21.6285 5.16675 18.873 5.16675 15.9998C5.16675 13.1267 6.30811 10.3712 8.33976 8.33951C10.3714 6.30787 13.1269 5.1665 16.0001 5.1665C18.8733 5.1665 21.6288 6.30787 23.6604 8.33951C25.6921 10.3712 26.8334 13.1267 26.8334 15.9998ZM2.66675 15.9998C2.66675 19.5361 4.07151 22.9274 6.57199 25.4279C9.07248 27.9284 12.4639 29.3332 16.0001 29.3332C19.5363 29.3332 22.9277 27.9284 25.4282 25.4279C27.9287 22.9274 29.3334 19.5361 29.3334 15.9998C29.3334 12.4636 27.9287 9.07223 25.4282 6.57175C22.9277 4.07126 19.5363 2.6665 16.0001 2.6665C12.4639 2.6665 9.07248 4.07126 6.57199 6.57175C4.07151 9.07223 2.66675 12.4636 2.66675 15.9998ZM15.2188 22.3019L20.6355 16.8853C21.1251 16.3957 21.1251 15.604 20.6355 15.1196L15.2188 9.69775C14.7292 9.20817 13.9376 9.20817 13.4532 9.69775C12.9688 10.1873 12.9636 10.979 13.4532 11.4634L17.9845 15.9946L13.4532 20.5259C12.9636 21.0155 12.9636 21.8071 13.4532 22.2915C13.9428 22.7759 14.7345 22.7811 15.2188 22.2915V22.3019Z" fill="#EEEEEE"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,3 +1,3 @@
<svg width="33" height="32" viewBox="0 0 33 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M27.703 15.9998C27.703 18.873 26.5617 21.6285 24.53 23.6602C22.4984 25.6918 19.7429 26.8332 16.8697 26.8332C13.9965 26.8332 11.241 25.6918 9.20939 23.6602C7.17774 21.6285 6.03638 18.873 6.03638 15.9998C6.03638 13.1267 7.17774 10.3712 9.20939 8.33951C11.241 6.30787 13.9965 5.1665 16.8697 5.1665C19.7429 5.1665 22.4984 6.30787 24.53 8.33951C26.5617 10.3712 27.703 13.1267 27.703 15.9998ZM3.53638 15.9998C3.53638 19.5361 4.94113 22.9274 7.44162 25.4279C9.94211 27.9284 13.3335 29.3332 16.8697 29.3332C20.4059 29.3332 23.7973 27.9284 26.2978 25.4279C28.7983 22.9274 30.203 19.5361 30.203 15.9998C30.203 12.4636 28.7983 9.07223 26.2978 6.57175C23.7973 4.07126 20.4059 2.6665 16.8697 2.6665C13.3335 2.6665 9.94211 4.07126 7.44162 6.57175C4.94113 9.07223 3.53638 12.4636 3.53638 15.9998ZM16.0885 22.3019L21.5051 16.8853C21.9947 16.3957 21.9947 15.604 21.5051 15.1196L16.0885 9.69775C15.5989 9.20817 14.8072 9.20817 14.3228 9.69775C13.8385 10.1873 13.8333 10.979 14.3228 11.4634L18.8541 15.9946L14.3228 20.5259C13.8333 21.0155 13.8333 21.8071 14.3228 22.2915C14.8124 22.7759 15.6041 22.7811 16.0885 22.2915V22.3019Z" fill="#262E30"/>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26.8334 15.9998C26.8334 18.873 25.6921 21.6285 23.6604 23.6602C21.6288 25.6918 18.8733 26.8332 16.0001 26.8332C13.1269 26.8332 10.3714 25.6918 8.33976 23.6602C6.30811 21.6285 5.16675 18.873 5.16675 15.9998C5.16675 13.1267 6.30811 10.3712 8.33976 8.33951C10.3714 6.30787 13.1269 5.1665 16.0001 5.1665C18.8733 5.1665 21.6288 6.30787 23.6604 8.33951C25.6921 10.3712 26.8334 13.1267 26.8334 15.9998ZM2.66675 15.9998C2.66675 19.5361 4.07151 22.9274 6.57199 25.4279C9.07248 27.9284 12.4639 29.3332 16.0001 29.3332C19.5363 29.3332 22.9277 27.9284 25.4282 25.4279C27.9287 22.9274 29.3334 19.5361 29.3334 15.9998C29.3334 12.4636 27.9287 9.07223 25.4282 6.57175C22.9277 4.07126 19.5363 2.6665 16.0001 2.6665C12.4639 2.6665 9.07248 4.07126 6.57199 6.57175C4.07151 9.07223 2.66675 12.4636 2.66675 15.9998ZM15.2188 22.3019L20.6355 16.8853C21.1251 16.3957 21.1251 15.604 20.6355 15.1196L15.2188 9.69775C14.7292 9.20817 13.9376 9.20817 13.4532 9.69775C12.9688 10.1873 12.9636 10.979 13.4532 11.4634L17.9845 15.9946L13.4532 20.5259C12.9636 21.0155 12.9636 21.8071 13.4532 22.2915C13.9428 22.7759 14.7345 22.7811 15.2188 22.2915V22.3019Z" fill="#262E30"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,3 +1,3 @@
<svg width="33" height="33" viewBox="0 0 33 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.65845 16.5272C5.65845 13.654 6.79981 10.8985 8.83146 8.86686C10.8631 6.83521 13.6186 5.69385 16.4918 5.69385C19.365 5.69385 22.1205 6.83521 24.1521 8.86686C26.1838 10.8985 27.3251 13.654 27.3251 16.5272C27.3251 19.4004 26.1838 22.1559 24.1521 24.1875C22.1205 26.2192 19.365 27.3605 16.4918 27.3605C13.6186 27.3605 10.8631 26.2192 8.83146 24.1875C6.79981 22.1559 5.65845 19.4004 5.65845 16.5272ZM29.8251 16.5272C29.8251 12.991 28.4204 9.59958 25.9199 7.09909C23.4194 4.59861 20.028 3.19385 16.4918 3.19385C12.9556 3.19385 9.56418 4.59861 7.06369 7.09909C4.56321 9.59958 3.15845 12.991 3.15845 16.5272C3.15845 20.0634 4.56321 23.4548 7.06369 25.9553C9.56418 28.4558 12.9556 29.8605 16.4918 29.8605C20.028 29.8605 23.4194 28.4558 25.9199 25.9553C28.4204 23.4548 29.8251 20.0634 29.8251 16.5272ZM17.273 10.2251L11.8564 15.6418C11.3668 16.1313 11.3668 16.923 11.8564 17.4074L17.273 22.8293C17.7626 23.3188 18.5543 23.3188 19.0387 22.8293C19.523 22.3397 19.5282 21.548 19.0387 21.0636L14.5074 16.5324L19.0387 12.0011C19.5282 11.5116 19.5282 10.7199 19.0387 10.2355C18.5491 9.75114 17.7574 9.74593 17.273 10.2355V10.2251Z" fill="#ACACAC"/>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.16675 15.9998C5.16675 13.1267 6.30811 10.3712 8.33976 8.33951C10.3714 6.30787 13.1269 5.1665 16.0001 5.1665C18.8733 5.1665 21.6288 6.30787 23.6604 8.33951C25.6921 10.3712 26.8334 13.1267 26.8334 15.9998C26.8334 18.873 25.6921 21.6285 23.6604 23.6602C21.6288 25.6918 18.8733 26.8332 16.0001 26.8332C13.1269 26.8332 10.3714 25.6918 8.33976 23.6602C6.30811 21.6285 5.16675 18.873 5.16675 15.9998ZM29.3334 15.9998C29.3334 12.4636 27.9287 9.07223 25.4282 6.57175C22.9277 4.07126 19.5363 2.6665 16.0001 2.6665C12.4639 2.6665 9.07248 4.07126 6.57199 6.57175C4.07151 9.07223 2.66675 12.4636 2.66675 15.9998C2.66675 19.5361 4.07151 22.9274 6.57199 25.4279C9.07248 27.9284 12.4639 29.3332 16.0001 29.3332C19.5363 29.3332 22.9277 27.9284 25.4282 25.4279C27.9287 22.9274 29.3334 19.5361 29.3334 15.9998ZM16.7813 9.69775L11.3647 15.1144C10.8751 15.604 10.8751 16.3957 11.3647 16.88L16.7813 22.3019C17.2709 22.7915 18.0626 22.7915 18.547 22.3019C19.0313 21.8123 19.0365 21.0207 18.547 20.5363L14.0157 16.005L18.547 11.4738C19.0365 10.9842 19.0365 10.1925 18.547 9.70817C18.0574 9.2238 17.2657 9.21859 16.7813 9.70817V9.69775Z" fill="#ACACAC"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.16675 15.9998C5.16675 13.1267 6.30811 10.3712 8.33976 8.33951C10.3714 6.30787 13.1269 5.1665 16.0001 5.1665C18.8733 5.1665 21.6288 6.30787 23.6604 8.33951C25.6921 10.3712 26.8334 13.1267 26.8334 15.9998C26.8334 18.873 25.6921 21.6285 23.6604 23.6602C21.6288 25.6918 18.8733 26.8332 16.0001 26.8332C13.1269 26.8332 10.3714 25.6918 8.33976 23.6602C6.30811 21.6285 5.16675 18.873 5.16675 15.9998ZM29.3334 15.9998C29.3334 12.4636 27.9287 9.07223 25.4282 6.57175C22.9277 4.07126 19.5363 2.6665 16.0001 2.6665C12.4639 2.6665 9.07248 4.07126 6.57199 6.57175C4.07151 9.07223 2.66675 12.4636 2.66675 15.9998C2.66675 19.5361 4.07151 22.9274 6.57199 25.4279C9.07248 27.9284 12.4639 29.3332 16.0001 29.3332C19.5363 29.3332 22.9277 27.9284 25.4282 25.4279C27.9287 22.9274 29.3334 19.5361 29.3334 15.9998ZM16.7813 9.69775L11.3647 15.1144C10.8751 15.604 10.8751 16.3957 11.3647 16.88L16.7813 22.3019C17.2709 22.7915 18.0626 22.7915 18.547 22.3019C19.0313 21.8123 19.0365 21.0207 18.547 20.5363L14.0157 16.005L18.547 11.4738C19.0365 10.9842 19.0365 10.1925 18.547 9.70817C18.0574 9.2238 17.2657 9.21859 16.7813 9.70817V9.69775Z" fill="#EEEEEE"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,3 +1,3 @@
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.16675 16.0623C5.16675 13.1892 6.30811 10.4337 8.33976 8.40201C10.3714 6.37037 13.1269 5.229 16.0001 5.229C18.8733 5.229 21.6288 6.37037 23.6604 8.40201C25.6921 10.4337 26.8334 13.1892 26.8334 16.0623C26.8334 18.9355 25.6921 21.691 23.6604 23.7227C21.6288 25.7543 18.8733 26.8957 16.0001 26.8957C13.1269 26.8957 10.3714 25.7543 8.33976 23.7227C6.30811 21.691 5.16675 18.9355 5.16675 16.0623ZM29.3334 16.0623C29.3334 12.5261 27.9287 9.13473 25.4282 6.63425C22.9277 4.13376 19.5363 2.729 16.0001 2.729C12.4639 2.729 9.07248 4.13376 6.57199 6.63425C4.07151 9.13473 2.66675 12.5261 2.66675 16.0623C2.66675 19.5986 4.07151 22.9899 6.57199 25.4904C9.07248 27.9909 12.4639 29.3957 16.0001 29.3957C19.5363 29.3957 22.9277 27.9909 25.4282 25.4904C27.9287 22.9899 29.3334 19.5986 29.3334 16.0623ZM16.7813 9.76025L11.3647 15.1769C10.8751 15.6665 10.8751 16.4582 11.3647 16.9425L16.7813 22.3644C17.2709 22.854 18.0626 22.854 18.547 22.3644C19.0313 21.8748 19.0365 21.0832 18.547 20.5988L14.0157 16.0675L18.547 11.5363C19.0365 11.0467 19.0365 10.255 18.547 9.77067C18.0574 9.2863 17.2657 9.28109 16.7813 9.77067V9.76025Z" fill="#262E30"/>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5.16675 15.9998C5.16675 13.1267 6.30811 10.3712 8.33976 8.33951C10.3714 6.30787 13.1269 5.1665 16.0001 5.1665C18.8733 5.1665 21.6288 6.30787 23.6604 8.33951C25.6921 10.3712 26.8334 13.1267 26.8334 15.9998C26.8334 18.873 25.6921 21.6285 23.6604 23.6602C21.6288 25.6918 18.8733 26.8332 16.0001 26.8332C13.1269 26.8332 10.3714 25.6918 8.33976 23.6602C6.30811 21.6285 5.16675 18.873 5.16675 15.9998ZM29.3334 15.9998C29.3334 12.4636 27.9287 9.07223 25.4282 6.57175C22.9277 4.07126 19.5363 2.6665 16.0001 2.6665C12.4639 2.6665 9.07248 4.07126 6.57199 6.57175C4.07151 9.07223 2.66675 12.4636 2.66675 15.9998C2.66675 19.5361 4.07151 22.9274 6.57199 25.4279C9.07248 27.9284 12.4639 29.3332 16.0001 29.3332C19.5363 29.3332 22.9277 27.9284 25.4282 25.4279C27.9287 22.9274 29.3334 19.5361 29.3334 15.9998ZM16.7813 9.69775L11.3647 15.1144C10.8751 15.604 10.8751 16.3957 11.3647 16.88L16.7813 22.3019C17.2709 22.7915 18.0626 22.7915 18.547 22.3019C19.0313 21.8123 19.0365 21.0207 18.547 20.5363L14.0157 16.005L18.547 11.4738C19.0365 10.9842 19.0365 10.1925 18.547 9.70817C18.0574 9.2238 17.2657 9.21859 16.7813 9.70817V9.69775Z" fill="#262E30"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -3002,8 +3002,12 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn)
FinishSyncAmsDialog::InputInfo temp_fsa_info;
temp_fsa_info.dialog_pos = cur_dialog_pos;
FinishSyncAmsDialog fsa_dialog(this, temp_fsa_info);
fsa_dialog.ShowModal();
if (m_fna_dialog) {
m_fna_dialog.reset();
}
m_fna_dialog = std::make_shared<FinishSyncAmsDialog>(this, temp_fsa_info);
m_fna_dialog->Show();
m_fna_dialog->Raise();
}
PlaterPresetComboBox* Sidebar::printer_combox()
@ -3098,8 +3102,13 @@ void Sidebar::deal_btn_sync() {
auto cur_dialog_pos = small_btn_pt + wxPoint(small_btn_size.x * 3.6 + 5, 0);
temp_na_info.dialog_pos.x = cur_dialog_pos.x;
temp_na_info.dialog_pos.y += FromDIP(2);
SyncNozzleAndAmsDialog na_dialog(nullptr, temp_na_info);
na_dialog.ShowModal();
if (m_sna_dialog) {
m_sna_dialog.reset();
}
m_sna_dialog = std::make_shared<SyncNozzleAndAmsDialog>(this, temp_na_info);
m_sna_dialog->Show();
m_sna_dialog->Raise();
}
}

View File

@ -79,7 +79,8 @@ struct Camera;
class GLToolbar;
class PlaterPresetComboBox;
class PartPlateList;
class SyncNozzleAndAmsDialog;
class FinishSyncAmsDialog;
using t_optgroups = std::vector <std::shared_ptr<ConfigOptionsGroup>>;
class Plater;
@ -118,7 +119,8 @@ class Sidebar : public wxPanel
ConfigOptionMode m_mode;
Button * btn_sync{nullptr};
ScalableButton * ams_btn{nullptr};
std::shared_ptr<SyncNozzleAndAmsDialog> m_sna_dialog{nullptr};
std::shared_ptr<FinishSyncAmsDialog> m_fna_dialog{nullptr};
public:
Sidebar(Plater *parent);
Sidebar(Sidebar &&) = delete;

View File

@ -354,6 +354,9 @@ wxBoxSizer *SyncAmsInfoDialog::create_sizer_thumbnail(wxButton *image_button, bo
}
void SyncAmsInfoDialog::update_when_change_plate(int idx) {
if (idx < 0) {
return;
}
m_specify_plate_idx = idx;
reset_and_sync_ams_list();
@ -455,8 +458,10 @@ void SyncAmsInfoDialog::init_bitmaps()
{
m_swipe_left_bmp_normal = ScalableBitmap(this, "previous_item", m_bmp_pix_cont);
m_swipe_left_bmp_hover = ScalableBitmap(this, "previous_item_hover", m_bmp_pix_cont);
m_swipe_left_bmp_disable = ScalableBitmap(this, "previous_item_disable", m_bmp_pix_cont);
m_swipe_right_bmp_normal = ScalableBitmap(this, "next_item", m_bmp_pix_cont);
m_swipe_right_bmp_hover = ScalableBitmap(this, "next_item_hover", m_bmp_pix_cont);
m_swipe_right_bmp_disable = ScalableBitmap(this, "next_item_disable", m_bmp_pix_cont);
}
@ -477,9 +482,11 @@ void SyncAmsInfoDialog::add_two_image_control()
m_swipe_left_button = new ScalableButton(m_two_thumbnail_panel, wxID_ANY, "previous_item", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true,
m_bmp_pix_cont);
m_swipe_left_button->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
if (!m_swipe_left_button_enable) { return; }
m_swipe_left_button->SetBitmap(m_swipe_left_bmp_hover.bmp());
});
m_swipe_left_button->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
if (!m_swipe_left_button_enable) { return; }
m_swipe_left_button->SetBitmap(m_swipe_left_bmp_normal.bmp());
});
m_swipe_left_button->Bind(wxEVT_BUTTON, &SyncAmsInfoDialog::to_previous_plate, this);
@ -516,8 +523,14 @@ void SyncAmsInfoDialog::add_two_image_control()
swipe_right__sizer->AddStretchSpacer();
m_swipe_right_button = new ScalableButton(m_two_thumbnail_panel, wxID_ANY, "next_item", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true,
m_bmp_pix_cont);
m_swipe_right_button->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { m_swipe_right_button->SetBitmap(m_swipe_right_bmp_hover.bmp()); });
m_swipe_right_button->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { m_swipe_right_button->SetBitmap(m_swipe_right_bmp_normal.bmp()); });
m_swipe_right_button->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
if (!m_swipe_right_button_enable) { return; }
m_swipe_right_button->SetBitmap(m_swipe_right_bmp_hover.bmp());
});
m_swipe_right_button->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
if (!m_swipe_right_button_enable) { return; }
m_swipe_right_button->SetBitmap(m_swipe_right_bmp_normal.bmp());
});
m_swipe_right_button->Bind(wxEVT_BUTTON, &SyncAmsInfoDialog::to_next_plate, this);
swipe_right__sizer->Add(m_swipe_right_button, 0, wxALIGN_CENTER | wxEXPAND | wxALIGN_CENTER_VERTICAL);
@ -562,6 +575,9 @@ void SyncAmsInfoDialog::add_two_image_control()
void SyncAmsInfoDialog::to_next_plate(wxCommandEvent &event) {
auto cobox_idx = m_combobox_plate->GetSelection();
cobox_idx++;
if (cobox_idx >= m_combobox_plate->GetCount()) {
return;
}
m_combobox_plate->SetSelection(cobox_idx);
update_when_change_plate(m_plate_choices[cobox_idx]);
}
@ -569,22 +585,28 @@ void SyncAmsInfoDialog::to_next_plate(wxCommandEvent &event) {
void SyncAmsInfoDialog::to_previous_plate(wxCommandEvent &event) {
auto cobox_idx = m_combobox_plate->GetSelection();
cobox_idx--;
if (cobox_idx < 0) {
return;
}
m_combobox_plate->SetSelection(cobox_idx);
update_when_change_plate(m_plate_choices[cobox_idx]);
}
void SyncAmsInfoDialog::update_swipe_button_state()
{
m_swipe_left_button_enable = true;
m_swipe_left_button->Enable();
m_swipe_left_button->SetToolTip("");
m_swipe_left_button->SetBitmap(m_swipe_left_bmp_normal.bmp());
m_swipe_right_button_enable = true;
m_swipe_right_button->Enable();
m_swipe_right_button->SetToolTip("");
m_swipe_right_button->SetBitmap(m_swipe_right_bmp_normal.bmp());
if (m_combobox_plate->GetSelection() == 0) { // auto plate_index = m_plate_choices[m_combobox_plate->GetSelection()];
m_swipe_left_button->Disable();
m_swipe_left_button->SetBitmap(m_swipe_left_bmp_disable.bmp());
m_swipe_left_button_enable = false;
}
if (m_combobox_plate->GetSelection() == m_combobox_plate->GetCount() - 1) {
m_swipe_right_button->Disable();
m_swipe_right_button->SetBitmap(m_swipe_right_bmp_disable.bmp());
m_swipe_right_button_enable = false;
}
}
@ -682,43 +704,12 @@ SyncAmsInfoDialog::SyncAmsInfoDialog(wxWindow *parent, SyncInfo &info) :
bSizer->Add(m_mode_combox_sizer, FromDIP(0), wxEXPAND | wxALIGN_LEFT | wxTOP, FromDIP(10));
m_specify_plate_idx = GUI::wxGetApp().plater()->get_partplate_list().get_curr_plate_index();
//{
// m_plate_combox_sizer = new wxBoxSizer(wxHORIZONTAL);
// m_plate_combox_sizer->AddSpacer(FromDIP(25));
// m_plate_combox_sizer->AddStretchSpacer(1); // m_plate_combox_sizer->AddSpacer(FromDIP(230));
// m_printer_title = new wxStaticText(this, wxID_ANY, _L("Printer") + ": ");
// m_printer_title->SetForegroundColour(wxColour(107, 107, 107, 100));
// m_plate_combox_sizer->Add(m_printer_title, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxEXPAND | wxTOP , FromDIP(6));
// m_printer_device_name = new wxStaticText(this, wxID_ANY, "");
// m_plate_combox_sizer->Add(m_printer_device_name, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxEXPAND | wxTOP, FromDIP(6));
// m_printer_is_map_title = new wxStaticText(this, wxID_ANY, " " + _L("(Inconsistent)"));
// // m_printer_is_map_title->SetBackgroundColour(wxColour(38, 46, 48, 255));
// m_printer_is_map_title->SetForegroundColour(wxColour(255, 111, 0, 255));
// m_printer_is_map_title->SetToolTip(_L("The device printer and the currently selected printer are not consistent. It is recommended to be consistent."));
// m_plate_combox_sizer->Add(m_printer_is_map_title, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxEXPAND | wxTOP, FromDIP(6));
// m_plate_combox_sizer->AddSpacer(FromDIP(25));
// bSizer->Add(m_plate_combox_sizer, FromDIP(0), wxEXPAND |wxALIGN_LEFT | wxBOTTOM, FromDIP(8));
// m_sizer_line = new wxBoxSizer(wxVERTICAL);
// auto staticline1 = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
// staticline1->SetBackgroundColour(wxColour(224, 224, 224, 100));
// m_sizer_line->Add(staticline1, 0, wxEXPAND | wxBOTTOM, FromDIP(8));
// bSizer->Add(m_sizer_line, FromDIP(0), wxEXPAND | wxLEFT | wxRIGHT, FromDIP(25));
//}
//add_two_image_control();
bool not_exist = std::find(m_plate_choices.begin(), m_plate_choices.end(), m_specify_plate_idx) == m_plate_choices.end();
if (not_exist) {
m_specify_plate_idx = m_plate_choices[0];
}
}
// wxBoxSizer * snyc_ship_boxsizer = new wxBoxSizer(wxHORIZONTAL);
// m_specify_color_cluster_title = new wxStaticText(this, wxID_ANY, _L("The synchronization correspondence is as follows:"));
// //m_specify_color_cluster_title->SetFont(Label::Head_14);
// snyc_ship_boxsizer->Add(m_specify_color_cluster_title, 0, wxALIGN_LEFT | wxTOP | wxBOTTOM, FromDIP(5));
///* m_used_colors_tip_text = new wxStaticText(this, wxID_ANY, _L("colors used."));
// m_used_colors_tip_text->SetForegroundColour(wxColour(107, 107, 107, 100));*/
// m_used_colors_tip_text->Hide();
// snyc_ship_boxsizer->Add(m_used_colors_tip_text, 0, wxALIGN_LEFT | wxTOP| wxBOTTOM, FromDIP(5));
// bSizer->Add(snyc_ship_boxsizer, FromDIP(0), wxALIGN_LEFT | wxLEFT, FromDIP(25));
}
m_basic_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
@ -4354,7 +4345,7 @@ std::string SyncAmsInfoDialog::get_print_status_info(PrintDialogStatus status)
}
SyncNozzleAndAmsDialog::SyncNozzleAndAmsDialog(wxWindow *parent, InputInfo &input_info)
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, "", wxDefaultPosition, wxDefaultSize, !wxCAPTION | !wxCLOSE_BOX | wxBORDER_NONE)
: DPIFrame(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, "", wxDefaultPosition, wxDefaultSize, !wxCAPTION | !wxCLOSE_BOX | wxBORDER_NONE)
, m_input_info(input_info)
{
//SetBackgroundStyle(wxBackgroundStyle::wxBG_STYLE_TRANSPARENT);
@ -4416,14 +4407,16 @@ SyncNozzleAndAmsDialog::SyncNozzleAndAmsDialog(wxWindow *parent, InputInfo &inpu
m_button_cancel->SetCornerRadius(FromDIP(6));
bSizer_button->Add(m_button_cancel, 0, wxALIGN_RIGHT | wxLEFT | wxTOP, FromDIP(10));
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) { EndModal(wxID_CANCEL); });
m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
deal_cancel();
});
m_sizer_main->Add(bSizer_button, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, FromDIP(20));
SetSizer(m_sizer_main);
Layout();
Fit();
wxGetApp().UpdateDlgDarkUI(this);
wxGetApp().UpdateFrameDarkUI(this);
}
SyncNozzleAndAmsDialog::~SyncNozzleAndAmsDialog() {}
@ -4434,16 +4427,25 @@ void SyncNozzleAndAmsDialog::deal_ok() {
//temp_info.connected_printer = true;
//SyncAmsInfoDialog sync_dlg(this, temp_info);
//auto dlg_res = wxGetApp().plater()->sidebar().pop_sync_ams_info_dialog(sync_dlg);
Close();
on_hide();
wxGetApp().plater()->sidebar().sync_ams_list(true);
}
void SyncNozzleAndAmsDialog::deal_cancel() {
//no deal
on_hide();
}
void SyncNozzleAndAmsDialog::on_hide()
{
this->Hide();
if (wxGetApp().mainframe != nullptr) {
wxGetApp().mainframe->Show();
wxGetApp().mainframe->Raise();
}
}
FinishSyncAmsDialog::FinishSyncAmsDialog(wxWindow *parent, InputInfo &input_info)
: DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, "", wxDefaultPosition, wxDefaultSize, !wxCAPTION | !wxCLOSE_BOX | wxBORDER_NONE)
: DPIFrame(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, "", wxDefaultPosition, wxDefaultSize, !wxCAPTION | !wxCLOSE_BOX | wxBORDER_NONE)
, m_input_info(input_info)
{
// SetBackgroundStyle(wxBackgroundStyle::wxBG_STYLE_TRANSPARENT);
@ -4492,8 +4494,6 @@ FinishSyncAmsDialog::FinishSyncAmsDialog(wxWindow *parent, InputInfo &input_info
m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
deal_ok();
EndModal(wxID_YES);
SetFocusIgnoringChildren();
});
//m_button_cancel = new Button(this, _CTX(L_CONTEXT("Cancel", "Sync_Nozzle_AMS"), "Sync_Nozzle_AMS"));
@ -4511,10 +4511,18 @@ FinishSyncAmsDialog::FinishSyncAmsDialog(wxWindow *parent, InputInfo &input_info
SetSizer(m_sizer_main);
Layout();
Fit();
wxGetApp().UpdateDlgDarkUI(this);
wxGetApp().UpdateFrameDarkUI(this);
}
FinishSyncAmsDialog::~FinishSyncAmsDialog() {}
void FinishSyncAmsDialog::on_dpi_changed(const wxRect &suggested_rect) {}
void FinishSyncAmsDialog::deal_ok() {}
void FinishSyncAmsDialog::deal_ok() { on_hide(); }
void FinishSyncAmsDialog::deal_cancel() {}
void FinishSyncAmsDialog::on_hide()
{
this->Hide();
if (wxGetApp().mainframe != nullptr) {
wxGetApp().mainframe->Show();
wxGetApp().mainframe->Raise();
}
}
}} // namespace Slic3r

View File

@ -136,9 +136,13 @@ protected:
std::vector<int> m_plate_choices;
ScalableButton * m_swipe_left_button{nullptr};
ScalableButton * m_swipe_right_button{nullptr};
bool m_swipe_left_button_enable;
bool m_swipe_right_button_enable;
int m_bmp_pix_cont = 32;
ScalableBitmap m_swipe_left_bmp_disable;
ScalableBitmap m_swipe_left_bmp_normal;
ScalableBitmap m_swipe_left_bmp_hover;
ScalableBitmap m_swipe_right_bmp_disable;
ScalableBitmap m_swipe_right_bmp_normal;
ScalableBitmap m_swipe_right_bmp_hover;
@ -345,7 +349,7 @@ private:
MapModeEnum m_map_mode{MapModeEnum::ColorMap};
};
class SyncNozzleAndAmsDialog : public Slic3r::GUI::DPIDialog
class SyncNozzleAndAmsDialog : public Slic3r::GUI::DPIFrame
{
public:
struct InputInfo
@ -359,9 +363,10 @@ public:
void on_dpi_changed(const wxRect &suggested_rect) override;
void deal_ok();
void deal_cancel();
void on_hide();
//bool Show(bool show) override;
private:
InputInfo &m_input_info;
InputInfo& m_input_info;
ResultInfo m_result_info;
wxBoxSizer *m_sizer_main{nullptr};
@ -369,7 +374,7 @@ private:
Button *m_button_cancel = nullptr;
};
class FinishSyncAmsDialog : public Slic3r::GUI::DPIDialog
class FinishSyncAmsDialog : public Slic3r::GUI::DPIFrame
{
public:
struct InputInfo
@ -383,9 +388,10 @@ public:
void on_dpi_changed(const wxRect &suggested_rect) override;
void deal_ok();
void deal_cancel();
void on_hide();
// bool Show(bool show) override;
private:
InputInfo &m_input_info;
InputInfo& m_input_info;
ResultInfo m_result_info;
wxBoxSizer *m_sizer_main{nullptr};