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