FIX: use wxDialog instead

jira: [STUDIO-12440]
Change-Id: I812e401fa46ba803bfc27b5c498b9d576e663173
(cherry picked from commit f02ef821166abf133036835575f6c71a39faa350)
This commit is contained in:
xin.zhang
2025-05-28 21:05:23 +08:00
committed by Noisyfox
parent e42556f835
commit 33891e4ddc
3 changed files with 4 additions and 15 deletions

View File

@@ -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();
}

View File

@@ -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;