forked from 1b-agent/opencadstudio-upstream
Merge remote-tracking branch 'origin/main' into merge-test/main-into-constraints
# Conflicts: # src/app/command_driver.rs # src/command.rs # src/ui/ribbon/mod.rs # src/ui/window/options.rs
This commit is contained in:
commit
ad718def3f
124 files changed
+9866
-692
No files matched your search
+42
-6
@@ -162,7 +162,7 @@ pub(super) struct RenderModeChoice(pub acadrust::entities::ViewportRenderMode);
|
||||
|
||||
impl std::fmt::Display for RenderModeChoice {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.write_str(crate::modules::view::visual_style::label_for(self.0))
|
||||
f.write_str(crate::t!(crate::modules::view::visual_style::label_for(self.0)).as_ref())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -974,7 +974,32 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
// A command may drive a typed scalar by mouse (e.g. a
|
||||
// perpendicular distance to a picked object); show that live
|
||||
// value in the box until the user types over it.
|
||||
let live = tab.active_cmd.as_ref().and_then(|c| c.dyn_live_value(w));
|
||||
let live = tab.active_cmd.as_ref().and_then(|c| c.dyn_live_value(w)).or_else(|| {
|
||||
let grip = tab.active_grip.as_ref()?;
|
||||
let action = match grip.mode {
|
||||
crate::scene::pick::grip::GripEditMode::Lengthen => {
|
||||
crate::scene::model::object::GripMenuAction::Lengthen
|
||||
}
|
||||
crate::scene::pick::grip::GripEditMode::Radius => {
|
||||
crate::scene::model::object::GripMenuAction::Radius
|
||||
}
|
||||
crate::scene::pick::grip::GripEditMode::ArcLength => {
|
||||
crate::scene::model::object::GripMenuAction::ArcLength
|
||||
}
|
||||
_ => return None,
|
||||
};
|
||||
let original = self
|
||||
.grip_originals
|
||||
.iter()
|
||||
.find(|(handle, _)| *handle == grip.handle)
|
||||
.map(|(_, entity)| entity)?;
|
||||
crate::scene::view::dispatch::grip_menu_point_value(
|
||||
original,
|
||||
grip.grip_id,
|
||||
action,
|
||||
w,
|
||||
)
|
||||
});
|
||||
let boxes: Vec<crate::ui::overlay::DynBox> = tab
|
||||
.dyn_fields
|
||||
.iter()
|
||||
@@ -1734,17 +1759,28 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
// viewport stack rather than as a separate row in the main
|
||||
// column — frees up vertical space when no command is active
|
||||
// and keeps the input close to where the cursor is drawing.
|
||||
// Autocomplete shows only when no command is collecting its
|
||||
// own input (otherwise typed prefixes are coordinates / values).
|
||||
let allow_autocomplete = tab.active_cmd.is_none();
|
||||
// Autocomplete shows only when no command or grip-menu action is
|
||||
// collecting its own input. A pending Lengthen / Radius / Arc Length
|
||||
// value is numeric input, not the prefix of a new command (for example,
|
||||
// `3` must not open the 3DALIGN / 3DARRAY suggestions).
|
||||
let allow_autocomplete = tab.active_cmd.is_none() && self.grip_pending.is_none();
|
||||
// Dynamic input captures keystrokes when its fields are showing,
|
||||
// so the command-line field must release focus / its on_input.
|
||||
// The MText preview also captures keystrokes (typing edits it), so the
|
||||
// command line must likewise release its on_input there.
|
||||
let interactive_value_grip = tab.active_grip.as_ref().is_some_and(|grip| {
|
||||
matches!(
|
||||
grip.mode,
|
||||
crate::scene::pick::grip::GripEditMode::Lengthen
|
||||
| crate::scene::pick::grip::GripEditMode::Radius
|
||||
| crate::scene::pick::grip::GripEditMode::ArcLength
|
||||
)
|
||||
});
|
||||
let dyn_capturing =
|
||||
(self.dyn_input
|
||||
&& (tab.active_cmd.is_some() || tab.active_grip.is_some())
|
||||
&& !tab.dyn_fields.is_empty())
|
||||
&& !tab.dyn_fields.is_empty()
|
||||
&& !interactive_value_grip)
|
||||
|| self.mtext_editor.as_ref().is_some_and(|e| e.show_preview)
|
||||
|| self.text_inline.is_some();
|
||||
// The workspace row is: left edge stack, viewport, right edge stack.
|
||||
|
||||
+51
-2
@@ -191,8 +191,8 @@ impl OpenCADStudio {
|
||||
}
|
||||
super::super::ModalKind::Options => sized_flow(
|
||||
ex,
|
||||
540,
|
||||
560,
|
||||
880,
|
||||
620,
|
||||
|flow| {
|
||||
crate::ui::window::options::view_window(
|
||||
&self.default_save_format,
|
||||
@@ -209,6 +209,55 @@ impl OpenCADStudio {
|
||||
pick_add: self.pick_add,
|
||||
pick_drag_rect: self.pick_drag_rect,
|
||||
grip_object_limit: self.grip_object_limit,
|
||||
selection_cycling: self.selection_cycling,
|
||||
},
|
||||
crate::ui::window::options::AppPrefs {
|
||||
savetime_min: self.savetime_min,
|
||||
backup_on_save: self.backup_on_save,
|
||||
textfill: crate::scene::text::sdf_atlas::textfill(),
|
||||
cliprompt_lines: self.cliprompt_lines,
|
||||
commandline_fade_ms: self.commandline_fade_ms,
|
||||
zoom_wheel_reversed: self.zoom_wheel_reversed,
|
||||
zoom_factor: self.zoom_factor,
|
||||
texteditmode: self.texteditmode,
|
||||
dimension_continue_mode: self.dimension_continue_mode,
|
||||
qdim_snap_priority: self.quick_dimension_snap_priority,
|
||||
annotation_auto_scale: self.annotation_auto_scale,
|
||||
polar_increment_deg: self.polar_increment_deg,
|
||||
show_viewcube: self.show_viewcube,
|
||||
show_ucs_icon: self.show_ucs_icon,
|
||||
ucs_icon_at_origin: self.ucs_icon_at_origin,
|
||||
},
|
||||
&self.snap_angle_input,
|
||||
{
|
||||
let header = self
|
||||
.tabs
|
||||
.get(self.active_tab)
|
||||
.map(|tab| &tab.scene.document.header);
|
||||
crate::ui::window::options::DrawingPrefs {
|
||||
available: header.is_some(),
|
||||
isolines: header.map_or(4, |h| h.isolines),
|
||||
display_silhouette: header
|
||||
.is_some_and(|h| h.display_silhouette),
|
||||
surface_u: header.map_or(6, |h| h.surface_u_density),
|
||||
surface_v: header.map_or(6, |h| h.surface_v_density),
|
||||
surface_type: header.map_or(6, |h| h.surface_type),
|
||||
record_solid_history: header
|
||||
.is_some_and(|h| h.record_solid_history),
|
||||
show_solid_history: header
|
||||
.map_or(1, |h| h.show_solid_history),
|
||||
}
|
||||
},
|
||||
crate::ui::window::options::Folders {
|
||||
config: crate::config::config_dir()
|
||||
.map(|p| p.display().to_string()),
|
||||
plot_styles: crate::io::plot_style::plot_styles_dir()
|
||||
.ok()
|
||||
.map(|p| p.display().to_string()),
|
||||
plugins: crate::plugin::external::plugins_dir()
|
||||
.map(|p| p.display().to_string()),
|
||||
autosave: crate::config::config_dir()
|
||||
.map(|_| std::env::temp_dir().display().to_string()),
|
||||
},
|
||||
self.double_click_block_refedit,
|
||||
self.double_click_block_attedit,
|
||||
|
||||
Reference in new issue
Block a user