FIX: slice btn can't click in ubuntu

jira: NONE

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I8566dcba151d02df56097dd5add08e45a876a9e8
This commit is contained in:
xun.zhang 2025-03-29 15:07:18 +08:00 committed by lane.wei
parent 55f79b2737
commit a210dbdf2e
1 changed files with 8 additions and 1 deletions

View File

@ -1635,6 +1635,8 @@ wxBoxSizer* MainFrame::create_side_tools()
m_filament_group_popup->tryPopup(m_plater, curr_plate, m_slice_select == eSliceAll); m_filament_group_popup->tryPopup(m_plater, curr_plate, m_slice_select == eSliceAll);
}; };
#ifndef __linux__
// in linux plateform, the pop up will taker over the mouse event and make the slice button cannot handle click event
// this pannel is used to trigger hover when button is disabled // this pannel is used to trigger hover when button is disabled
slice_panel->Bind(wxEVT_ENTER_WINDOW, [this,try_hover_pop_up](auto& event) { slice_panel->Bind(wxEVT_ENTER_WINDOW, [this,try_hover_pop_up](auto& event) {
if(!m_slice_option_pop_up || !m_slice_option_pop_up->IsShown()) if(!m_slice_option_pop_up || !m_slice_option_pop_up->IsShown())
@ -1653,6 +1655,7 @@ wxBoxSizer* MainFrame::create_side_tools()
m_slice_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) { m_slice_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) {
m_filament_group_popup->tryClose(); m_filament_group_popup->tryClose();
}); });
#endif
m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
{ {
@ -1667,7 +1670,11 @@ wxBoxSizer* MainFrame::create_side_tools()
bool slice = true; bool slice = true;
auto curr_plate = m_plater->get_partplate_list().get_curr_plate(); auto curr_plate = m_plater->get_partplate_list().get_curr_plate();
slice = try_pop_up_before_slice(m_slice_select == eSliceAll, m_plater, curr_plate); #ifdef __linux__
slice = try_pop_up_before_slice(m_slice_select == eSliceAll, m_plater, curr_plate, true);
#else
slice = try_pop_up_before_slice(m_slice_select == eSliceAll, m_plater, curr_plate, false);
#endif
if (slice) { if (slice) {
std::string printer_model = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_string("printer_model"); std::string printer_model = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_string("printer_model");