mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-05 20:26:11 +08:00
FIX: use wxDialog instead
jira: [STUDIO-12440] Change-Id: I812e401fa46ba803bfc27b5c498b9d576e663173
This commit is contained in:
parent
04d90ac16d
commit
f02ef82116
@ -20,7 +20,7 @@
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
uiAmsPercentHumidityDryPopup::uiAmsPercentHumidityDryPopup(wxWindow *parent)
|
||||
: PopupWindow(parent, wxBORDER_NONE)
|
||||
: wxDialog(parent, wxID_ANY, "")
|
||||
{
|
||||
Create();
|
||||
}
|
||||
@ -42,14 +42,9 @@ void uiAmsPercentHumidityDryPopup::Create()
|
||||
title->SetBackgroundColour(*wxWHITE);
|
||||
title->SetFont(Label::Head_18);
|
||||
|
||||
m_close_btn = new ScalableButton(this, wxID_ANY, "hum_popup_close");
|
||||
m_close_btn->SetBackgroundColour(*wxWHITE);
|
||||
m_close_btn->Bind(wxEVT_LEFT_UP, [this](auto& e) { Dismiss(); e.Skip(); });
|
||||
title_sizer->AddStretchSpacer();
|
||||
title_sizer->Add(title, 0, wxALIGN_CENTER_HORIZONTAL);
|
||||
title_sizer->AddStretchSpacer();
|
||||
title_sizer->Add(m_close_btn, 0, wxALIGN_RIGHT, 0);
|
||||
title_sizer->AddSpacer(FromDIP(10));
|
||||
|
||||
// create humidity image
|
||||
m_humidity_img = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap);
|
||||
@ -173,7 +168,6 @@ void uiAmsPercentHumidityDryPopup::msw_rescale()
|
||||
{
|
||||
idle_img.msw_rescale();
|
||||
drying_img.msw_rescale();
|
||||
m_close_btn->msw_rescale();
|
||||
UpdateContents();
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ struct uiAmsHumidityInfo
|
||||
/// Note: The popup of Ams Humidity with percentage and dry time
|
||||
/// Author: xin.zhang
|
||||
/// </summary>
|
||||
class uiAmsPercentHumidityDryPopup : public PopupWindow
|
||||
class uiAmsPercentHumidityDryPopup : public wxDialog
|
||||
{
|
||||
public:
|
||||
uiAmsPercentHumidityDryPopup(wxWindow *parent);
|
||||
@ -40,9 +40,6 @@ public:
|
||||
|
||||
std::string get_owner_ams_id() const { return m_ams_id; }
|
||||
|
||||
virtual void OnDismiss() wxOVERRIDE {};
|
||||
virtual bool ProcessLeftDown(wxMouseEvent &event) wxOVERRIDE { return true;};
|
||||
|
||||
void msw_rescale();
|
||||
|
||||
private:
|
||||
@ -65,7 +62,6 @@ private:
|
||||
ScalableBitmap idle_img;
|
||||
|
||||
// Widgets
|
||||
ScalableButton* m_close_btn;
|
||||
wxStaticBitmap* m_humidity_img;
|
||||
|
||||
wxStaticBitmap* m_dry_state_img;
|
||||
|
@ -40,7 +40,6 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
||||
wxBoxSizer *m_sizer_body = new wxBoxSizer(wxVERTICAL);
|
||||
m_amswin = new wxWindow(this, wxID_ANY);
|
||||
m_amswin->SetBackgroundColour(*wxWHITE);
|
||||
//m_amswin->SetBackgroundColour(wxColour(0x00CED1));
|
||||
m_amswin->SetSize(wxSize(FromDIP(578), -1));
|
||||
m_amswin->SetMinSize(wxSize(FromDIP(578), -1));
|
||||
|
||||
@ -285,8 +284,8 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
|
||||
|
||||
wxPoint img_pos = ClientToScreen(wxPoint(0, 0));
|
||||
wxPoint popup_pos(img_pos.x - m_percent_humidity_dry_popup->GetSize().GetWidth() + FromDIP(150), img_pos.y - FromDIP(80));
|
||||
m_percent_humidity_dry_popup->Position(popup_pos, wxSize(0, 0));
|
||||
m_percent_humidity_dry_popup->Popup();
|
||||
m_percent_humidity_dry_popup->Move(popup_pos);
|
||||
m_percent_humidity_dry_popup->ShowModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user