fix: TextField rightItem 属性不存在导致插件加载失败
QtQuick.Controls TextField 无 rightItem 属性(DTK 专有), 清除按钮从 TextField 内部移到外部 RowLayout 中
This commit is contained in:
@@ -161,25 +161,26 @@ Window {
|
|||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
text: root.searchText
|
text: root.searchText
|
||||||
onTextChanged: root.searchText = text
|
onTextChanged: root.searchText = text
|
||||||
// 清除按钮:有输入时显示 ×,点击清空搜索
|
}
|
||||||
rightItem: Rectangle {
|
|
||||||
visible: root.searchText.length > 0
|
// 清除按钮:有输入时显示 ×,点击清空搜索
|
||||||
width: 20; height: 20
|
Rectangle {
|
||||||
radius: 10
|
visible: root.searchText.length > 0
|
||||||
color: clearSearchMouse.containsMouse ? theme.hoverBg : "transparent"
|
width: 20; height: 20
|
||||||
Text {
|
radius: 10
|
||||||
anchors.centerIn: parent
|
color: clearSearchMouse.containsMouse ? theme.hoverBg : "transparent"
|
||||||
text: "×"
|
Text {
|
||||||
font.pixelSize: 14
|
anchors.centerIn: parent
|
||||||
color: clearSearchMouse.containsMouse ? root.accentColor : theme.textTertiary
|
text: "×"
|
||||||
}
|
font.pixelSize: 14
|
||||||
MouseArea {
|
color: clearSearchMouse.containsMouse ? root.accentColor : theme.textTertiary
|
||||||
id: clearSearchMouse
|
}
|
||||||
anchors.fill: parent
|
MouseArea {
|
||||||
hoverEnabled: true
|
id: clearSearchMouse
|
||||||
cursorShape: Qt.PointingHandCursor
|
anchors.fill: parent
|
||||||
onClicked: root.searchText = ""
|
hoverEnabled: true
|
||||||
}
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: root.searchText = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user