mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-29 02:40:33 -07:00
ENH: enable pop up when slice btn is disabled
1. Enable hover and pop up even if slice btn is disabled. Always trigger background process schedule jira: NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: Ie9c63c952eeb0f8a7611dd9929e656360609d11a (cherry picked from commit 9340b4f89e3bd33f4f6d826118e90babe0ca694c)
This commit is contained in:
parent
f8cd89fdee
commit
74cf5b424a
2 changed files with 50 additions and 30 deletions
|
|
@ -281,11 +281,12 @@ void FilamentGroupPopup::OnRadioBtn(int idx)
|
|||
{
|
||||
if (mode_list.at(idx) == FilamentMapMode::fmmAutoForMatch && !m_connected)
|
||||
return;
|
||||
m_mode = mode_list.at(idx);
|
||||
|
||||
SetFilamentMapMode(m_mode);
|
||||
|
||||
UpdateButtonStatus(m_mode);
|
||||
if (m_mode != mode_list.at(idx)) {
|
||||
m_mode = mode_list.at(idx);
|
||||
SetFilamentMapMode(m_mode);
|
||||
plater_ref->schedule_background_process();
|
||||
UpdateButtonStatus(m_mode);
|
||||
}
|
||||
}
|
||||
|
||||
void FilamentGroupPopup::OnTimer(wxTimerEvent &event) { Dismiss(); }
|
||||
|
|
|
|||
|
|
@ -1560,11 +1560,23 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||
m_slice_select = eSlicePlate;
|
||||
m_print_select = ePrintPlate;
|
||||
|
||||
// m_publish_btn = new Button(this, _L("Upload"), "bar_publish", 0, FromDIP(16));
|
||||
m_slice_btn = new SideButton(this, _L("Slice plate"), "");
|
||||
m_slice_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, 14);
|
||||
m_print_btn = new SideButton(this, _L("Print plate"), "");
|
||||
m_print_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, 14);
|
||||
auto slice_panel = new wxPanel(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTRANSPARENT_WINDOW);
|
||||
auto print_panel = new wxPanel(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxTRANSPARENT_WINDOW);
|
||||
|
||||
m_slice_btn = new SideButton(slice_panel, _L("Slice plate"), "");
|
||||
m_slice_option_btn = new SideButton(slice_panel, "", "sidebutton_dropdown", 0, 14);
|
||||
m_print_btn = new SideButton(print_panel, _L("Print plate"), "");
|
||||
m_print_option_btn = new SideButton(print_panel, "", "sidebutton_dropdown", 0, 14);
|
||||
|
||||
auto slice_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
slice_sizer->Add(m_slice_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
slice_sizer->Add(m_slice_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
slice_panel->SetSizer(slice_sizer);
|
||||
|
||||
auto print_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
print_sizer->Add(m_print_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
print_sizer->Add(m_print_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
print_panel->SetSizer(print_sizer);
|
||||
|
||||
update_side_button_style();
|
||||
// m_publish_btn->Hide();
|
||||
|
|
@ -1572,15 +1584,38 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||
m_print_option_btn->Enable();
|
||||
// sizer->Add(m_publish_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
|
||||
// sizer->Add(FromDIP(15), 0, 0, 0, 0);
|
||||
sizer->Add(m_slice_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(2));
|
||||
sizer->Add(m_slice_btn , 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(15));
|
||||
sizer->Add(m_print_option_btn, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(2));
|
||||
sizer->Add(m_print_btn , 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(19));
|
||||
sizer->Add(slice_panel);
|
||||
sizer->Add(print_panel);
|
||||
|
||||
sizer->Layout();
|
||||
|
||||
m_filament_group_popup = new FilamentGroupPopup(m_slice_btn);
|
||||
|
||||
auto try_hover_pop_up = [this]() {
|
||||
wxPoint pos = m_slice_btn->ClientToScreen(wxPoint(0, 0));
|
||||
pos.y += m_slice_btn->GetRect().height * 1.25;
|
||||
pos.x -= (m_slice_option_btn->GetRect().width + FromDIP(380) * 0.6);
|
||||
auto curr_plate = this->m_plater->get_partplate_list().get_curr_plate();
|
||||
m_filament_group_popup->SetPosition(pos);
|
||||
m_filament_group_popup->tryPopup(m_plater, curr_plate, m_slice_select == eSliceAll);
|
||||
};
|
||||
|
||||
slice_panel->Bind(wxEVT_ENTER_WINDOW, [this,try_hover_pop_up](auto& event) {
|
||||
try_hover_pop_up();
|
||||
});
|
||||
|
||||
slice_panel->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) {
|
||||
m_filament_group_popup->tryClose();
|
||||
});
|
||||
|
||||
m_slice_btn->Bind(wxEVT_ENTER_WINDOW, [this,try_hover_pop_up](auto& event) {
|
||||
try_hover_pop_up();
|
||||
});
|
||||
|
||||
m_slice_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) {
|
||||
m_filament_group_popup->tryClose();
|
||||
});
|
||||
|
||||
m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
||||
{
|
||||
m_plater->reset_check_status();
|
||||
|
|
@ -1605,22 +1640,6 @@ wxBoxSizer* MainFrame::create_side_tools()
|
|||
}
|
||||
});
|
||||
|
||||
m_slice_btn->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent& event) {
|
||||
wxPoint pos = m_slice_btn->ClientToScreen(wxPoint(0, 0));
|
||||
pos.y += m_slice_btn->GetRect().height * 1.25;
|
||||
pos.x -= (m_slice_option_btn->GetRect().width + FromDIP(380) * 0.6);
|
||||
|
||||
auto curr_plate=this->m_plater->get_partplate_list().get_curr_plate();
|
||||
|
||||
m_filament_group_popup->SetPosition(pos);
|
||||
m_filament_group_popup->tryPopup(m_plater,curr_plate, m_slice_select == eSliceAll);
|
||||
});
|
||||
|
||||
m_slice_btn->Bind(wxEVT_LEAVE_WINDOW, [this](auto& event) {
|
||||
m_filament_group_popup->tryClose();
|
||||
});
|
||||
|
||||
|
||||
m_print_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
|
||||
{
|
||||
//this->m_plater->select_view_3D("Preview");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue