mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +00:00
Fix the overlapping scrollbars on macOS. (#3646)
This commit is contained in:
parent
536f01abbd
commit
b8106f36ba
@ -12,6 +12,10 @@ struct RoomListFiltersView: View {
|
|||||||
@Binding var state: RoomListFiltersState
|
@Binding var state: RoomListFiltersState
|
||||||
@Namespace private var namespace
|
@Namespace private var namespace
|
||||||
|
|
||||||
|
/// When you connect a mouse on macOS the scrollbars aren't hidden. This is some extra padding
|
||||||
|
/// applied to the scroll view content to make sure the bars don't overlap the filters.
|
||||||
|
private var macScrollBarPadding: CGFloat { ProcessInfo.processInfo.isiOSAppOnMac ? 16 : 0 }
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollViewReader { proxy in
|
ScrollViewReader { proxy in
|
||||||
ScrollView(.horizontal) {
|
ScrollView(.horizontal) {
|
||||||
@ -39,11 +43,13 @@ struct RoomListFiltersView: View {
|
|||||||
.matchedGeometryEffect(id: filter.id, in: namespace)
|
.matchedGeometryEffect(id: filter.id, in: namespace)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.padding(.horizontal, 16)
|
||||||
|
.padding(.bottom, macScrollBarPadding)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.scrollIndicators(.hidden)
|
.scrollIndicators(.hidden)
|
||||||
.padding(.leading, 16)
|
|
||||||
.padding(.vertical, 12)
|
.padding(.vertical, 12)
|
||||||
|
.padding(.bottom, -macScrollBarPadding)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user