forked from 1b-agent/opencadstudio-upstream
style: apply cargo fmt across workspace (as on main)
Formats the branch the way main's 9cf9ff2 did, so merging main only
conflicts where the code itself differs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013RyGiMXcsf9HTKfqDxaQGt
This commit is contained in:
532 files changed
+56995
-33416
No files matched your search
+44
-35
@@ -9,8 +9,8 @@ use crate::t;
|
||||
use crate::ui::wrap_bar::DensitySwap;
|
||||
use crate::ui::wrap_bar::WrapFlow;
|
||||
use iced::widget::{
|
||||
button, column, container, mouse_area, pane_grid, responsive, row, scrollable, shader,
|
||||
stack, text, Row, Space,
|
||||
button, column, container, mouse_area, pane_grid, responsive, row, scrollable, shader, stack,
|
||||
text, Row, Space,
|
||||
};
|
||||
use iced::window;
|
||||
use iced::{keyboard, Background, Border, Color, Element, Fill, Subscription, Task, Theme};
|
||||
@@ -624,7 +624,10 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
let control_polygon = tab.selected_handle.and_then(|handle| {
|
||||
let spline = match tab.scene.document.get_entity(handle) {
|
||||
Some(codec::EntityType::Spline(spline))
|
||||
if crate::entities::spline::shows_control_vertices(spline) => spline,
|
||||
if crate::entities::spline::shows_control_vertices(spline) =>
|
||||
{
|
||||
spline
|
||||
}
|
||||
_ => return None,
|
||||
};
|
||||
if tab
|
||||
@@ -796,7 +799,7 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
&& b.y.is_finite()
|
||||
&& a.x.is_finite()
|
||||
&& a.y.is_finite())
|
||||
.then_some((b, a))
|
||||
.then_some((b, a))
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
@@ -1127,8 +1130,12 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
(None, _) if rectangle_values.is_some() => {
|
||||
let (width, height) = rectangle_values.unwrap();
|
||||
match f.role {
|
||||
crate::command::DynRole::Width => crate::entities::common::format_length(width),
|
||||
crate::command::DynRole::Height => crate::entities::common::format_length(height),
|
||||
crate::command::DynRole::Width => {
|
||||
crate::entities::common::format_length(width)
|
||||
}
|
||||
crate::command::DynRole::Height => {
|
||||
crate::entities::common::format_length(height)
|
||||
}
|
||||
_ => String::new(),
|
||||
}
|
||||
}
|
||||
@@ -1669,8 +1676,10 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
// Count mode: a blue frame round the drawing and the count toolbar.
|
||||
if let (Some(mode), false) = (tab.count.as_ref(), tab.is_start) {
|
||||
viewport_stack = viewport_stack.push(crate::ui::window::count_palette::border());
|
||||
viewport_stack = viewport_stack
|
||||
.push(crate::ui::window::count_palette::toolbar(mode, &tab.scene.document));
|
||||
viewport_stack = viewport_stack.push(crate::ui::window::count_palette::toolbar(
|
||||
mode,
|
||||
&tab.scene.document,
|
||||
));
|
||||
}
|
||||
|
||||
// Reserve the overlaid command line when placing cursor-anchored panels.
|
||||
@@ -2145,18 +2154,18 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
// otherwise an empty slice short-circuits the overlay gate
|
||||
// (`dropdown_overlay` returns `None` for empty labels anyway).
|
||||
let open_dropdown = self.ribbon.open_dropdown.as_deref();
|
||||
let undo_labels: Vec<String> =
|
||||
if open_dropdown == Some(crate::ui::ribbon::UNDO_HISTORY_ID) {
|
||||
history_dropdown_labels(&self.tabs[self.active_tab].history.undo_stack)
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let redo_labels: Vec<String> =
|
||||
if open_dropdown == Some(crate::ui::ribbon::REDO_HISTORY_ID) {
|
||||
history_dropdown_labels(&self.tabs[self.active_tab].history.redo_stack)
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let undo_labels: Vec<String> = if open_dropdown == Some(crate::ui::ribbon::UNDO_HISTORY_ID)
|
||||
{
|
||||
history_dropdown_labels(&self.tabs[self.active_tab].history.undo_stack)
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let redo_labels: Vec<String> = if open_dropdown == Some(crate::ui::ribbon::REDO_HISTORY_ID)
|
||||
{
|
||||
history_dropdown_labels(&self.tabs[self.active_tab].history.redo_stack)
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let gallery_open = open_dropdown == Some(crate::modules::insert::insert_block::GALLERY_ID)
|
||||
&& !self.tabs[self.active_tab].is_start;
|
||||
let dropdown_layer: Element<'_, Message> = if gallery_open {
|
||||
@@ -2167,16 +2176,15 @@ bg={bg_ms:.1}ms n={view_count}"
|
||||
self.win_size.0,
|
||||
)
|
||||
} else {
|
||||
self
|
||||
.ribbon
|
||||
.dropdown_overlay(
|
||||
&undo_labels,
|
||||
&redo_labels,
|
||||
self.win_size,
|
||||
self.tabs[self.active_tab].is_start,
|
||||
&self.recent_colors,
|
||||
)
|
||||
.unwrap_or_else(|| iced::widget::Space::new().width(0).height(0).into())
|
||||
self.ribbon
|
||||
.dropdown_overlay(
|
||||
&undo_labels,
|
||||
&redo_labels,
|
||||
self.win_size,
|
||||
self.tabs[self.active_tab].is_start,
|
||||
&self.recent_colors,
|
||||
)
|
||||
.unwrap_or_else(|| iced::widget::Space::new().width(0).height(0).into())
|
||||
};
|
||||
|
||||
let snap_override_layer: Element<'_, Message> = if let Some(pos) = self.snap_override_popup
|
||||
@@ -2541,10 +2549,9 @@ impl OpenCADStudio {
|
||||
&& modifiers.alt()
|
||||
&& !modifiers.control()
|
||||
&& !modifiers.logo();
|
||||
let shortcut_modifier = (modifiers.control()
|
||||
|| modifiers.alt()
|
||||
|| modifiers.logo())
|
||||
&& !(types_glyph && (altgr || mac_option));
|
||||
let shortcut_modifier =
|
||||
(modifiers.control() || modifiers.alt() || modifiers.logo())
|
||||
&& !(types_glyph && (altgr || mac_option));
|
||||
// Any key that produces a printable glyph types it,
|
||||
// even when its logical key resolves to navigation
|
||||
// (NumLock-on Numpad8 / Numpad2 arrive as
|
||||
@@ -2654,7 +2661,9 @@ impl OpenCADStudio {
|
||||
} else {
|
||||
Subscription::none()
|
||||
},
|
||||
self.spacemouse.subscription().map(|_| Message::SpaceMouseWake),
|
||||
self.spacemouse
|
||||
.subscription()
|
||||
.map(|_| Message::SpaceMouseWake),
|
||||
crate::input::trackpad::subscription().map(Message::TrackpadPinch),
|
||||
event::listen_with(|event, _, id| match event {
|
||||
iced::Event::Window(window::Event::Focused) => {
|
||||
|
||||
Reference in new issue
Block a user