1
0
forked from MeloNX/MeloNX

Aspect Ratio selection menu added

This commit is contained in:
Daniil Vinogradov 2025-07-14 22:19:13 +02:00
parent b9d598a459
commit a8994d8b50

View File

@ -80,10 +80,18 @@ struct EmulationView: View {
Image(systemName: pauseEmu ? "pause.circle" : "play.circle")
}
}
Button {
// ryujijnx.config?.aspectRatio
ryujijnx.aspectRatio = nextAspectRatio(current: ryujijnx.aspectRatio)
Menu() {
ForEach(AspectRatio.allCases.filter { $0 != ryujijnx.aspectRatio }, id: \.self) { ratio in
Button {
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