forked from 1b-agent/opencadstudio-upstream
feat(statusbar): quick properties floating panel (QP pill)
When the QP pill is on, a compact floating panel appears at the canvas top-left on selection, reusing the docked panel's editable section rows. Toggleable from the status-bar customization menu. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
66f7d24bc9
commit
834780ec5d
6 files changed
+72
No files matched your search
@@ -179,6 +179,8 @@ pub(super) struct OpenCADStudio {
|
||||
isolate_popup_open: bool,
|
||||
/// Clean-screen mode: hide ribbon and side panels for a full canvas.
|
||||
clean_screen: bool,
|
||||
/// Quick Properties: show a compact floating property panel on selection.
|
||||
quick_properties: bool,
|
||||
/// Which status-bar pills the user has chosen to show (persisted).
|
||||
statusbar_config: crate::ui::statusbar_config::StatusBarConfig,
|
||||
/// Whether Tangent snap was enabled before a tangent-pick command started.
|
||||
@@ -752,6 +754,8 @@ pub enum Message {
|
||||
ToggleCleanScreen,
|
||||
/// Toggle whether entity transparency is shown on screen.
|
||||
ToggleTransparencyDisplay,
|
||||
/// Toggle the Quick Properties floating panel.
|
||||
ToggleQuickProperties,
|
||||
/// Toggle the drawing-units picker open/closed.
|
||||
ToggleUnitsPopup,
|
||||
/// Close the drawing-units picker.
|
||||
@@ -1223,6 +1227,7 @@ impl OpenCADStudio {
|
||||
isolate_popup_open: false,
|
||||
statusbar_config: crate::ui::statusbar_config::StatusBarConfig::load(),
|
||||
clean_screen: false,
|
||||
quick_properties: false,
|
||||
pre_cmd_tangent: None,
|
||||
ortho_mode: false,
|
||||
polar_mode: false,
|
||||
|
||||
@@ -3590,6 +3590,10 @@ impl OpenCADStudio {
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
Message::ToggleQuickProperties => {
|
||||
self.quick_properties ^= true;
|
||||
Task::none()
|
||||
}
|
||||
Message::ToggleUnitsPopup => {
|
||||
self.units_popup_open ^= true;
|
||||
Task::none()
|
||||
|
||||
@@ -1005,6 +1005,15 @@ impl OpenCADStudio {
|
||||
}
|
||||
}
|
||||
|
||||
// Quick Properties: compact floating property panel on selection,
|
||||
// anchored at the canvas top-left so it doesn't track the cursor.
|
||||
if self.quick_properties && !tab.is_start {
|
||||
if let Some(panel) = tab.properties.quick_view() {
|
||||
viewport_stack = viewport_stack
|
||||
.push(position_canvas_overlay(iced::Point::new(12.0, 12.0), panel));
|
||||
}
|
||||
}
|
||||
|
||||
// Right-click context menu. Lives inside the viewport stack so
|
||||
// the cursor position (canvas-relative) anchors the menu under
|
||||
// the cursor instead of drifting into window-relative space.
|
||||
@@ -1163,6 +1172,7 @@ impl OpenCADStudio {
|
||||
self.units_popup_open,
|
||||
tab.scene.is_isolation_active(),
|
||||
tab.scene.transparency_display,
|
||||
self.quick_properties,
|
||||
&self.statusbar_config,
|
||||
)
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user