FIX:fix bug for the base color of the color modification

after matching the untreated material
jira:STUDIO-10062

Change-Id: I699fd843600182bc87b224eee488e752b64ca0b4
This commit is contained in:
zhou.xu 2025-01-22 09:08:10 +08:00 committed by lane.wei
parent ea36ee5879
commit 29b0be89eb
12 changed files with 164 additions and 19 deletions

View File

@ -0,0 +1,39 @@
<svg width="30" height="40" viewBox="0 0 30 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="19.7593" y="9.39136" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="12.5596" y="5.81812" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="16.1592" y="5.81812" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="8.62891" y="5.81812" width="3.92951" height="3.5734" fill="#767676"/>
<rect x="12.5591" y="9.39136" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="19.7598" y="5.81812" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="16.1597" y="9.39136" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="8.62939" y="9.39136" width="3.92951" height="3.5734" fill="#9D9D9D"/>
<rect x="19.7593" y="16.5383" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="12.5591" y="12.9648" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="16.1597" y="12.9648" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="8.62939" y="12.9648" width="3.92951" height="3.5734" fill="#767676"/>
<rect x="12.5591" y="16.5383" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="19.7593" y="12.9648" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="16.1597" y="16.5383" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="8.62939" y="16.5383" width="3.92951" height="3.5734" fill="#9D9D9D"/>
<rect x="19.7593" y="23.6853" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="12.5591" y="20.1116" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="16.1597" y="20.1116" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="8.62939" y="20.1116" width="3.92951" height="3.5734" fill="#767676"/>
<rect x="12.5591" y="23.6853" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="19.7593" y="20.1116" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="16.1597" y="23.6853" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="8.62939" y="23.6853" width="3.92951" height="3.5734" fill="#9D9D9D"/>
<rect x="19.7593" y="30.6084" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="12.5591" y="27.0354" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="16.1597" y="27.0354" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="8.62939" y="27.0354" width="3.92951" height="3.5734" fill="#767676"/>
<rect x="12.5591" y="30.6084" width="3.59999" height="3.5734" fill="#767676"/>
<rect x="19.7593" y="27.0354" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="16.1597" y="30.6084" width="3.59999" height="3.5734" fill="#9D9D9D"/>
<rect x="8.62939" y="30.6084" width="3.92951" height="3.5734" fill="#9D9D9D"/>
<path d="M23.2596 37.5131C25.5229 37.5131 27.3577 29.5764 27.3577 19.7859C27.3577 9.99536 25.5229 2.05859 23.2596 2.05859C22.3784 2.05859 21.3802 3.55703 20.7119 5.60405H22.2969C22.7771 6.93611 23.7442 11.4734 23.7442 20.5097C23.7442 29.546 22.4689 33.0115 22.2969 34.0043H20.8278C21.5273 36.4088 22.2967 37.5131 23.2596 37.5131Z" fill="#F2F2F2"/>
<path d="M20.7119 5.60405C21.3802 3.55703 22.3784 2.05859 23.2596 2.05859C25.5229 2.05859 27.3577 9.99536 27.3577 19.7859C27.3577 29.5764 25.5229 37.5131 23.2596 37.5131C22.2967 37.5131 21.4114 36.0767 20.7119 33.6722" stroke="#5C5C5C" stroke-width="2"/>
<path d="M8.62891 5.60352H22.3115C23.2206 8.8144 23.7331 14.1019 23.7331 20.0808C23.7331 25.7062 23.1308 30.7196 22.3115 33.9672H8.62891" stroke="#5C5C5C"/>
<path d="M6.51399 37.5132C8.68286 37.5132 10.4411 29.5764 10.4411 19.7859C10.4411 9.99538 8.68286 2.05859 6.51399 2.05859C4.34513 2.05859 2.58691 9.99538 2.58691 19.7859C2.58691 29.5764 4.34513 37.5132 6.51399 37.5132Z" fill="#F2F2F2" stroke="#5C5C5C" stroke-width="2"/>
<path d="M6.21159 22.7401C6.54526 22.7401 6.81576 21.5495 6.81576 20.081C6.81576 18.6124 6.54526 17.4219 6.21159 17.4219C5.87792 17.4219 5.60742 18.6124 5.60742 20.081C5.60742 21.5495 5.87792 22.7401 6.21159 22.7401Z" fill="#5C5C5C"/>
</svg>

After

Width:  |  Height:  |  Size: 3.8 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 16.0001C26.8334 18.8733 25.6921 21.6288 23.6604 23.6604C21.6288 25.6921 18.8733 26.8334 16.0001 26.8334C13.1269 26.8334 10.3714 25.6921 8.33976 23.6604C6.30811 21.6288 5.16675 18.8733 5.16675 16.0001C5.16675 13.1269 6.30811 10.3714 8.33976 8.33976C10.3714 6.30811 13.1269 5.16675 16.0001 5.16675C18.8733 5.16675 21.6288 6.30811 23.6604 8.33976C25.6921 10.3714 26.8334 13.1269 26.8334 16.0001ZM2.66675 16.0001C2.66675 19.5363 4.07151 22.9277 6.57199 25.4282C9.07248 27.9287 12.4639 29.3334 16.0001 29.3334C19.5363 29.3334 22.9277 27.9287 25.4282 25.4282C27.9287 22.9277 29.3334 19.5363 29.3334 16.0001C29.3334 12.4639 27.9287 9.07248 25.4282 6.57199C22.9277 4.07151 19.5363 2.66675 16.0001 2.66675C12.4639 2.66675 9.07248 4.07151 6.57199 6.57199C4.07151 9.07248 2.66675 12.4639 2.66675 16.0001ZM15.2188 22.3022L20.6355 16.8855C21.1251 16.3959 21.1251 15.6042 20.6355 15.1199L15.2188 9.698C14.7292 9.20841 13.9376 9.20841 13.4532 9.698C12.9688 10.1876 12.9636 10.9792 13.4532 11.4636L17.9845 15.9949L13.4532 20.5261C12.9636 21.0157 12.9636 21.8074 13.4532 22.2917C13.9428 22.7761 14.7345 22.7813 15.2188 22.2917V22.3022Z" fill="#626262"/>
</svg>

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 16.0001C5.16675 13.1269 6.30811 10.3714 8.33976 8.33976C10.3714 6.30811 13.1269 5.16675 16.0001 5.16675C18.8733 5.16675 21.6288 6.30811 23.6604 8.33976C25.6921 10.3714 26.8334 13.1269 26.8334 16.0001C26.8334 18.8733 25.6921 21.6288 23.6604 23.6604C21.6288 25.6921 18.8733 26.8334 16.0001 26.8334C13.1269 26.8334 10.3714 25.6921 8.33976 23.6604C6.30811 21.6288 5.16675 18.8733 5.16675 16.0001ZM29.3334 16.0001C29.3334 12.4639 27.9287 9.07248 25.4282 6.57199C22.9277 4.07151 19.5363 2.66675 16.0001 2.66675C12.4639 2.66675 9.07248 4.07151 6.57199 6.57199C4.07151 9.07248 2.66675 12.4639 2.66675 16.0001C2.66675 19.5363 4.07151 22.9277 6.57199 25.4282C9.07248 27.9287 12.4639 29.3334 16.0001 29.3334C19.5363 29.3334 22.9277 27.9287 25.4282 25.4282C27.9287 22.9277 29.3334 19.5363 29.3334 16.0001ZM16.7813 9.698L11.3647 15.1147C10.8751 15.6042 10.8751 16.3959 11.3647 16.8803L16.7813 22.3022C17.2709 22.7917 18.0626 22.7917 18.547 22.3022C19.0313 21.8126 19.0365 21.0209 18.547 20.5365L14.0157 16.0053L18.547 11.474C19.0365 10.9845 19.0365 10.1928 18.547 9.70841C18.0574 9.22404 17.2657 9.21883 16.7813 9.70841V9.698Z" fill="#626262"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,50 @@
<svg width="65" height="20" viewBox="0 0 65 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_21178_57054)">
<path d="M0 5C0 2.23858 2.23858 0 5 0H60C62.7614 0 65 2.23858 65 5V20H0V5Z" fill="white"/>
<path d="M50.1 0H45.8V3.5H50.1V0Z" fill="#D9D9D9"/>
<path d="M65 7.6001H62.8V11.7001H65V7.6001Z" fill="#D9D9D9"/>
<path d="M58.6 0H54.3V3.5H58.6V0Z" fill="#D9D9D9"/>
<path d="M62.8 0.899902V3.4999H64.7C64.4 2.3999 63.7 1.4999 62.8 0.899902Z" fill="#D9D9D9"/>
<path d="M16 7.6001H11.7V11.7001H16V7.6001Z" fill="#D9D9D9"/>
<path d="M41.6 0H37.3V3.5H41.6V0Z" fill="#D9D9D9"/>
<path d="M16 15.8999H11.7V19.9999H16V15.8999Z" fill="#D9D9D9"/>
<path d="M7.49995 15.8999H3.19995V19.9999H7.49995V15.8999Z" fill="#D9D9D9"/>
<path d="M33 15.8999H28.7V19.9999H33V15.8999Z" fill="#D9D9D9"/>
<path d="M41.6 15.8999H37.3V19.9999H41.6V15.8999Z" fill="#D9D9D9"/>
<path d="M50.1 15.8999H45.8V19.9999H50.1V15.8999Z" fill="#D9D9D9"/>
<path d="M24.5 15.8999H20.2V19.9999H24.5V15.8999Z" fill="#D9D9D9"/>
<path d="M3.2 11.7998H0V15.8998H3.2V11.7998Z" fill="#D9D9D9"/>
<path d="M24.5 0H20.2V3.5H24.5V0Z" fill="#D9D9D9"/>
<path d="M33 0H28.7V3.5H33V0Z" fill="#D9D9D9"/>
<path d="M16 0H11.7V3.5H16V0Z" fill="#D9D9D9"/>
<path d="M7.49995 0H4.99995C4.39995 0 3.79995 0.1 3.19995 0.3V3.5H7.49995V0Z" fill="#D9D9D9"/>
<path d="M0.3 3.5C0.1 4 0 4.5 0 5V7.6H3.2V3.5H0.3Z" fill="#D9D9D9"/>
<path d="M58.6 15.8999H54.3V19.9999H58.6V15.8999Z" fill="#D9D9D9"/>
<path d="M20.3 11.7998H16V15.8998H20.3V11.7998Z" fill="#D9D9D9"/>
<path d="M28.8 11.7998H24.5V15.8998H28.8V11.7998Z" fill="#D9D9D9"/>
<path d="M11.8 3.5H7.5V7.6H11.8V3.5Z" fill="#D9D9D9"/>
<path d="M11.8 11.7998H7.5V15.8998H11.8V11.7998Z" fill="#D9D9D9"/>
<path d="M7.49995 7.6001H3.19995V11.7001H7.49995V7.6001Z" fill="#D9D9D9"/>
<path d="M37.3 11.7998H33V15.8998H37.3V11.7998Z" fill="#D9D9D9"/>
<path d="M24.5 7.6001H20.2V11.7001H24.5V7.6001Z" fill="#D9D9D9"/>
<path d="M62.8 11.7998H58.5V15.8998H62.8V11.7998Z" fill="#D9D9D9"/>
<path d="M54.3 11.7998H50V15.8998H54.3V11.7998Z" fill="#D9D9D9"/>
<path d="M45.8 11.7998H41.5V15.8998H45.8V11.7998Z" fill="#D9D9D9"/>
<path d="M65 15.8999H62.8V19.9999H65V15.8999Z" fill="#D9D9D9"/>
<path d="M50.1 7.6001H45.8V11.7001H50.1V7.6001Z" fill="#D9D9D9"/>
<path d="M58.6 7.6001H54.3V11.7001H58.6V7.6001Z" fill="#D9D9D9"/>
<path d="M62.8 3.5H58.5V7.6H62.8V3.5Z" fill="#D9D9D9"/>
<path d="M41.6 7.6001H37.3V11.7001H41.6V7.6001Z" fill="#D9D9D9"/>
<path d="M33 7.6001H28.7V11.7001H33V7.6001Z" fill="#D9D9D9"/>
<path d="M20.3 3.5H16V7.6H20.3V3.5Z" fill="#D9D9D9"/>
<path d="M28.8 3.5H24.5V7.6H28.8V3.5Z" fill="#D9D9D9"/>
<path d="M37.3 3.5H33V7.6H37.3V3.5Z" fill="#D9D9D9"/>
<path d="M45.8 3.5H41.5V7.6H45.8V3.5Z" fill="#D9D9D9"/>
<path d="M54.3 3.5H50V7.6H54.3V3.5Z" fill="#D9D9D9"/>
</g>
<defs>
<clipPath id="clip0_21178_57054">
<path d="M0 5C0 2.23858 2.23858 0 5 0H60C62.7614 0 65 2.23858 65 5V20H0V5Z" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -34,7 +34,8 @@ const int LEFT_OFFSET = 2;
{ {
m_arraw_bitmap_gray = ScalableBitmap(this, "drop_down2", FromDIP(8)); m_arraw_bitmap_gray = ScalableBitmap(this, "drop_down2", FromDIP(8));
m_arraw_bitmap_white = ScalableBitmap(this, "topbar_dropdown", 12); m_arraw_bitmap_white = ScalableBitmap(this, "topbar_dropdown", 12);
m_transparent_mitem = ScalableBitmap(this, "transparent_material_item", FromDIP(50)); m_transparent_mitem = ScalableBitmap(this, "transparent_material_up", FromDIP(16));
m_filament_wheel_transparent = ScalableBitmap(this, "filament_transparent", FromDIP(20));//wxGetApp().dark_mode() ? "filament_dark_transparent"
//m_ams_wheel_mitem = ScalableBitmap(this, "ams_wheel", FromDIP(25)); //m_ams_wheel_mitem = ScalableBitmap(this, "ams_wheel", FromDIP(25));
m_ams_wheel_mitem = ScalableBitmap(this, "ams_wheel_narrow", 25); m_ams_wheel_mitem = ScalableBitmap(this, "ams_wheel_narrow", 25);
m_ams_not_match = ScalableBitmap(this, "filament_not_mactch", 25); m_ams_not_match = ScalableBitmap(this, "filament_not_mactch", 25);
@ -206,7 +207,7 @@ void MaterialItem::doRender(wxDC& dc)
auto acolor = m_ams_coloul; auto acolor = m_ams_coloul;
change_the_opacity(acolor); change_the_opacity(acolor);
if (mcolor.Alpha() == 0 || acolor.Alpha() == 0) { if (mcolor.Alpha() == 0) {
dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(1), FromDIP(1)); dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(1), FromDIP(1));
} }
@ -314,10 +315,14 @@ void MaterialItem::doRender(wxDC& dc)
if (!m_match) { if (!m_match) {
wheel_left += m_ams_wheel_mitem.GetBmpSize().x; wheel_left += m_ams_wheel_mitem.GetBmpSize().x;
dc.DrawBitmap(m_ams_not_match.bmp(), (size.x - m_ams_not_match.GetBmpWidth()) / 2 - FromDIP(LEFT_OFFSET), wheel_top); dc.DrawBitmap(m_ams_not_match.bmp(), (size.x - m_ams_not_match.GetBmpWidth()) / 2 - FromDIP(LEFT_OFFSET), wheel_top);
} else {
if (mcolor.Alpha() == 0) {
dc.DrawBitmap(m_filament_wheel_transparent.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
} else { } else {
dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top); dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
} }
} }
}
MaterialSyncItem::MaterialSyncItem(wxWindow *parent, wxColour mcolour, wxString mname) : MaterialItem(parent, mcolour, mname) MaterialSyncItem::MaterialSyncItem(wxWindow *parent, wxColour mcolour, wxString mname) : MaterialItem(parent, mcolour, mname)
{ {
@ -406,8 +411,8 @@ void MaterialSyncItem::doRender(wxDC &dc)
auto acolor = m_ams_coloul; auto acolor = m_ams_coloul;
change_the_opacity(acolor); change_the_opacity(acolor);
if (mcolor.Alpha() == 0 || acolor.Alpha() == 0) { if (mcolor.Alpha() == 0) {
dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(1), FromDIP(1)); dc.DrawBitmap(m_transparent_mitem.bmp(), FromDIP(0), FromDIP(0));
} }
if (!IsEnabled()) { if (!IsEnabled()) {
@ -503,8 +508,12 @@ void MaterialSyncItem::doRender(wxDC &dc)
auto wheel_left = (GetSize().x / 2 - m_ams_wheel_mitem.GetBmpSize().x) / 2 + FromDIP(2); auto wheel_left = (GetSize().x / 2 - m_ams_wheel_mitem.GetBmpSize().x) / 2 + FromDIP(2);
auto wheel_top = ((float) GetSize().y * 0.6 - m_ams_wheel_mitem.GetBmpSize().y) / 2 + (float) GetSize().y * 0.4; auto wheel_top = ((float) GetSize().y * 0.6 - m_ams_wheel_mitem.GetBmpSize().y) / 2 + (float) GetSize().y * 0.4;
if (m_match) {// different with parent if (m_match) {// different with parent
if (mcolor.Alpha() == 0) {
dc.DrawBitmap(m_filament_wheel_transparent.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
} else {
dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top); dc.DrawBitmap(m_ams_wheel_mitem.bmp(), wheel_left - FromDIP(LEFT_OFFSET), wheel_top);
} }
}
//not draw m_ams_not_match //not draw m_ams_not_match
} }

View File

@ -89,6 +89,7 @@ public:
ScalableBitmap m_arraw_bitmap_gray; ScalableBitmap m_arraw_bitmap_gray;
ScalableBitmap m_arraw_bitmap_white; ScalableBitmap m_arraw_bitmap_white;
ScalableBitmap m_transparent_mitem; ScalableBitmap m_transparent_mitem;
ScalableBitmap m_filament_wheel_transparent;
ScalableBitmap m_ams_wheel_mitem; ScalableBitmap m_ams_wheel_mitem;
ScalableBitmap m_ams_not_match; ScalableBitmap m_ams_not_match;

View File

@ -205,6 +205,15 @@ void BaseTransparentDPIFrame::call_start_gradual_disappearance()//for ok or canc
start_gradual_disappearance(); start_gradual_disappearance();
} }
void BaseTransparentDPIFrame::restart() {
m_display_stage = 0;
m_enter_window_valid = true;
SetTransparent(m_init_transparent);
if (m_refresh_timer) {
clear_timer_count();
m_refresh_timer->Start(ANIMATION_REFRESH_INTERVAL);
}
}
void BaseTransparentDPIFrame::start_gradual_disappearance() void BaseTransparentDPIFrame::start_gradual_disappearance()
{ {
clear_timer_count(); clear_timer_count();

View File

@ -39,6 +39,7 @@ public:
virtual void on_timer(wxTimerEvent &event); virtual void on_timer(wxTimerEvent &event);
void set_target_pos_and_gradual_disappearance(wxPoint pos); void set_target_pos_and_gradual_disappearance(wxPoint pos);
void call_start_gradual_disappearance(); void call_start_gradual_disappearance();
void restart();
protected: protected:
Button *m_button_ok = nullptr; Button *m_button_ok = nullptr;

View File

@ -3033,9 +3033,10 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn)
if (m_sna_dialog) { if (m_sna_dialog) {
m_sna_dialog->on_hide(); m_sna_dialog->on_hide();
} }
m_fna_dialog.reset(); m_fna_dialog->update_info(temp_fsa_info);
} } else {
m_fna_dialog = std::make_shared<FinishSyncAmsDialog>(temp_fsa_info); m_fna_dialog = std::make_shared<FinishSyncAmsDialog>(temp_fsa_info);
}
m_fna_dialog->on_show(); m_fna_dialog->on_show();
} }
@ -3144,9 +3145,10 @@ void Sidebar::pop_sync_nozzle_and_ams_ialog() {
if (m_fna_dialog) { if (m_fna_dialog) {
m_fna_dialog->on_hide(); m_fna_dialog->on_hide();
} }
m_sna_dialog.reset(); m_sna_dialog->update_info(temp_na_info);
} } else {
m_sna_dialog = std::make_shared<SyncNozzleAndAmsDialog>(temp_na_info); m_sna_dialog = std::make_shared<SyncNozzleAndAmsDialog>(temp_na_info);
}
m_sna_dialog->on_show(); m_sna_dialog->on_show();
} }

