diff --git a/electrum/gui/qml/components/controls/ElDialog.qml b/electrum/gui/qml/components/controls/ElDialog.qml index ed7865bc1..24f9cee17 100644 --- a/electrum/gui/qml/components/controls/ElDialog.qml +++ b/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) - } } - }