forked from 1b-agent/opencadstudio-upstream
feat: right-click context menu + CONSTRUCTIONLINE alias
Viewport right-click now shows a proper widget-based context menu: - When a command is active: Cancel / Enter - Otherwise: Repeat last commands, Delete/Move/Copy (if selected), Select All, Zoom Extents CONSTRUCTIONLINE added as an alias for XLINE (XL). Canvas-drawn placeholder removed; context menu closes on Escape, click-outside, or when any action is taken. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
a20558a024
commit
3cdd86a674
7 files changed
+145
-50
No files matched your search
@@ -17,7 +17,7 @@ pub struct CommandLine {
|
||||
pub input: String,
|
||||
pub history: Vec<HistoryEntry>,
|
||||
/// Commands the user has typed (for ↑/↓ recall).
|
||||
cmd_recall: Vec<String>,
|
||||
pub cmd_recall: Vec<String>,
|
||||
/// Current position in `cmd_recall` while navigating (None = not navigating).
|
||||
recall_cursor: Option<usize>,
|
||||
/// Saved draft input before the user started navigating history.
|
||||
|
||||
@@ -385,49 +385,6 @@ impl canvas::Program<Message> for SelectionCanvas {
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(p) = self.selection.context_menu {
|
||||
let w = 140.0;
|
||||
let h = 72.0;
|
||||
let rect = canvas::Path::rectangle(Point::new(p.x, p.y), Size::new(w, h));
|
||||
frame.fill(
|
||||
&rect,
|
||||
Color {
|
||||
r: 0.12,
|
||||
g: 0.12,
|
||||
b: 0.12,
|
||||
a: 0.95,
|
||||
},
|
||||
);
|
||||
frame.stroke(
|
||||
&rect,
|
||||
canvas::Stroke {
|
||||
width: 1.0,
|
||||
style: canvas::Style::Solid(Color {
|
||||
r: 0.30,
|
||||
g: 0.30,
|
||||
b: 0.30,
|
||||
a: 1.0,
|
||||
}),
|
||||
..Default::default()
|
||||
},
|
||||
);
|
||||
let items = ["Open", "Properties", "Hide"];
|
||||
for (i, item) in items.iter().enumerate() {
|
||||
frame.fill_text(canvas::Text {
|
||||
content: item.to_string(),
|
||||
position: Point::new(p.x + 10.0, p.y + 10.0 + i as f32 * 20.0),
|
||||
color: Color::WHITE,
|
||||
size: iced::Pixels(11.0),
|
||||
font: iced::Font::DEFAULT,
|
||||
align_x: iced::alignment::Horizontal::Left.into(),
|
||||
align_y: iced::alignment::Vertical::Top.into(),
|
||||
max_width: f32::INFINITY,
|
||||
line_height: iced::widget::text::LineHeight::default(),
|
||||
shaping: iced::widget::text::Shaping::default(),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// ── Grip markers ──────────────────────────────────────────────────
|
||||
for grip in &self.grips {
|
||||
let sp = grip.pos;
|
||||
|
||||
Reference in new issue
Block a user