From 12636b67be026bc7217e0fa9428de47e257bc780 Mon Sep 17 00:00:00 2001 From: fkirill Date: Fri, 30 Oct 2026 13:25:56 +0000 Subject: [PATCH] Select hidden geometry with Select Other and fit the list to the window (#5574) (#5577) * claim: #5574 * Pick hidden geometry near long clicks in a five-row list (#5574) * fix: make Select Other configurable and fit its list to the window --------- Co-authored-by: Kirill Frolov --- .../locales/pending/select-other-hidden.json | 34 +++ crates/ui-egui/src/prefs.rs | 6 + crates/ui-egui/src/prefs/sketch.rs | 2 + crates/ui-egui/src/select_other.rs | 67 ++++-- crates/ui-egui/src/select_other_tests.rs | 217 ++++++++++++++++++ crates/ui-egui/src/viewport.rs | 38 ++- docs/book/src/guide/ui-tour.md | 10 +- docs/control-protocol.md | 3 +- 8 files changed, 345 insertions(+), 32 deletions(-) create mode 100644 assets/locales/pending/select-other-hidden.json diff --git a/assets/locales/pending/select-other-hidden.json b/assets/locales/pending/select-other-hidden.json new file mode 100644 index 000000000..1cded1cf6 --- /dev/null +++ b/assets/locales/pending/select-other-hidden.json @@ -0,0 +1,34 @@ +{ + "en": { + "prefs.select_other_hidden": "Select hidden geometry with Select Other", + "prefs.select_other_hidden_help": "On: include hidden bodies, sketches and occluded edges near the pointer. Off: use the original list of visible geometry under the pointer." + }, + "ar": { + "prefs.select_other_hidden": "تحديد العناصر الهندسية المخفية باستخدام «تحديد عنصر آخر»", + "prefs.select_other_hidden_help": "عند التفعيل: تضمين الأجسام والمخططات المخفية والحواف المحجوبة قرب المؤشر. عند التعطيل: استخدام القائمة الأصلية للعناصر الهندسية المرئية أسفل المؤشر." + }, + "he": { + "prefs.select_other_hidden": "בחירת גאומטריה מוסתרת באמצעות בחירה אחרת", + "prefs.select_other_hidden_help": "מופעל: כולל גופים, סקיצות וקצוות מוסתרים בקרבת הסמן. כבוי: שימוש ברשימה המקורית של גאומטריה גלויה מתחת לסמן." + }, + "ja": { + "prefs.select_other_hidden": "「他を選択」で非表示のジオメトリを選択", + "prefs.select_other_hidden_help": "オン: ポインター付近の非表示のボディやスケッチ、遮られたエッジを含めます。オフ: ポインター直下の表示中のジオメトリだけを元のリストに表示します。" + }, + "vi": { + "prefs.select_other_hidden": "Chọn hình học ẩn bằng Chọn đối tượng khác", + "prefs.select_other_hidden_help": "Bật: bao gồm các khối, bản phác thảo ẩn và cạnh bị che gần con trỏ. Tắt: dùng danh sách ban đầu chỉ gồm hình học đang hiển thị ngay dưới con trỏ." + }, + "zh": { + "prefs.select_other_hidden": "使用“选择其他”选择隐藏几何体", + "prefs.select_other_hidden_help": "开启:包括指针附近的隐藏实体、草图和被遮挡的边。关闭:恢复原来的列表,仅包含指针正下方的可见几何体。" + }, + "de": { + "prefs.select_other_hidden": "Verborgene Geometrie mit „Andere auswählen“ auswählen", + "prefs.select_other_hidden_help": "Ein: Verborgene Körper, Skizzen und verdeckte Kanten nahe dem Zeiger einbeziehen. Aus: Die ursprüngliche Liste sichtbarer Geometrie direkt unter dem Zeiger verwenden." + }, + "ko": { + "prefs.select_other_hidden": "다른 항목 선택으로 숨겨진 형상 선택", + "prefs.select_other_hidden_help": "켜짐: 포인터 근처의 숨겨진 바디, 스케치 및 가려진 모서리를 포함합니다. 꺼짐: 포인터 바로 아래에 보이는 형상만 포함하는 기존 목록을 사용합니다." + } +} diff --git a/crates/ui-egui/src/prefs.rs b/crates/ui-egui/src/prefs.rs index c638c8c6d..819f32897 100644 --- a/crates/ui-egui/src/prefs.rs +++ b/crates/ui-egui/src/prefs.rs @@ -1339,6 +1339,8 @@ preference_settings! { /// release and end there (#7247); clicks still draw a chain. Off (the default): a drag is a /// click that moved on the way, placing a point where it is let go (#2448). line_drag_draws_one: bool = false, PAGE_SKETCH => check_id("prefs.line_drag_draws_one"); + /// Include hidden geometry and a small pointer neighbourhood in Select Other. + select_other_hidden: bool = true, PAGE_SKETCH => check_id("prefs.select_other_hidden"); /// When true: Shift+click adds without removing; Primary toggles. /// When false (default): Shift and Primary both toggle. selection_shift_add_only: bool = false, PAGE_SKETCH; @@ -3493,6 +3495,9 @@ pub fn set(app: &mut SolveApp, p: &serde_json::Value) -> Result