OrcaSlicer/src/slic3r/GUI/FilamentGroupPopup.hpp
xun.zhang 897a78ce9a ENH: refine the logic of filament map dialog
1. Always change the map and mode in plate if plate mode is not default
2. Always add pop up before slice
3. Fix the mapping issue in gcode viewer

jira: studio-9523,studio-9519,studio-9513,studio-9479

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I0d7d5daf081951ea2d49e06565762ac24064e77c
(cherry picked from commit afaa48520e16b6808f05e511ac1cfe91acadc84b)
2025-09-09 11:03:56 +08:00

62 lines
No EOL
1.5 KiB
C++

#ifndef FILAMENT_GROUP_HOVER_HPP
#define FILAMENT_GROUP_HOVER_HPP
#include "Widgets/PopupWindow.hpp"
#include "Widgets/Label.hpp"
namespace Slic3r { namespace GUI {
class PartPlate;
class Plater;
class FilamentGroupPopup : public PopupWindow
{
public:
FilamentGroupPopup(wxWindow *parent);
void tryPopup(Plater* plater,PartPlate* plate,bool skip_plate_sync);
void tryClose();
FilamentMapMode GetSelectedMode() const { return m_mode; }
private:
void OnPaint(wxPaintEvent&event);
void StartTimer();
void ResetTimer();
void OnRadioBtn(int idx);
void OnLeaveWindow(wxMouseEvent &);
void OnEnterWindow(wxMouseEvent &);
void OnTimer(wxTimerEvent &event);
void Dismiss();
void Init();
void UpdateButtonStatus(int hover_idx = -1);
void DrawRoundedCorner(int radius);
private:
FilamentMapMode GetFilamentMapMode() const;
void SetFilamentMapMode(const FilamentMapMode mode);
private:
enum ButtonType { btForFlush, btForMatch, btManual, btCount };
const std::vector<FilamentMapMode> mode_list = {fmmAutoForFlush, fmmAutoForMatch, fmmManual};
bool m_connected{ false };
bool m_active{ false };
bool m_sync_plate{ false };
FilamentMapMode m_mode;
wxTimer *m_timer;
std::vector<wxBitmapButton *> radio_btns;
std::vector<Label *> button_labels;
std::vector<Label *> button_desps;
std::vector<Label *> detail_infos;
wxStaticText *wiki_link;
PartPlate* partplate_ref{ nullptr };
Plater* plater_ref{ nullptr };
};
}} // namespace Slic3r::GUI
#endif