Browse Source

qml: ElDialog titlebar click moves focus, hack for android to remove onscreen keyboard

master
Sander van Grieken 3 years ago
parent
commit
f0f320b119
  1. 73
      electrum/gui/qml/components/controls/ElDialog.qml

73
electrum/gui/qml/components/controls/ElDialog.qml

@ -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)
}
}
}

Loading…
Cancel
Save