ENH: modify the UI of filament map dialog

jira: none
Change-Id: I513a518de4509fb7adbc81d9fc3b0fc43fb3244a
(cherry picked from commit 631baa3999ece2540c66cbf1488c55b64cadaf8e)
This commit is contained in:
zhimin.zeng
2024-09-23 11:38:10 +08:00
committed by Noisyfox
parent df7a9b1267
commit 7c6edc004f
4 changed files with 111 additions and 69 deletions

View File

@@ -11,7 +11,6 @@
namespace Slic3r { namespace GUI {
class ColorPanel;
class DragDropPanel : public wxPanel
{
@@ -27,14 +26,37 @@ public:
void set_is_draging(bool is_draging) { m_is_draging = is_draging; }
bool is_draging() const { return m_is_draging; }
std::vector<ColorPanel *> get_filament_blocks() const { return m_filament_blocks; }
private:
wxBoxSizer *m_sizer;
wxGridSizer *m_grid_item_sizer;
bool m_is_auto;
std::vector<ColorPanel *> m_filament_blocks;
private:
bool m_is_draging = false;
};
/////////////// ColorPanel start ////////////////////////
// The UI panel of drag item
class ColorPanel : public wxPanel
{
public:
ColorPanel(DragDropPanel *parent, const wxColour &color, int filament_id);
wxColour GetColor() const { return GetBackgroundColour(); }
int GetFilamentId() const { return m_filament_id; }
private:
void OnLeftDown(wxMouseEvent &event);
void OnLeftUp(wxMouseEvent &event);
void OnPaint(wxPaintEvent &event);
DragDropPanel *m_parent;
wxColor m_color;
int m_filament_id;
};
}} // namespace Slic3r::GUI
#endif /* slic3r_DragDropPanel_hpp_ */