mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Give search breadcrumbs a consistent row height
Query and room breadcrumbs reserved slightly different heights, and rooms without a description collapsed further. Both now reserve the space of a title and subtitle so every row lines up.
This commit is contained in:
@@ -307,6 +307,9 @@ private struct SearchScreenRoomCell: View {
|
|||||||
HStack(spacing: 16) {
|
HStack(spacing: 16) {
|
||||||
avatar
|
avatar
|
||||||
|
|
||||||
|
ZStack(alignment: .leading) {
|
||||||
|
SearchScreenRowHeightPlaceholder()
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 2) {
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
Text(room.title)
|
Text(room.title)
|
||||||
.font(.compound.bodyLGSemibold)
|
.font(.compound.bodyLGSemibold)
|
||||||
@@ -320,6 +323,7 @@ private struct SearchScreenRoomCell: View {
|
|||||||
.lineLimit(1)
|
.lineLimit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
|
||||||
if let onRemove {
|
if let onRemove {
|
||||||
@@ -391,9 +395,7 @@ private struct SearchScreenQueryCell: View {
|
|||||||
.accessibilityHidden(true)
|
.accessibilityHidden(true)
|
||||||
|
|
||||||
ZStack(alignment: .leading) {
|
ZStack(alignment: .leading) {
|
||||||
// Hidden text with 2 lines to match the height of the room rows, scaling with dynamic text.
|
SearchScreenRowHeightPlaceholder()
|
||||||
Text(verbatim: " \n ")
|
|
||||||
.font(.compound.bodyLG)
|
|
||||||
|
|
||||||
Text(query)
|
Text(query)
|
||||||
.font(.compound.bodyLG)
|
.font(.compound.bodyLG)
|
||||||
@@ -414,6 +416,20 @@ private struct SearchScreenQueryCell: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Reserves the height of a title and subtitle so every row matches, scaling with dynamic type.
|
||||||
|
private struct SearchScreenRowHeightPlaceholder: View {
|
||||||
|
var body: some View {
|
||||||
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
|
Text(verbatim: " ")
|
||||||
|
.font(.compound.bodyLGSemibold)
|
||||||
|
Text(verbatim: " ")
|
||||||
|
.font(.compound.bodyMD)
|
||||||
|
}
|
||||||
|
.hidden()
|
||||||
|
.accessibilityHidden(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private struct SearchScreenRemoveBreadcrumbButton: View {
|
private struct SearchScreenRemoveBreadcrumbButton: View {
|
||||||
let action: () -> Void
|
let action: () -> Void
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:8c8463b5471ab15009f661652b237cc61f540eea5c4c7d51d26e462487b52892
|
oid sha256:ea160bb2a3ace2dbb6aeed3ba459842e49acb335fb71bc4c873f9bf9f2741e01
|
||||||
size 109550
|
size 109546
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:768478153a8dfe9d455fbb87269e79c3698c56cc3515ccb4b8c610ec91f204e6
|
oid sha256:e7ac0977610703092a01b08c59e788a39044bf353906c59a67649e91d0e93485
|
||||||
size 112054
|
size 112055
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:34c519522df41c5b63319d85a14bea386321922e5e208988d258f2df07ad7578
|
oid sha256:c312336759e9ed1f5bc8b4863fa972d17f53f484b56755da6e3d90860e78051e
|
||||||
size 63101
|
size 63062
|
||||||
|
|||||||
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:cdc345436b48af82e9543daffc720db8d1c91bb10caf16e490eef4eecf2a4af5
|
oid sha256:3a32b41165b5e09a15a2e606e21690812a3a0c4bebc1564c05e44a200214c6bc
|
||||||
size 67108
|
size 67114
|
||||||
|
|||||||
Reference in New Issue
Block a user