mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-18 22:42:37 +00:00
Design: clicking empty space lets go of the selection, and the status line follows its tab
Two things a click on nothing should already have done. snaporca-od0. A click that hit no geometry left the solid selection standing. A rubber band swept over empty space has always cleared it (pick_bodies_in_rectangle), and the two gestures cannot disagree about the same outcome. The visible cost was in the escalation that landed last commit: "click the face, click away, click the face again" arrived as the SECOND click on the same face and took the whole body, when the click away was the user letting go of it. Now the miss clears and says so. This gives up something real, deliberately: Thicken / Shell / Draft hold their input face in the panel's selection, so a stray click on empty canvas with one of those cards open hands that face back. Their handlers already write the "(pick a solid face)" placeholder and rebuild the ghost when the selection empties, so the card SAYS it lost the pick rather than confirming against a face the viewport has stopped highlighting. An orbit drag never reaches this branch — it exits at the 8px budget — so panning the view still does not deselect. snaporca-dlj. The status line is a wxPopupWindow, which is a TOP-LEVEL window: hiding the Design page does not hide it. Select a face, switch to Prepare, and the chip was still there reading "selected (whole body) — right-click for what applies to it" on a tab with no such selection and no such menu. Same cause, second symptom: a status update arriving while the page is hidden anchored against a client size that is not the size the page will have, and parked the chip on the tab bar. So: an IsShownOnScreen guard in place_status_hud, show_status_hud(bool) to take it down and bring it back with its text intact, driven from the page-changed handler. Verified on both rigs, not by reasoning about it: face 5 selected -> click bed -> "Nothing selected", tint gone -> click the same face -> face 5 again, NOT the body -> click it again with no click away -> whole body, so snaporca-gem is intact. Prepare -> chip gone; back to Design -> chip returns. KEYTRACE across the round trip shows shift+S then R still reaching the canvas (ui_mode 0 -> 1, Rectangle armed), which is the focus theft this popup replaced a wxFrame to avoid. Fork parity unchanged: DesignPanel.cpp 30, DesignCanvas.cpp 16, headers and DesignSketchTool.cpp 0. MainFrame.cpp is outside that set and was edited per fork.
This commit is contained in:
@@ -5694,8 +5694,20 @@ wxString DesignPanel::idle_hint() const
|
||||
: _L("No solid yet — select a sketch and right-click it to Extrude.");
|
||||
}
|
||||
|
||||
// The Design tab is no longer the visible page (snaporca-dlj). The status line is a popup floating
|
||||
// over the GL canvas, so it does NOT go away when this page does — it stayed up over Prepare and
|
||||
// over the home screen, still reading like a live Design selection ("selected (whole body) —
|
||||
// right-click for what applies to it") on a tab that has no such selection and no such menu.
|
||||
// Nothing else in the panel needs to know: the popup keeps its text and comes straight back.
|
||||
void DesignPanel::on_tab_hidden()
|
||||
{
|
||||
if (m_viewport) m_viewport->show_status_hud(false);
|
||||
}
|
||||
|
||||
void DesignPanel::on_tab_shown()
|
||||
{
|
||||
if (m_viewport) m_viewport->show_status_hud(true); // ...and back on the way in
|
||||
|
||||
if (m_active == Tool::None && m_doc.display_mesh.its.indices.empty())
|
||||
set_status(idle_hint()); // first paint: the tab has never been edited
|
||||
|
||||
|
||||
Reference in New Issue
Block a user