mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 20:31:27 +00:00
Disable cut/paste action when textedit is disabled
(Too bad that we can't hide these actions)
This commit is contained in:
parent
706bd3e984
commit
eafa9bae12
1 changed files with 17 additions and 5 deletions
|
|
@ -62,19 +62,32 @@ export component TextEditBase inherits Rectangle {
|
|||
Menu {
|
||||
MenuItem {
|
||||
title: @tr("Cut");
|
||||
activated => { text-input.cut(); }
|
||||
enabled: root.enabled;
|
||||
activated => {
|
||||
text-input.cut();
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
title: @tr("Copy");
|
||||
activated => { text-input.copy(); }
|
||||
activated => {
|
||||
text-input.copy();
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
title: @tr("Paste");
|
||||
activated => { text-input.paste(); }
|
||||
enabled: root.enabled;
|
||||
activated => {
|
||||
text-input.paste();
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
title: @tr("Select All");
|
||||
activated => { text-input.select-all(); }
|
||||
activated => {
|
||||
text-input.select-all();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +136,6 @@ export component TextEditBase inherits Rectangle {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
placeholder := Text {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue