forked from MeloNX/MeloNX
Aspect Ratio selection menu added
This commit is contained in:
parent
b9d598a459
commit
a8994d8b50
@ -80,10 +80,18 @@ struct EmulationView: View {
|
||||
Image(systemName: pauseEmu ? "pause.circle" : "play.circle")
|
||||
}
|
||||
}
|
||||
|
||||
Menu() {
|
||||
ForEach(AspectRatio.allCases.filter { $0 != ryujijnx.aspectRatio }, id: \.self) { ratio in
|
||||
Button {
|
||||
// ryujijnx.config?.aspectRatio
|
||||
ryujijnx.aspectRatio = nextAspectRatio(current: ryujijnx.aspectRatio)
|
||||
ryujijnx.aspectRatio = ratio
|
||||
} label: {
|
||||
Label {
|
||||
Text(ratio.displayName)
|
||||
} icon: {
|
||||
Image(systemName: "rectangle.expand.vertical")
|
||||
}
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Label {
|
||||
Text(ryujijnx.aspectRatio.displayName)
|
||||
@ -178,17 +186,6 @@ struct EmulationView: View {
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
func nextAspectRatio(current: AspectRatio) -> AspectRatio {
|
||||
let all = AspectRatio.allCases
|
||||
if let index = all.firstIndex(of: current) {
|
||||
let nextIndex = (index + 1) % all.count
|
||||
return all[nextIndex]
|
||||
} else {
|
||||
return .fixed16x9 // Default fallback
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// This is just to stop the sound on macOS when doing a keypress
|
||||
|
Loading…
x
Reference in New Issue
Block a user