From cf3ae1bd1acd17622762fc9275f92c7525649f52 Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Sun, 27 Apr 2025 20:56:05 +0800 Subject: [PATCH] FIX: the display problem of wxHyperlink on MAC15 jira: [STUDIO-11043] Change-Id: Ibc796e22d4dbee7f94d134f5b8444637f6e1390d --- src/slic3r/GUI/SelectMachine.cpp | 16 ++++++++++------ src/slic3r/GUI/SelectMachine.hpp | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 8ef6333b3..2a83a9d53 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -560,11 +560,15 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) wxBoxSizer *sizer_advanced_options_title = new wxBoxSizer(wxHORIZONTAL); - m_hyperlink = new wxHyperlinkCtrl(m_scroll_area, wxID_ANY, _L("Click here if you can't connect to the printer"), - wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); - m_hyperlink->SetFont(::Label::Body_12); + m_connect_printer_help_hyperlink = new Label(m_scroll_area, _L("Click here if you can't connect to the printer ->")); + m_connect_printer_help_hyperlink->SetForegroundColour(0x00ae42); + m_connect_printer_help_hyperlink->SetBackgroundColour(*wxWHITE); + m_connect_printer_help_hyperlink->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) { SetCursor(wxCURSOR_HAND); }); + m_connect_printer_help_hyperlink->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) { SetCursor(wxCURSOR_ARROW); }); + m_connect_printer_help_hyperlink->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { wxLaunchDefaultBrowser(wxT("https://wiki.bambulab.com/en/software/bambu-studio/failed-to-connect-printer"));}); + m_connect_printer_help_hyperlink->SetFont(::Label::Body_13); - sizer_advanced_options_title->Add(m_hyperlink, 0, wxALIGN_CENTER, 0); + sizer_advanced_options_title->Add(m_connect_printer_help_hyperlink, 0, wxALIGN_CENTER, 0); sizer_advanced_options_title->Add(0, 0, 1, wxEXPAND, 0); m_options_other = new wxPanel(m_scroll_area); @@ -3693,14 +3697,14 @@ void SelectMachineDialog::set_default() m_comboBox_printer->Show(true); m_button_refresh->Show(true); m_rename_normal_panel->Show(true); - m_hyperlink->Show(true); + m_connect_printer_help_hyperlink->Show(true); } else if (m_print_type == PrintFromType::FROM_SDCARD_VIEW) { m_stext_printer_title->Show(false); m_comboBox_printer->Show(true); m_button_refresh->Show(false); m_rename_normal_panel->Show(false); - m_hyperlink->Show(false); + m_connect_printer_help_hyperlink->Show(false); } //project name diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 92e1d4a4d..869c8320d 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -357,7 +357,7 @@ protected: wxTimer* m_refresh_timer{ nullptr }; std::shared_ptr m_print_job; wxScrolledWindow* m_sw_print_failed_info{nullptr}; - wxHyperlinkCtrl* m_hyperlink{nullptr}; + Label* m_connect_printer_help_hyperlink{nullptr}; ScalableBitmap * rename_editable{nullptr}; ScalableBitmap * rename_editable_light{nullptr}; wxStaticBitmap * timeimg{nullptr};