fix(ui): refine command line and clipboard
- preserve command history colors after reopening - remove collapsed command bar residue and split the unsaved prompt - read system text when the drawing clipboard is empty Refs #467 Refs #468 Refs #470
This commit is contained in:
parent
d1f9055901
commit
9cf0c9f945
14 changed files with 245 additions and 40 deletions
|
|
@ -3585,10 +3585,44 @@ impl OpenCADStudio {
|
|||
// Ctrl+V. The MText editor and (on the web) the TEXT editor read the
|
||||
// system clipboard asynchronously — the only paste path that works
|
||||
// in the browser, where the synchronous clipboard the iced
|
||||
// text_input expects is empty. With no editor open it falls through
|
||||
// to the entity paste command.
|
||||
// text_input expects is empty. With no editor open, drawing objects
|
||||
// take priority and system text is used when that clipboard is empty.
|
||||
Message::PasteShortcut => self.on_paste_shortcut(),
|
||||
|
||||
Message::SystemClipboardPaste(result) => {
|
||||
use super::SystemClipboardText as Text;
|
||||
|
||||
match result {
|
||||
Text::Text(text) => {
|
||||
let flat = text.replace(['\r', '\n'], " ").to_uppercase();
|
||||
self.command_line.input.push_str(&flat);
|
||||
self.command_line.autocomplete_cursor = None;
|
||||
self.focus_cmd_input()
|
||||
}
|
||||
Text::EmptyOrUnsupported => {
|
||||
self.command_line.push_error(
|
||||
crate::tr!("clipboard-no-supported-content").as_ref(),
|
||||
);
|
||||
Task::none()
|
||||
}
|
||||
Text::Unavailable => {
|
||||
self.command_line
|
||||
.push_error(crate::tr!("clipboard-unavailable").as_ref());
|
||||
Task::none()
|
||||
}
|
||||
Text::Occupied => {
|
||||
self.command_line
|
||||
.push_error(crate::tr!("clipboard-occupied").as_ref());
|
||||
Task::none()
|
||||
}
|
||||
Text::ConversionFailed => {
|
||||
self.command_line
|
||||
.push_error(crate::tr!("clipboard-conversion-failed").as_ref());
|
||||
Task::none()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Message::SelectAllShortcut => {
|
||||
let i = self.active_tab;
|
||||
if self.mtext_editor.as_ref().is_some_and(|e| e.show_preview) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue