docs: 添加涉密文件自检工具实施计划
This commit is contained in:
52
UmiOCR-data/qt_res/qml/Widgets/Menu_.qml
Normal file
52
UmiOCR-data/qt_res/qml/Widgets/Menu_.qml
Normal file
@@ -0,0 +1,52 @@
|
||||
// ===========================================
|
||||
// =============== 右键弹出菜单 ===============
|
||||
// ===========================================
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
|
||||
|
||||
Menu {
|
||||
id: mRoot
|
||||
property var menuList: []
|
||||
// [
|
||||
// [func1, "菜单项1"],
|
||||
// [func2, "菜单项2", "noColor"],
|
||||
// ]
|
||||
|
||||
contentItem: Rectangle {
|
||||
id: mRect
|
||||
color: theme.specialBgColor
|
||||
border.width: 1
|
||||
border.color: theme.specialTextColor
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
Repeater {
|
||||
model: menuList
|
||||
Button_ {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
radius: 0
|
||||
height: size_.line + size_.smallSpacing * 2
|
||||
contentItem: Text_ {
|
||||
text: modelData[1]
|
||||
color: modelData.length>2 ? theme[modelData[2]] : theme.textColor
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
Component.onCompleted: {
|
||||
let w = width + size_.spacing * 2
|
||||
if(w > mRoot.width) {
|
||||
mRoot.width = w
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
const func = menuList[index][0]
|
||||
func && func()
|
||||
mRoot.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user