|
|
@@ -22,6 +22,96 @@ Rectangle {
|
|
|
signal titleDragMoveTo(real mouseX, real mouseY)
|
|
|
signal titleDragEnd()
|
|
|
|
|
|
+ // 快捷指令弹窗
|
|
|
+ Popup {
|
|
|
+ id: quickCmdPopup
|
|
|
+ width: root.width * 0.5
|
|
|
+ height: root.height * 0.5
|
|
|
+ parent: root
|
|
|
+ x: (root.width - width) / 2
|
|
|
+ y: (root.height - height) / 2
|
|
|
+ modal: true
|
|
|
+ focus: true
|
|
|
+ closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
|
|
+
|
|
|
+ background: Rectangle {
|
|
|
+ color: "white"
|
|
|
+ radius: 12
|
|
|
+ border.color: "#e5e6eb"
|
|
|
+ border.width: 1
|
|
|
+ layer.enabled: true
|
|
|
+ layer.effect: DropShadow {
|
|
|
+ transparentBorder: true
|
|
|
+ horizontalOffset: 0
|
|
|
+ verticalOffset: 4
|
|
|
+ radius: 16
|
|
|
+ samples: 25
|
|
|
+ color: "#20000000"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ColumnLayout {
|
|
|
+ anchors.fill: parent
|
|
|
+ anchors.margins: 12
|
|
|
+ spacing: 8
|
|
|
+
|
|
|
+ Text {
|
|
|
+ text: "快捷指令"
|
|
|
+ font.family: "PingFang SC, Microsoft YaHei UI"
|
|
|
+ font.weight: Font.Bold
|
|
|
+ font.pixelSize: 15
|
|
|
+ color: "#1d2129"
|
|
|
+ Layout.alignment: Qt.AlignHCenter
|
|
|
+ Layout.topMargin: 4
|
|
|
+ }
|
|
|
+
|
|
|
+ ListView {
|
|
|
+ id: listView
|
|
|
+ Layout.fillWidth: true
|
|
|
+ Layout.fillHeight: true
|
|
|
+ clip: true
|
|
|
+ spacing: 4
|
|
|
+ model: displayModel ? displayModel.quickCommands : []
|
|
|
+
|
|
|
+ delegate: ItemDelegate {
|
|
|
+ width: ListView.view.width
|
|
|
+ height: 40
|
|
|
+
|
|
|
+ background: Rectangle {
|
|
|
+ color: parent.pressed ? "#e5e6eb" : (parent.hovered ? "#f2f3f5" : "transparent")
|
|
|
+ radius: 6
|
|
|
+ }
|
|
|
+
|
|
|
+ contentItem: Text {
|
|
|
+ text: modelData.label || ""
|
|
|
+ font.family: "PingFang SC, Microsoft YaHei UI"
|
|
|
+ font.pixelSize: 13
|
|
|
+ color: "#333333"
|
|
|
+ verticalAlignment: Text.AlignVCenter
|
|
|
+ leftPadding: 12
|
|
|
+ }
|
|
|
+
|
|
|
+ onClicked: {
|
|
|
+ if (modelData.text) {
|
|
|
+ root.sendButtonClicked(modelData.text)
|
|
|
+ }
|
|
|
+ quickCmdPopup.close()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 空状态提示
|
|
|
+ Text {
|
|
|
+ anchors.centerIn: parent
|
|
|
+ text: "暂无指令"
|
|
|
+ font.family: "PingFang SC, Microsoft YaHei UI"
|
|
|
+ font.pixelSize: 13
|
|
|
+ color: "#86909c"
|
|
|
+ visible: parent.count === 0
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 主布局
|
|
|
ColumnLayout {
|
|
|
anchors.fill: parent
|
|
|
@@ -319,8 +409,8 @@ Rectangle {
|
|
|
|
|
|
// 输入 + 发送
|
|
|
RowLayout {
|
|
|
- Layout.fillWidth: true
|
|
|
- Layout.minimumWidth: 120
|
|
|
+ Layout.fillWidth: false
|
|
|
+ Layout.preferredWidth: 160
|
|
|
Layout.preferredHeight: 38
|
|
|
spacing: 6
|
|
|
|
|
|
@@ -391,6 +481,33 @@ Rectangle {
|
|
|
onClicked: root.modeButtonClicked()
|
|
|
}
|
|
|
|
|
|
+ // 快捷指令(次要)
|
|
|
+ Button {
|
|
|
+ id: quickCmdBtn
|
|
|
+ Layout.preferredWidth: 200
|
|
|
+ Layout.fillWidth: true
|
|
|
+ Layout.maximumWidth: 300
|
|
|
+ Layout.preferredHeight: 38
|
|
|
+ text: "快捷指令"
|
|
|
+ background: Rectangle {
|
|
|
+ color: quickCmdBtn.pressed ? "#b7eb8f" : (quickCmdBtn.hovered ? "#d9f7be" : "#f6ffed")
|
|
|
+ radius: 8
|
|
|
+ border.color: "#b7eb8f"
|
|
|
+ border.width: 1
|
|
|
+ }
|
|
|
+ contentItem: Text {
|
|
|
+ text: quickCmdBtn.text
|
|
|
+ font.family: "PingFang SC, Microsoft YaHei UI"
|
|
|
+ font.pixelSize: 16
|
|
|
+ font.weight: Font.Bold
|
|
|
+ color: "#389e0d"
|
|
|
+ horizontalAlignment: Text.AlignHCenter
|
|
|
+ verticalAlignment: Text.AlignVCenter
|
|
|
+ elide: Text.ElideRight
|
|
|
+ }
|
|
|
+ onClicked: quickCmdPopup.open()
|
|
|
+ }
|
|
|
+
|
|
|
// 设置(次要)
|
|
|
Button {
|
|
|
id: settingsBtn
|