From 01744f1759da4932153223dcaba88fcf6d44ef57 Mon Sep 17 00:00:00 2001 From: tao wang Date: Sat, 19 Nov 2022 14:18:27 +0800 Subject: [PATCH] FIX:fixed users can not click drop-down menu on mac Change-Id: Ib9ac9e323d70f5be32a7d1bd935effba974ef006 --- src/slic3r/GUI/Widgets/SideButton.cpp | 9 ++++++++- src/slic3r/GUI/Widgets/SideMenuPopup.cpp | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Widgets/SideButton.cpp b/src/slic3r/GUI/Widgets/SideButton.cpp index b69a42f2f..48b4df54f 100644 --- a/src/slic3r/GUI/Widgets/SideButton.cpp +++ b/src/slic3r/GUI/Widgets/SideButton.cpp @@ -14,10 +14,17 @@ SideButton::SideButton(wxWindow* parent, wxString text, wxString icon, long stly , state_handler(this) { radius = 12; +#ifdef __APPLE__ + extra_size = wxSize(38 + FromDIP(20), 10); + text_margin = 15 + FromDIP(20); +#else extra_size = wxSize(38, 10); + text_margin = 15; +#endif + icon_offset = 0; text_orientation = HO_Left; - text_margin = 15; + border_color.append(0x6B6B6B, StateColor::Disabled); diff --git a/src/slic3r/GUI/Widgets/SideMenuPopup.cpp b/src/slic3r/GUI/Widgets/SideMenuPopup.cpp index 466b48f9e..0b6b22b38 100644 --- a/src/slic3r/GUI/Widgets/SideMenuPopup.cpp +++ b/src/slic3r/GUI/Widgets/SideMenuPopup.cpp @@ -50,6 +50,11 @@ void SidePopup::Popup(wxWindow* focus) } if (focus) { wxPoint pos = focus->ClientToScreen(wxPoint(0, -6)); + +#ifdef __APPLE__ + pos.x = pos.x - FromDIP(20); +#endif // __APPLE__ + if (pos.x + max_width > screenwidth) Position({pos.x - (pos.x + max_width - screenwidth),pos.y}, {0, focus->GetSize().y + 12}); else