diff --git a/src/MeloNX/MeloNX/App/Views/Main/UI/GamesList/GameListView.swift b/src/MeloNX/MeloNX/App/Views/Main/UI/GamesList/GameListView.swift index 14d55b1cc..13775beaa 100644 --- a/src/MeloNX/MeloNX/App/Views/Main/UI/GamesList/GameListView.swift +++ b/src/MeloNX/MeloNX/App/Views/Main/UI/GamesList/GameListView.swift @@ -238,7 +238,7 @@ struct GameLibraryView: View { private var gameListView: some View { ScrollView { - LazyVStack(spacing: 0) { + LazyVStack(alignment: .leading, spacing: 0) { if !isSearching && !realRecentGames.isEmpty { // Recent Games Section VStack(alignment: .leading, spacing: 0) { @@ -278,44 +278,27 @@ struct GameLibraryView: View { .foregroundColor(.primary) .padding(.horizontal) .padding(.top) - - ForEach(filteredGames) { game in - GameListRow( - game: game, - startemu: $startemu, - games: games, - isViewingGameInfo: $isViewingGameInfo, - isSelectingGameUpdate: $isSelectingGameUpdate, - isSelectingGameDLC: $isSelectingGameDLC, - gameRequirements: $gameRequirements, - gameInfo: $gameInfo, - isShowingGameController: $gameController, - perGameSettings: $gamePerGameSettings - ) - .padding(.horizontal) - .padding(.vertical, 8) - } } } - } else { - ForEach(filteredGames) { game in - GameListRow( - game: game, - startemu: $startemu, - games: games, - isViewingGameInfo: $isViewingGameInfo, - isSelectingGameUpdate: $isSelectingGameUpdate, - isSelectingGameDLC: $isSelectingGameDLC, - gameRequirements: $gameRequirements, - gameInfo: $gameInfo, - isShowingGameController: $gameController, - perGameSettings: $gamePerGameSettings - ) - .padding(.horizontal) - .padding(.vertical, 8) - } } - + + ForEach(filteredGames) { game in + GameListRow( + game: game, + startemu: $startemu, + games: games, + isViewingGameInfo: $isViewingGameInfo, + isSelectingGameUpdate: $isSelectingGameUpdate, + isSelectingGameDLC: $isSelectingGameDLC, + gameRequirements: $gameRequirements, + gameInfo: $gameInfo, + isShowingGameController: $gameController, + perGameSettings: $gamePerGameSettings + ) + .padding(.horizontal) + .padding(.vertical, 8) + } + Spacer(minLength: 50) } } @@ -891,19 +874,9 @@ struct GameListRow: View { } Spacer() - - if $settingsManager.config.wrappedValue.contains(where: { $0.key == game.titleId }) { - Image(systemName: "gearshape.circle") - .resizable() - .aspectRatio(contentMode: .fill) - .foregroundStyle(.blue) - .frame(width: 20, height: 20) - } - - VStack(alignment: .leading) { + VStack(alignment: .trailing) { // Compatibility badges - HStack { if let gameReq = gameRequirements.first(where: { $0.game_id == game.titleId }) { let totalMemory = ProcessInfo.processInfo.physicalMemory @@ -937,6 +910,15 @@ struct GameListRow: View { .layoutPriority(1) } } + + HStack { + if $settingsManager.config.wrappedValue.contains(where: { $0.key == game.titleId }) { + Image(systemName: "gearshape.circle") + .resizable() + .aspectRatio(contentMode: .fill) + .foregroundStyle(.blue) + .frame(width: 20, height: 20) + } // Play button Image(systemName: "play.circle.fill") @@ -950,71 +932,6 @@ struct GameListRow: View { .frame(maxWidth: .infinity, maxHeight: .infinity) } .contentShape(Rectangle()) - .contextMenu { - Section { - Button { - startemu = game - } label: { - Label("Play Now", systemImage: "play.fill") - } - - Button { - gameInfo = game - isViewingGameInfo.toggle() - - if game.titleName.lowercased() == "portal" || game.titleName.lowercased() == "portal 2" { - gamepo = true - } - } label: { - Label("Game Info", systemImage: "info.circle") - } - - Button { - perGameSettings = game - } label: { - Label("\(game.titleName) Settings", systemImage: "gear") - } - - // isShowingGameController - - Button { - isShowingGameController = game - } label: { - Label("Controller Layout", systemImage: "formfitting.gamecontroller") - } - } - - Section { - Button { - gameInfo = game - isSelectingGameUpdate.toggle() - } label: { - Label("Update Manager", systemImage: "arrow.up.circle") - } - - Button { - gameInfo = game - isSelectingGameDLC.toggle() - } label: { - Label("DLC Manager", systemImage: "plus.circle") - } - } - - Section { - Button(role: .destructive) { - Ryujinx.clearShaderCache(game.titleId) - } label: { - Label("Clear Shader Cache", systemImage: "trash") - } - - Button(role: .destructive) { - gametoDelete = game - showGameDeleteConfirmation.toggle() - } label: { - Label("Delete", systemImage: "trash") - } - } - } .swipeActions(edge: .trailing) { Button(role: .destructive) { gametoDelete = game @@ -1051,6 +968,71 @@ struct GameListRow: View { } .listRowInsets(EdgeInsets()) .wow(colorScheme) + .contextMenu { + Section { + Button { + startemu = game + } label: { + Label("Play Now", systemImage: "play.fill") + } + + Button { + gameInfo = game + isViewingGameInfo.toggle() + + if game.titleName.lowercased() == "portal" || game.titleName.lowercased() == "portal 2" { + gamepo = true + } + } label: { + Label("Game Info", systemImage: "info.circle") + } + + Button { + perGameSettings = game + } label: { + Label("\(game.titleName) Settings", systemImage: "gear") + } + + // isShowingGameController + + Button { + isShowingGameController = game + } label: { + Label("Controller Layout", systemImage: "formfitting.gamecontroller") + } + } + + Section { + Button { + gameInfo = game + isSelectingGameUpdate.toggle() + } label: { + Label("Update Manager", systemImage: "arrow.up.circle") + } + + Button { + gameInfo = game + isSelectingGameDLC.toggle() + } label: { + Label("DLC Manager", systemImage: "plus.circle") + } + } + + Section { + Button(role: .destructive) { + Ryujinx.clearShaderCache(game.titleId) + } label: { + Label("Clear Shader Cache", systemImage: "trash") + } + + Button(role: .destructive) { + gametoDelete = game + showGameDeleteConfirmation.toggle() + } label: { + Label("Delete", systemImage: "trash") + } + } + } } else { Button(action: { startemu = game @@ -1302,7 +1284,7 @@ extension View { self .background( RoundedRectangle(cornerRadius: 12) - .fill(colorScheme == .dark ? Color(.systemGray6) : Color(.systemGray6).opacity(0.5)) + .fill(Color(uiColor: .secondarySystemGroupedBackground)) ) } }