mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-06 06:47:41 -07: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:
parent
1658c6c54d
commit
1bcc4614b8
4 changed files with 32 additions and 10 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue