Files
OrcaSlicer-KX/src/slic3r/GUI/FilamentGroupPopup.hpp
xun.zhang 347cd4aadd ENH: refine some ui logics with filament map
1. Optimize performance with pop up
2. Optimize display in dark mode

jira:NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: Ic0f72a42e791fb58b84e7a88d7a34ced3a9e8c38
(cherry picked from commit 481ebc4a4b9353d8c9ef9d6bf64cb0006364e839)
2025-09-07 00:46:58 +08:00

56 lines
1.4 KiB
C++

#ifndef FILAMENT_GROUP_HOVER_HPP
#define FILAMENT_GROUP_HOVER_HPP
#include "Widgets/PopupWindow.hpp"
#include "Widgets/CheckBox.hpp"
#include "Widgets/Label.hpp"
namespace Slic3r { namespace GUI {
bool is_pop_up_required();
FilamentMapMode get_prefered_map_mode();
class FilamentGroupPopup : public PopupWindow
{
public:
FilamentGroupPopup(wxWindow *parent);
void tryPopup(bool connect_status);
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 OnRemindBtn(wxCommandEvent &event);
void Dismiss();
void Init();
void UpdateButtonStatus(int hover_idx = -1);
void DrawRoundedCorner(int radius);
private:
enum ButtonType { btForFlush, btForMatch, btManual, btCount };
const std::vector<FilamentMapMode> mode_list = {fmmAutoForFlush, fmmAutoForMatch, fmmManual};
FilamentMapMode m_mode;
bool m_connected{ false };
wxTimer *m_timer;
bool m_active{ false };
std::vector<wxBitmapButton *> radio_btns;
std::vector<Label *> button_labels;
std::vector<Label *> button_desps;
std::vector<Label *> detail_infos;
wxStaticText *wiki_link;
CheckBox* remind_checkbox;
};
}} // namespace Slic3r::GUI
#endif