fix(StatusQ.Popups): Replace TextEdit to StatusBaseInput for SearchPopup

Closes: https://github.com/status-im/status-desktop/issues/5059
This commit is contained in:
Boris Melnik 2022-03-21 16:50:16 +03:00 committed by Michał Cieślak
parent 8ff0a47be0
commit b86678f726
2 changed files with 11 additions and 3 deletions

View File

@ -51,6 +51,7 @@ Item {
property bool pending: false
property bool leftIcon: true
property bool isIconSelectable: false
property bool showBackground: true
property StatusIconSettings icon: StatusIconSettings {
width: 24
@ -84,13 +85,17 @@ Item {
root.implicitHeight,
minimumHeight) : root.implicitHeight,
maximumHeight) : parent.height
color: Theme.palette.baseColor2
color: root.showBackground ? Theme.palette.baseColor2
: "transparent"
radius: 8
clip: true
border.width: 1
border.color: {
if (!root.showBackground) {
return "transparent"
}
if (!root.valid && root.dirty) {
return Theme.palette.dangerColor1
}

View File

@ -55,7 +55,7 @@ StatusModal {
}
function forceActiveFocus() {
contentItem.searchInput.forceActiveFocus()
contentItem.searchInput.edit.forceActiveFocus()
}
onOpened: {
@ -85,7 +85,8 @@ StatusModal {
icon: "search"
color: Theme.palette.baseColor1
}
TextEdit {
StatusBaseInput {
id: inputText
anchors.left: statusIcon.right
anchors.leftMargin: 15
@ -94,6 +95,8 @@ StatusModal {
anchors.verticalCenter: parent.verticalCenter
focus: true
font.pixelSize: 28
clearable: true
showBackground: false
font.family: Theme.palette.baseFont.name
color: Theme.palette.directColor1
Keys.onPressed: {