Skip to content

Commit

Permalink
qml: ElDialog titlebar click moves focus, hack for android to remove …
Browse files Browse the repository at this point in the history
…onscreen keyboard
  • Loading branch information
accumulator committed Mar 14, 2023
1 parent 1f4cedf commit f0f320b
Showing 1 changed file with 44 additions and 29 deletions.
73 changes: 44 additions & 29 deletions electrum/gui/qml/components/controls/ElDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,57 @@ Dialog {
}
}

header: ColumnLayout {
spacing: 0
header: Item {
implicitWidth: rootLayout.implicitWidth
implicitHeight: rootLayout.implicitHeight

RowLayout {
MouseArea {
anchors.fill: parent
onClicked: {
// hack to allow titlebar click to remove on screen keyboard by
// moving focus to label
titleLabel.forceActiveFocus()
}
}

ColumnLayout {
id: rootLayout
spacing: 0

Image {
visible: iconSource
source: iconSource
Layout.preferredWidth: constants.iconSizeXLarge
Layout.preferredHeight: constants.iconSizeXLarge
Layout.leftMargin: constants.paddingMedium
Layout.topMargin: constants.paddingMedium
Layout.bottomMargin: constants.paddingMedium
RowLayout {
spacing: 0

Image {
visible: iconSource
source: iconSource
Layout.preferredWidth: constants.iconSizeXLarge
Layout.preferredHeight: constants.iconSizeXLarge
Layout.leftMargin: constants.paddingMedium
Layout.topMargin: constants.paddingMedium
Layout.bottomMargin: constants.paddingMedium
}

Label {
id: titleLabel
text: title
elide: Label.ElideRight
Layout.fillWidth: true
leftPadding: constants.paddingXLarge
topPadding: constants.paddingXLarge
bottomPadding: constants.paddingXLarge
rightPadding: constants.paddingXLarge
font.bold: true
font.pixelSize: constants.fontSizeMedium
}
}

Label {
text: title
elide: Label.ElideRight
Rectangle {
Layout.fillWidth: true
leftPadding: constants.paddingXLarge
topPadding: constants.paddingXLarge
bottomPadding: constants.paddingXLarge
rightPadding: constants.paddingXLarge
font.bold: true
font.pixelSize: constants.fontSizeMedium
Layout.leftMargin: constants.paddingXXSmall
Layout.rightMargin: constants.paddingXXSmall
height: 1
color: Qt.rgba(0,0,0,0.5)
}
}

Rectangle {
Layout.fillWidth: true
Layout.leftMargin: constants.paddingXXSmall
Layout.rightMargin: constants.paddingXXSmall
height: 1
color: Qt.rgba(0,0,0,0.5)
}
}

}

0 comments on commit f0f320b

Please sign in to comment.