Skip to content

Commit 6ebddb0

Browse files
committed
fix(Bottom-Sheet): Raise sheet to 85 - 90% height to reduce keyboard overlap and improve interaction in some specific flows
- Set default bottom-sheet height to 90% of the viewport/screen on specific dialog flows (SWAP, SendModal, Bridge..) - Set default bottom-sheet height to 85% of the viewport/screen on specific dropdown flows (StatusLanguageSelector, Chat search...). - Improves virtual keyboard overlap on form and search flows. Closes #19098 Fixes #19064
1 parent 59bb23e commit 6ebddb0

File tree

14 files changed

+51
-4
lines changed

14 files changed

+51
-4
lines changed

ui/StatusQ/src/StatusQ/Components/StatusLanguageSelector.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Button {
116116
relativeX: root.width - width
117117
relativeY: root.height + 2
118118
width: 300
119+
fillHeightOnBottomSheet: true
119120
margins: Theme.halfPadding
120121

121122
padding: 0
@@ -195,6 +196,11 @@ Button {
195196
}
196197
}
197198
}
199+
200+
// Just a filler
201+
Item {
202+
Layout.fillHeight: true
203+
}
198204
}
199205
}
200206

ui/StatusQ/src/StatusQ/Controls/StatusDropdown.qml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,24 @@ QC.Popup {
7272
d.windowHeight > d.windowWidth
7373
&& d.windowWidth <= Theme.portraitBreakpoint.width
7474

75+
/*!
76+
\qmlproperty bool fillHeightOnBottomSheet
77+
This property decides the height of the dialog when `bottomSheet` is active:
78+
* If active: it fills the 90% of the screen viewport.
79+
* If not active: the height is the minimum value between the implicitHeight and the 90% of the screen viewport.
80+
*/
81+
property bool fillHeightOnBottomSheet: false
82+
7583
QtObject {
7684
id: d
7785
readonly property var window: root.contentItem.Window.window
7886
readonly property int windowWidth: window ? window.width: Screen.width
7987
readonly property int windowHeight: window ? window.height: Screen.height
88+
89+
// Set to 85% since some dropdowns are opened as children of Status dialogs.
90+
// Keeping a small gap at the top lets users tap to return to the underlying dialog
91+
// instead of closing the entire flow.
92+
readonly property real bottomSheetHeightRatio: 0.85
8093
}
8194

8295
Binding {
@@ -108,7 +121,7 @@ QC.Popup {
108121
x: 0
109122
y: d.windowHeight - height
110123
width: d.windowWidth
111-
height: Math.min(implicitHeight, d.windowHeight * 0.9)
124+
height: root.fillHeightOnBottomSheet ? d.windowHeight * d.bottomSheetHeightRatio : Math.min(implicitHeight, d.windowHeight * d.bottomSheetHeightRatio)
112125
bottomPadding: !!d.window ? d.window.SafeArea.margins.bottom: 0
113126
margins: 0
114127
}

ui/StatusQ/src/StatusQ/Popups/Dialog/StatusDialog.qml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,22 @@ Dialog {
4545
readonly property real desiredY: root.bottomSheet ? d.windowHeight - root.height
4646
: (root.Overlay.overlay.height - root.height) / 2
4747

48+
/*!
49+
\qmlproperty bool fillHeightOnBottomSheet
50+
This property decides the height of the dialog when `bottomSheet` is active:
51+
* If active: it fills the 90% of the screen viewport.
52+
* If not active: the height is the minimum value between the implicitHeight and the 90% of the screen viewport.
53+
*/
54+
property bool fillHeightOnBottomSheet: false
55+
4856
QtObject {
4957
id: d
5058

5159
// NB: needs to be delayed for the `contentItem` to be not null
5260
property int windowWidth
5361
property int windowHeight
62+
63+
readonly property real bottomSheetHeightRatio: 0.90
5464
}
5565

5666
onAboutToShow: {
@@ -107,7 +117,8 @@ Dialog {
107117
}
108118
Binding on height {
109119
when: root.bottomSheet && !enterTransition.running
110-
value: Math.min(root.implicitHeight, d.windowHeight * 0.9)
120+
value: root.fillHeightOnBottomSheet ? d.windowHeight * d.bottomSheetHeightRatio : Math.min(implicitHeight, d.windowHeight * d.bottomSheetHeightRatio)
121+
111122
}
112123
Binding on y {
113124
when: root.bottomSheet && !enterTransition.running

ui/app/AppLayouts/Communities/popups/InDropdown.qml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ StatusDropdown {
2020

2121
width: 289
2222
padding: 8
23+
fillHeightOnBottomSheet: true
2324

2425
// force keeping within the bounds of the enclosing window
2526
margins: 0
@@ -227,7 +228,7 @@ StatusDropdown {
227228
Layout.fillWidth: true
228229
Layout.minimumHeight: Math.min(d.maxHeightCountNo * d.itemStandardHeight,
229230
contentHeight)
230-
Layout.maximumHeight: Layout.minimumHeight
231+
Layout.fillHeight: true
231232
Layout.bottomMargin: d.defaultVMargin
232233
Layout.topMargin: !root.allowChoosingEntireCommunity
233234
&& !root.allowChoosingEntireCommunity ? d.defaultVMargin : 0
@@ -338,5 +339,6 @@ StatusDropdown {
338339
root.channelsSelected(Array.from(d.selectedChannels.values()))
339340
}
340341
}
341-
}
342+
343+
}
342344
}

ui/app/AppLayouts/Communities/popups/MembersDropdown.qml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ StatusDropdown {
5959
signal addButtonClicked
6060

6161
width: 295
62+
fillHeightOnBottomSheet: true
6263

6364
padding: 11
6465
bottomPadding: padding + bottomInset
@@ -262,5 +263,10 @@ StatusDropdown {
262263

263264
onClicked: root.addButtonClicked()
264265
}
266+
267+
// Just a filler
268+
Item {
269+
Layout.fillHeight: true
270+
}
265271
}
266272
}

ui/app/AppLayouts/Wallet/controls/AssetSelector.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Control {
6060

6161
width: 448
6262
height: Math.min(implicitHeight, d.windowHeight - button.mapToItem(null, 0, button.height).y - d.bottomPadding)
63+
fillHeightOnBottomSheet: true
6364

6465
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
6566
padding: 0

ui/app/AppLayouts/Wallet/controls/AssetSelectorCompact.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Control {
4646
directParent: root
4747
relativeY: root.height + 4
4848
width: root.width
49+
fillHeightOnBottomSheet: true
4950

5051
padding: 0
5152

ui/app/AppLayouts/Wallet/controls/TokenSelector.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Control {
7373
directParent: root
7474
relativeY: parent.height + 4
7575
width: 448
76+
fillHeightOnBottomSheet: true
7677

7778
horizontalPadding: 0
7879
bottomPadding: Theme.halfPadding / 2

ui/app/AppLayouts/Wallet/popups/AddEditSavedAddressPopup.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ StatusModal {
3535
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
3636

3737
width: 477
38+
fillHeightOnBottomSheet: true
3839

3940
headerSettings.title: d.editMode? qsTr("Edit saved address") : qsTr("Add new saved address")
4041
headerSettings.subTitle: d.editMode? d.name : ""

ui/app/AppLayouts/Wallet/popups/simpleSend/SimpleSendModal.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ StatusDialog {
473473
padding: 0
474474
horizontalPadding: Theme.xlPadding
475475
topMargin: margins + accountSelector.height + Theme.padding
476+
fillHeightOnBottomSheet: true
476477

477478
Behavior on height {
478479
id: modalHeightBehavior

0 commit comments

Comments
 (0)