Skip to content

Commit

Permalink
Replace some TextField with .background usage with TextInput, avoidin…
Browse files Browse the repository at this point in the history
…g customisation warnings on macOS
  • Loading branch information
timangus committed Oct 20, 2023
1 parent 8cea7de commit 1a5bf52
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 29 deletions.
35 changes: 21 additions & 14 deletions source/app/ui/qml/AddBookmark.qml
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,32 @@ Rectangle

RowLayout
{
TextField
Item
{
id: nameField
width: 150
Layout.fillHeight: true
Layout.preferredWidth: 192
Layout.margins: Constants.margin
clip: true

selectByMouse: true
TextInput
{
id: nameField

onAccepted: { doneAction.trigger(); }
anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter

background: Rectangle
{
implicitWidth: 192
color: "transparent"
}
selectByMouse: true
color: palette.text
selectionColor: palette.highlight
selectedTextColor: palette.highlightedText

onFocusChanged:
{
if(!focus)
closeAction.trigger();
onAccepted: { doneAction.trigger(); }

onFocusChanged:
{
if(!focus)
closeAction.trigger();
}
}
}

Expand Down
34 changes: 21 additions & 13 deletions source/app/ui/qml/Find.qml
Original file line number Diff line number Diff line change
Expand Up @@ -390,23 +390,31 @@ Rectangle
{
visible: _type === Find.Simple || _type === Find.Advanced

TextField
Item
{
id: findField
width: 150
font.strikeout: root._interrupted
selectByMouse: true

onAccepted: { selectAllAction.trigger(); }
Layout.fillHeight: true
Layout.preferredWidth: 192
Layout.margins: Constants.margin
clip: true

background: Rectangle
TextInput
{
implicitWidth: 192
color: "transparent"
}
id: findField

Keys.onUpPressed: { _previousAction.trigger(); }
Keys.onDownPressed: { _nextAction.trigger(); }
anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter

font.strikeout: root._interrupted
selectByMouse: true
color: palette.text
selectionColor: palette.highlight
selectedTextColor: palette.highlightedText

onAccepted: { selectAllAction.trigger(); }

Keys.onUpPressed: { _previousAction.trigger(); }
Keys.onDownPressed: { _nextAction.trigger(); }
}
}

Item
Expand Down
6 changes: 4 additions & 2 deletions source/app/ui/qml/ManageNamedListDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,17 @@ Window
elide: Text.ElideRight
}

TextField
TextInput
{
id: editField
visible: false
selectByMouse: true
color: palette.text
selectionColor: palette.highlight
selectedTextColor: palette.highlightedText

anchors.fill: label
padding: 0
background: Item {}

onAccepted: { finish(); }

Expand Down

0 comments on commit 1a5bf52

Please sign in to comment.