2023-04-01 21:01:46 +08:00
|
|
|
|
import QtQuick
|
|
|
|
|
import FluentUI
|
|
|
|
|
|
|
|
|
|
FluMenu{
|
|
|
|
|
property string cutText : "剪切"
|
|
|
|
|
property string copyText : "复制"
|
|
|
|
|
property string pasteText : "粘贴"
|
|
|
|
|
property string selectAllText : "全选"
|
|
|
|
|
property var inputItem
|
|
|
|
|
id:menu
|
|
|
|
|
focus: false
|
|
|
|
|
FluMenuItem{
|
|
|
|
|
text: cutText
|
2023-04-05 21:42:12 +08:00
|
|
|
|
visible: inputItem.text !== "" && !inputItem.readOnly
|
2023-04-01 21:01:46 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
inputItem.cut()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FluMenuItem{
|
|
|
|
|
text: copyText
|
|
|
|
|
visible: inputItem.selectedText !== ""
|
|
|
|
|
onClicked: {
|
|
|
|
|
inputItem.copy()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FluMenuItem{
|
|
|
|
|
text: pasteText
|
|
|
|
|
visible: inputItem.canPaste
|
|
|
|
|
onClicked: {
|
|
|
|
|
inputItem.paste()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FluMenuItem{
|
|
|
|
|
text: selectAllText
|
|
|
|
|
visible: inputItem.text !== ""
|
|
|
|
|
onClicked: {
|
|
|
|
|
inputItem.selectAll()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|