mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
FIX: modify UI of FilamentMapDialog
1. Modify dragging behavior 2. The swap button is grayed out in automatic mode jira:none Change-Id: Idff795bf092c4959c67d0711b0be316fba997684 (cherry picked from commit c7486e1c5e56667cab61ee9a97898f03b65b64b8)
This commit is contained in:
@@ -174,21 +174,31 @@ DragDropPanel::DragDropPanel(wxWindow *parent, const wxString &label, bool is_au
|
||||
Fit();
|
||||
}
|
||||
|
||||
void DragDropPanel::AddColorBlock(const wxColour &color, int filament_id)
|
||||
void DragDropPanel::AddColorBlock(const wxColour &color, int filament_id, bool update_ui)
|
||||
{
|
||||
ColorPanel *panel = new ColorPanel(this, color, filament_id);
|
||||
panel->SetMinSize(wxSize(50, 50));
|
||||
m_grid_item_sizer->Add(panel, 0, wxALIGN_CENTER | wxALL, 5);
|
||||
m_filament_blocks.push_back(panel);
|
||||
Layout();
|
||||
if (update_ui) {
|
||||
Layout();
|
||||
Fit();
|
||||
GetParent()->Layout();
|
||||
GetParent()->Fit();
|
||||
}
|
||||
}
|
||||
|
||||
void DragDropPanel::RemoveColorBlock(ColorPanel *panel)
|
||||
void DragDropPanel::RemoveColorBlock(ColorPanel *panel, bool update_ui)
|
||||
{
|
||||
m_sizer->Detach(panel);
|
||||
panel->Destroy();
|
||||
m_filament_blocks.erase(std::remove(m_filament_blocks.begin(), m_filament_blocks.end(), panel), m_filament_blocks.end());
|
||||
Layout();
|
||||
if (update_ui) {
|
||||
Layout();
|
||||
Fit();
|
||||
GetParent()->Layout();
|
||||
GetParent()->Fit();
|
||||
}
|
||||
}
|
||||
|
||||
void DragDropPanel::DoDragDrop(ColorPanel *panel, const wxColour &color, int filament_id)
|
||||
|
||||
Reference in New Issue
Block a user