forked from 1b-agent/opencadstudio-upstream
feat(properties): refine quick properties
- Keep the floating panel near the selection and inside the viewport - Persist the toggle and hide the panel without a selection - Show only Material in 3D Visualization
This commit is contained in:
1 parent
5ad95d1d2e
commit
c9550b48f9
9 files changed
+75
-57
No files matched your search
@@ -287,6 +287,7 @@ impl OpenCADStudio {
|
||||
default_save_format: self.default_save_format.clone(),
|
||||
pick_add: self.pick_add,
|
||||
pick_drag_rect: self.pick_drag_rect,
|
||||
quick_properties: self.quick_properties,
|
||||
bg_color: self.default_bg_color.map(f4_to_u3),
|
||||
paper_bg_color: self.default_paper_bg_color.map(f4_to_u3),
|
||||
language: self.language,
|
||||
@@ -325,6 +326,7 @@ impl OpenCADStudio {
|
||||
crate::io::canonical_save_format(&s.default_save_format).to_string();
|
||||
self.pick_add = s.pick_add;
|
||||
self.pick_drag_rect = s.pick_drag_rect;
|
||||
self.quick_properties = s.quick_properties;
|
||||
self.default_bg_color = s.bg_color.map(u3_to_f4);
|
||||
self.default_paper_bg_color = s.paper_bg_color.map(u3_to_f4);
|
||||
if crate::i18n::set_language(s.language).is_ok() {
|
||||
|
||||
@@ -3216,6 +3216,11 @@ impl OpenCADStudio {
|
||||
}
|
||||
Message::ToggleQuickProperties => {
|
||||
self.quick_properties ^= true;
|
||||
if self.quick_properties {
|
||||
self.quick_properties_anchor =
|
||||
self.tabs[self.active_tab].last_cursor_screen;
|
||||
}
|
||||
self.save_config();
|
||||
Task::none()
|
||||
}
|
||||
Message::ToggleSelectionCycling => {
|
||||
@@ -3226,12 +3231,19 @@ impl OpenCADStudio {
|
||||
}
|
||||
Message::CycleSelect(handle) => {
|
||||
// Add the picked object to the current selection (accumulate).
|
||||
let quick_properties_anchor = self
|
||||
.cycle_candidates
|
||||
.as_ref()
|
||||
.map(|(point, _)| *point);
|
||||
self.cycle_candidates = None;
|
||||
let i = self.active_tab;
|
||||
self.tabs[i].scene.set_hover_highlight(None);
|
||||
self.tabs[i].scene.select_entity(handle, false);
|
||||
self.tabs[i].scene.expand_selection_for_groups(&[handle]);
|
||||
self.refresh_properties();
|
||||
if let Some(point) = quick_properties_anchor {
|
||||
self.quick_properties_anchor = point;
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
Message::CycleHover(handle) => {
|
||||
|
||||
@@ -3530,6 +3530,10 @@ impl OpenCADStudio {
|
||||
sel.left_dragging = false;
|
||||
}
|
||||
|
||||
if selection_just_completed {
|
||||
self.quick_properties_anchor = p_full;
|
||||
}
|
||||
|
||||
if is_gathering && selection_just_completed {
|
||||
let handles: Vec<Handle> = self.tabs[i]
|
||||
.scene
|
||||
|
||||
Reference in new issue
Block a user