qml: add padding to ElDialog for android e2e
This commit is contained in:
@@ -18,6 +18,8 @@ ElDialog {
|
|||||||
property string derivationPath
|
property string derivationPath
|
||||||
property string scriptType
|
property string scriptType
|
||||||
|
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
z: 1 // raise z so it also covers wizard dialog
|
z: 1 // raise z so it also covers wizard dialog
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ ElDialog {
|
|||||||
property InvoiceParser invoiceParser
|
property InvoiceParser invoiceParser
|
||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
property bool commentValid: comment.text.length <= invoiceParser.lnurlData['comment_allowed']
|
property bool commentValid: comment.text.length <= invoiceParser.lnurlData['comment_allowed']
|
||||||
property bool amountValid: amountBtc.textAsSats.satsInt >= parseInt(invoiceParser.lnurlData['min_sendable_sat'])
|
property bool amountValid: amountBtc.textAsSats.satsInt >= parseInt(invoiceParser.lnurlData['min_sendable_sat'])
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ ElDialog {
|
|||||||
x: Math.floor((parent.width - implicitWidth) / 2)
|
x: Math.floor((parent.width - implicitWidth) / 2)
|
||||||
y: Math.floor((parent.height - implicitHeight) / 2)
|
y: Math.floor((parent.height - implicitHeight) / 2)
|
||||||
// anchors.centerIn: parent // this strangely pixelates the spinner
|
// anchors.centerIn: parent // this strangely pixelates the spinner
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
showTimer.start()
|
showTimer.start()
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ ElDialog {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
width: rootLayout.width
|
width: rootLayout.width
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ ElDialog {
|
|||||||
|
|
||||||
property string selectedPubkey
|
property string selectedPubkey
|
||||||
|
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ ElDialog {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ ElDialog {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width * 4/5
|
width: parent.width * 4/5
|
||||||
padding: 0
|
padding: 0
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: rootLayout
|
id: rootLayout
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ ElDialog {
|
|||||||
focus: true
|
focus: true
|
||||||
closePolicy: canCancel ? Popup.CloseOnEscape | Popup.CloseOnPressOutside : Popup.NoAutoClose
|
closePolicy: canCancel ? Popup.CloseOnEscape | Popup.CloseOnPressOutside : Popup.NoAutoClose
|
||||||
allowClose: canCancel
|
allowClose: canCancel
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ ElDialog {
|
|||||||
property bool isLightning: false
|
property bool isLightning: false
|
||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -9,11 +9,16 @@ Dialog {
|
|||||||
property bool allowClose: true
|
property bool allowClose: true
|
||||||
property string iconSource
|
property string iconSource
|
||||||
property bool resizeWithKeyboard: true
|
property bool resizeWithKeyboard: true
|
||||||
|
// inheriting classes can set needsSystemBarPadding this false to disable padding
|
||||||
|
property bool needsSystemBarPadding: true
|
||||||
|
|
||||||
property bool _result: false
|
property bool _result: false
|
||||||
// workaround: remember opened state, to inhibit closed -> closed event
|
// workaround: remember opened state, to inhibit closed -> closed event
|
||||||
property bool _wasOpened: false
|
property bool _wasOpened: false
|
||||||
|
|
||||||
|
// Add bottom padding for Android navigation bar if needed
|
||||||
|
bottomPadding: needsSystemBarPadding ? app.navigationBarHeight : 0
|
||||||
|
|
||||||
// called to finally close dialog after checks by onClosing handler in main.qml
|
// called to finally close dialog after checks by onClosing handler in main.qml
|
||||||
function doClose() {
|
function doClose() {
|
||||||
doReject()
|
doReject()
|
||||||
@@ -65,6 +70,13 @@ Dialog {
|
|||||||
header: ColumnLayout {
|
header: ColumnLayout {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
// Add top padding for status bar on Android when using edge-to-edge
|
||||||
|
Item {
|
||||||
|
visible: needsSystemBarPadding && app.statusBarHeight > 0
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: app.statusBarHeight
|
||||||
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ ElDialog {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
width: rootPane.width
|
width: rootPane.width
|
||||||
|
|
||||||
|
|||||||
@@ -422,7 +422,7 @@ class QEAppController(BaseCrashReporter, QObject):
|
|||||||
return False
|
return False
|
||||||
return bool(systemSdkVersion >= 35)
|
return bool(systemSdkVersion >= 35)
|
||||||
|
|
||||||
@profiler(min_threshold=0.05)
|
@profiler(min_threshold=0.02)
|
||||||
def _getSystemBarHeight(self, bar_type: str) -> int:
|
def _getSystemBarHeight(self, bar_type: str) -> int:
|
||||||
if not self.enforcesEdgeToEdge():
|
if not self.enforcesEdgeToEdge():
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ ElDialog {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
needsSystemBarPadding: false
|
||||||
|
|
||||||
width: rootLayout.width
|
width: rootLayout.width
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user