Let a Quick Second Click Reopen a Group List

A press within the double-click time arrives as a double click, which group buttons ignored, so reopening a list right after closing it took another click. Group buttons now toggle on a double click like the bars' other icons, and a double click elsewhere closes an open list like a plain press.
This commit is contained in:
Hanif Koh committed 2026-11-22 11:55:02 +08:00
1 parent 2aeef7a392
commit 9aa9bcfb6b
3 files changed
+8 -12

No files matched your search

+1 -1
View File
@@ -5468,7 +5468,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
Point pos(evt.GetX(), evt.GetY());
// A press anywhere but the open group list or its button closes the list, whichever part of the canvas takes it.
if (evt.LeftDown() || evt.RightDown()) {
if (evt.LeftDown() || evt.LeftDClick() || evt.RightDown()) {
m_gizmos.close_group_list_unless_at(pos.cast<double>());
m_main_toolbar.close_group_list_unless_at(pos.cast<double>(), *this);
}
+6 -8
View File
@@ -662,14 +662,12 @@ bool GLToolbar::on_mouse(wxMouseEvent& evt, GLCanvas3D& parent)
m_mouse_capture.parent = &parent;
processed = true;
if (const int group = group_of_slot(item_id); group >= 0) {
// A double click would reopen what the first click closed.
if (evt.LeftDown()) {
if (group == m_group_popup.open) {
close_group_list();
parent.set_as_dirty();
} else
open_group_list(group, parent);
}
// A double click toggles too: a quick reopen after closing arrives as one.
if (group == m_group_popup.open) {
close_group_list();
parent.set_as_dirty();
} else
open_group_list(group, parent);
}
else if (item_id != -2 && !m_items[item_id]->is_separator() && !m_items[item_id]->is_disabled() &&
(m_pressed_toggable_id == -1 || m_items[item_id]->get_last_action_type() == GLToolbarItem::Left)) {
+1 -3
View File
@@ -920,9 +920,7 @@ bool GLGizmosManager::gizmos_toolbar_on_mouse(const wxMouseEvent &mouse_event) {
if (mouse_event.LeftDown() || mouse_event.LeftDClick()) {
mc.left = true;
if (const int group = group_of_slot(gizmo); group >= 0) {
// A double click would reopen what the first click closed.
if (!mouse_event.LeftDown())
return true;
// A double click toggles too: a quick reopen after closing arrives as one.
if (m_group_popup.open == group)
close_group_list();
else {