Fix account selector on iPad

This commit is contained in:
Thomas Ricouard 2023-01-16 22:01:04 +01:00
parent 451cc7a4ac
commit c21272f641
6 changed files with 8 additions and 8 deletions

View file

@ -23,7 +23,7 @@ struct SideBarView<Content: View>: View {
accountCreationEnabled: false, accountCreationEnabled: false,
avatarSize: .status) avatarSize: .status)
} }
.frame(width: 70, height: 60) .frame(width: 80, height: 60)
.background(selectedTab == .profile ? theme.secondaryBackgroundColor : .clear) .background(selectedTab == .profile ? theme.secondaryBackgroundColor : .clear)
ForEach(tabs) { tab in ForEach(tabs) { tab in
Button { Button {
@ -41,12 +41,12 @@ struct SideBarView<Content: View>: View {
.frame(width: 24, height: 24) .frame(width: 24, height: 24)
.foregroundColor(tab == selectedTab ? theme.tintColor : .gray) .foregroundColor(tab == selectedTab ? theme.tintColor : .gray)
} }
.frame(width: 70, height: 50) .frame(width: 80, height: 50)
.background(tab == selectedTab ? theme.secondaryBackgroundColor : .clear) .background(tab == selectedTab ? theme.secondaryBackgroundColor : .clear)
} }
Spacer() Spacer()
} }
.frame(width: 70) .frame(width: 80)
.background(.clear) .background(.clear)
Divider() Divider()
.edgesIgnoringSafeArea(.top) .edgesIgnoringSafeArea(.top)

View file

@ -22,7 +22,7 @@ struct ExploreTab: View {
.toolbar { .toolbar {
statusEditorToolbarItem(routeurPath: routeurPath, statusEditorToolbarItem(routeurPath: routeurPath,
visibility: preferences.serverPreferences?.postVisibility ?? .pub) visibility: preferences.serverPreferences?.postVisibility ?? .pub)
if !ProcessInfo.processInfo.isiOSAppOnMac { if UIDevice.current.userInterfaceIdiom != .pad {
ToolbarItem(placement: .navigationBarLeading) { ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routeurPath: routeurPath) AppAccountsSelectorView(routeurPath: routeurPath)
} }

View file

@ -21,7 +21,7 @@ struct MessagesTab: View {
.withAppRouteur() .withAppRouteur()
.withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet) .withSheetDestinations(sheetDestinations: $routeurPath.presentedSheet)
.toolbar { .toolbar {
if !ProcessInfo.processInfo.isiOSAppOnMac { if UIDevice.current.userInterfaceIdiom != .pad {
ToolbarItem(placement: .navigationBarLeading) { ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routeurPath: routeurPath) AppAccountsSelectorView(routeurPath: routeurPath)
} }

View file

@ -21,7 +21,7 @@ struct NotificationsTab: View {
.toolbar { .toolbar {
statusEditorToolbarItem(routeurPath: routeurPath, statusEditorToolbarItem(routeurPath: routeurPath,
visibility: userPreferences.serverPreferences?.postVisibility ?? .pub) visibility: userPreferences.serverPreferences?.postVisibility ?? .pub)
if !ProcessInfo.processInfo.isiOSAppOnMac { if UIDevice.current.userInterfaceIdiom != .pad {
ToolbarItem(placement: .navigationBarLeading) { ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routeurPath: routeurPath) AppAccountsSelectorView(routeurPath: routeurPath)
} }

View file

@ -138,7 +138,7 @@ struct TimelineTab: View {
} }
} }
if client.isAuth { if client.isAuth {
if !ProcessInfo.processInfo.isiOSAppOnMac { if UIDevice.current.userInterfaceIdiom != .pad {
ToolbarItem(placement: .navigationBarLeading) { ToolbarItem(placement: .navigationBarLeading) {
AppAccountsSelectorView(routeurPath: routeurPath) AppAccountsSelectorView(routeurPath: routeurPath)
} }

View file

@ -23,7 +23,7 @@ public struct AppAccountsSelectorView: View {
public var body: some View { public var body: some View {
Group { Group {
if ProcessInfo.processInfo.isiOSAppOnMac { if UIDevice.current.userInterfaceIdiom == .pad {
labelView labelView
.contextMenu { .contextMenu {
menuView menuView