FIX: fix ams_dialog filament color button display
Change-Id: Id02b8e1d703e11006318fa4140393481ff9f5108
This commit is contained in:
parent
ffbb7a8be5
commit
8ad5bdb914
|
@ -64,13 +64,12 @@ void AMSMaterialsSetting::create()
|
|||
m_clrData->SetChooseFull(true);
|
||||
m_clrData->SetChooseAlpha(false);
|
||||
|
||||
m_clr_picker = new wxButton(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize,wxBU_AUTODRAW);
|
||||
m_clr_picker = new Button(this, "", "");
|
||||
m_clr_picker->SetCanFocus(false);
|
||||
m_clr_picker->SetSize(FromDIP(50), FromDIP(25));
|
||||
m_clr_picker->SetMinSize(wxSize(FromDIP(50), FromDIP(25)));
|
||||
//m_clr_picker->SetCornerRadius(FromDIP(6));
|
||||
//m_clr_picker->SetBorderColor(wxColour(172, 172, 172));
|
||||
m_clr_picker->SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
|
||||
m_clr_picker->SetCornerRadius(FromDIP(6));
|
||||
m_clr_picker->SetBorderColor(wxColour(172, 172, 172));
|
||||
m_clr_picker->Bind(wxEVT_BUTTON, &AMSMaterialsSetting::on_clr_picker, this);
|
||||
m_sizer_colour->Add(m_clr_picker, 0, 0, 0);
|
||||
|
||||
|
@ -235,16 +234,16 @@ void AMSMaterialsSetting::create()
|
|||
SetSizer(m_sizer_main);
|
||||
Layout();
|
||||
Fit();
|
||||
|
||||
Bind(wxEVT_PAINT, &AMSMaterialsSetting::paintEvent, this);
|
||||
COMBOBOX_FILAMENT->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(AMSMaterialsSetting::on_select_filament), NULL, this);
|
||||
|
||||
Bind(wxEVT_PAINT, &AMSMaterialsSetting::paintEvent, this);
|
||||
COMBOBOX_FILAMENT->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(AMSMaterialsSetting::on_select_filament), NULL, this);
|
||||
}
|
||||
|
||||
void AMSMaterialsSetting::paintEvent(wxPaintEvent &evt)
|
||||
{
|
||||
auto size = GetSize();
|
||||
wxPaintDC dc(this);
|
||||
dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour(38, 46, 48)), 1, wxSOLID));
|
||||
dc.SetPen(wxPen(StateColor::darkModeColorFor(wxColour("#000000")), 1, wxSOLID));
|
||||
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
|
||||
dc.DrawRectangle(0, 0, size.x, size.y);
|
||||
}
|
||||
|
@ -365,7 +364,7 @@ void AMSMaterialsSetting::on_clr_picker(wxCommandEvent & event)
|
|||
show_flag = true;
|
||||
if (clr_dialog->ShowModal() == wxID_OK) {
|
||||
m_clrData = &(clr_dialog->GetColourData());
|
||||
m_clr_picker->SetBackgroundColour(m_clrData->GetColour());
|
||||
m_clr_picker->SetBackgroundColor(m_clrData->GetColour());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -381,7 +380,7 @@ bool AMSMaterialsSetting::Show(bool show)
|
|||
|
||||
void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_min, wxString temp_max)
|
||||
{
|
||||
m_clr_picker->SetBackgroundColour(m_clrData->GetColour());
|
||||
m_clr_picker->SetBackgroundColor(m_clrData->GetColour());
|
||||
|
||||
if (!m_is_third) {
|
||||
m_button_confirm->Hide();
|
||||
|
|
|
@ -83,7 +83,7 @@ protected:
|
|||
Button * m_button_confirm;
|
||||
wxStaticText* m_tip_readonly;
|
||||
Button * m_button_close;
|
||||
wxButton * m_clr_picker;
|
||||
Button * m_clr_picker;
|
||||
wxColourData * m_clrData;
|
||||
#ifdef __APPLE__
|
||||
wxComboBox *m_comboBox_filament_mac;
|
||||
|
|
Loading…
Reference in New Issue