fix(StatusBaseInput): ensure input text is selectable with mouse

This also sets the correcrt selection and selected text color.
This commit is contained in:
Pascal Precht 2021-07-23 12:19:21 +02:00 committed by Michał Cieślak
parent 0ffee3f426
commit d6119bb4ab
1 changed files with 76 additions and 74 deletions

View File

@ -68,6 +68,12 @@ Item {
return sensor.containsMouse ? Theme.palette.primaryColor2 : "transparent" return sensor.containsMouse ? Theme.palette.primaryColor2 : "transparent"
} }
MouseArea {
id: sensor
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.IBeamCursor
onClicked: edit.forceActiveFocus()
Flickable { Flickable {
id: flick id: flick
@ -100,6 +106,8 @@ Item {
id: edit id: edit
width: flick.width width: flick.width
selectByMouse: true selectByMouse: true
selectionColor: Theme.palette.primaryColor2
selectedTextColor: color
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
focus: true focus: true
@ -139,15 +147,9 @@ Item {
Theme.palette.directColor6 Theme.palette.directColor6
} }
} }
}
} // Flickable } // Flickable
MouseArea {
id: sensor
hoverEnabled: true
anchors.fill: parent
cursorShape: Qt.IBeamCursor
onClicked: edit.forceActiveFocus()
}
} // Rectangle } // Rectangle
StatusFlatRoundButton { StatusFlatRoundButton {