View File

@ -166,6 +166,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
m_thumbnailPanel->SetMinSize(wxSize(FromDIP(198), FromDIP(198))); m_thumbnailPanel->SetMinSize(wxSize(FromDIP(198), FromDIP(198)));
m_thumbnailPanel->SetMaxSize(wxSize(FromDIP(198), FromDIP(198))); m_thumbnailPanel->SetMaxSize(wxSize(FromDIP(198), FromDIP(198)));
m_thumbnailPanel->SetBackgroundColour(*wxWHITE); m_thumbnailPanel->SetBackgroundColour(*wxWHITE);
m_thumbnailPanel->SetToolTip(_L("If the transparency of the mapping changes, this thumbnail is for reference only."));
m_sizer_thumbnail->Add(m_thumbnailPanel, 0, wxALIGN_CENTER, 0); m_sizer_thumbnail->Add(m_thumbnailPanel, 0, wxALIGN_CENTER, 0);
m_panel_image->SetSizer(m_sizer_thumbnail); m_panel_image->SetSizer(m_sizer_thumbnail);
m_panel_image->Layout(); m_panel_image->Layout();
@ -4050,7 +4051,7 @@ void SelectMachineDialog::change_default_normal(int old_filament_id, wxColour te
wxColour temp_ams_color_in_loop = m_cur_colors_in_thumbnail[filament_id]; wxColour temp_ams_color_in_loop = m_cur_colors_in_thumbnail[filament_id];
wxColour ams_color = adjust_color_for_render(temp_ams_color_in_loop); wxColour ams_color = adjust_color_for_render(temp_ams_color_in_loop);
//change color //change color
new_px[3] = origin_px[3]; // alpha new_px[3] = ams_color.Alpha(); //origin_px[3]; // alpha
int origin_rgb = origin_px[0] + origin_px[1] + origin_px[2]; int origin_rgb = origin_px[0] + origin_px[1] + origin_px[2];
int no_light_px_rgb = no_light_px[0] + no_light_px[1] + no_light_px[2]; int no_light_px_rgb = no_light_px[0] + no_light_px[1] + no_light_px[2];
unsigned char i = 0; unsigned char i = 0;

View File

@ -231,6 +231,7 @@ void SyncAmsInfoDialog::set_default_normal(const ThumbnailData &data)
image.SetAlpha((int) c, (int) r, px[3]); image.SetAlpha((int) c, (int) r, px[3]);
} }
} }
//image.SaveFile("E:/preview.png", wxBITMAP_TYPE_PNG);
image = image.Rescale(FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH), FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH)); image = image.Rescale(FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH), FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH));
m_right_image_button->SetBitmap(image); m_right_image_button->SetBitmap(image);
auto extruders = wxGetApp().plater()->get_partplate_list().get_plate(m_specify_plate_idx)->get_extruders(); auto extruders = wxGetApp().plater()->get_partplate_list().get_plate(m_specify_plate_idx)->get_extruders();
@ -457,6 +458,14 @@ void SyncAmsInfoDialog::update_more_setting(bool layout)
void SyncAmsInfoDialog::init_bitmaps() void SyncAmsInfoDialog::init_bitmaps()
{ {
if (wxGetApp().dark_mode()) {
m_swipe_left_bmp_normal = ScalableBitmap(this, "previous_item", m_bmp_pix_cont);
m_swipe_left_bmp_hover = ScalableBitmap(this, "previous_item_disable", m_bmp_pix_cont);
m_swipe_left_bmp_disable = ScalableBitmap(this, "previous_item_dark_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_disable", m_bmp_pix_cont);
m_swipe_right_bmp_disable = ScalableBitmap(this, "next_item_dark_disable", m_bmp_pix_cont);
} else {
m_swipe_left_bmp_normal = ScalableBitmap(this, "previous_item", m_bmp_pix_cont); 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_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_left_bmp_disable = ScalableBitmap(this, "previous_item_disable", m_bmp_pix_cont);
@ -464,7 +473,7 @@ void SyncAmsInfoDialog::init_bitmaps()
m_swipe_right_bmp_hover = ScalableBitmap(this, "next_item_hover", 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); m_swipe_right_bmp_disable = ScalableBitmap(this, "next_item_disable", m_bmp_pix_cont);
} }
}
void SyncAmsInfoDialog::add_two_image_control() void SyncAmsInfoDialog::add_two_image_control()
{// thumbnail {// thumbnail
@ -513,6 +522,7 @@ void SyncAmsInfoDialog::add_two_image_control()
wxSize(FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH), FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH)), wxSize(FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH), FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH)),
wxBORDER_NONE | wxBU_AUTODRAW); wxBORDER_NONE | wxBU_AUTODRAW);
m_right_image_button->SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(61, 61, 61, 0) : wxColour(238, 238, 238, 0)); m_right_image_button->SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(61, 61, 61, 0) : wxColour(238, 238, 238, 0));
m_right_image_button->SetToolTip(_L("If the transparency of the mapping changes, this thumbnail is for reference only."));
m_right_sizer_thumbnail = create_sizer_thumbnail(m_right_image_button, false); m_right_sizer_thumbnail = create_sizer_thumbnail(m_right_image_button, false);
m_two_image_panel_sizer->Add(m_right_sizer_thumbnail, FromDIP(0), wxALIGN_LEFT | wxEXPAND | wxRIGHT | wxTOP | wxBOTTOM, FromDIP(8)); m_two_image_panel_sizer->Add(m_right_sizer_thumbnail, FromDIP(0), wxALIGN_LEFT | wxEXPAND | wxRIGHT | wxTOP | wxBOTTOM, FromDIP(8));
m_two_image_panel->SetSizer(m_two_image_panel_sizer); m_two_image_panel->SetSizer(m_two_image_panel_sizer);
@ -4154,7 +4164,7 @@ void SyncAmsInfoDialog::change_default_normal(int old_filament_id, wxColour temp
wxColour temp_ams_color_in_loop = m_cur_colors_in_thumbnail[filament_id]; wxColour temp_ams_color_in_loop = m_cur_colors_in_thumbnail[filament_id];
wxColour ams_color = adjust_color_for_render(temp_ams_color_in_loop); wxColour ams_color = adjust_color_for_render(temp_ams_color_in_loop);
// change color // change color
new_px[3] = origin_px[3]; // alpha new_px[3] = ams_color.Alpha(); //origin_px[3]; // alpha
int origin_rgb = origin_px[0] + origin_px[1] + origin_px[2]; int origin_rgb = origin_px[0] + origin_px[1] + origin_px[2];
int no_light_px_rgb = no_light_px[0] + no_light_px[1] + no_light_px[2]; int no_light_px_rgb = no_light_px[0] + no_light_px[1] + no_light_px[2];
unsigned char i = 0; unsigned char i = 0;
@ -4317,6 +4327,12 @@ void SyncNozzleAndAmsDialog::deal_cancel()
call_start_gradual_disappearance(); call_start_gradual_disappearance();
} }
void SyncNozzleAndAmsDialog::update_info(InputInfo &info) {
m_input_info = info;
restart();
SetPosition(m_input_info.dialog_pos);
}
FinishSyncAmsDialog::FinishSyncAmsDialog(InputInfo &input_info) FinishSyncAmsDialog::FinishSyncAmsDialog(InputInfo &input_info)
: BaseTransparentDPIFrame(static_cast<wxWindow *>(wxGetApp().mainframe), : BaseTransparentDPIFrame(static_cast<wxWindow *>(wxGetApp().mainframe),
300, 300,
@ -4338,4 +4354,11 @@ void FinishSyncAmsDialog::deal_ok() {
call_start_gradual_disappearance(); call_start_gradual_disappearance();
} }
void FinishSyncAmsDialog::update_info(InputInfo &info)
{
m_input_info = info;
restart();
SetPosition(m_input_info.dialog_pos);
}
}} // namespace Slic3r }} // namespace Slic3r

View File

@ -366,6 +366,8 @@ public:
~SyncNozzleAndAmsDialog() override; ~SyncNozzleAndAmsDialog() override;
void deal_ok() override; void deal_ok() override;
void deal_cancel() override; void deal_cancel() override;
void update_info(InputInfo& info);
private: private:
InputInfo& m_input_info; InputInfo& m_input_info;
}; };
@ -381,6 +383,8 @@ public:
FinishSyncAmsDialog(InputInfo &input_info); FinishSyncAmsDialog(InputInfo &input_info);
~FinishSyncAmsDialog() override; ~FinishSyncAmsDialog() override;
void deal_ok(); void deal_ok();
void update_info(InputInfo &info);
private: private:
InputInfo& m_input_info; InputInfo& m_input_info;
}; };