Skip to content

Commit

Permalink
[Misc] Minor UI improvements on iPad.
Browse files Browse the repository at this point in the history
  • Loading branch information
honganhkhoa committed Feb 25, 2024
1 parent 79a2172 commit daf3295
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
10 changes: 2 additions & 8 deletions Surround/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@
"**%@** of total play time for each player." : {
"comment" : "TimeControl - long description for absolute system",
"localizations" : {
"ja" : {
"stringUnit" : {
"state" : "translated",
"value" : "Thời gian suy nghĩ **%@** cho mỗi bên."
}
},
"vi" : {
"stringUnit" : {
"state" : "translated",
Expand Down Expand Up @@ -6210,7 +6204,7 @@
}
},
"Waiting for opponent: %lld games " : {
"comment" : "NewGameView - vary for plural\nHomeView - vary for plural",
"comment" : "HomeView - vary for plural\nNewGameView - vary for plural",
"localizations" : {
"en" : {
"variations" : {
Expand Down Expand Up @@ -6767,7 +6761,7 @@
}
},
"Your move" : {
"comment" : "Homeview\nGame",
"comment" : "Game\nHomeview",
"localizations" : {
"ja" : {
"stringUnit" : {
Expand Down
3 changes: 2 additions & 1 deletion Surround/Views/GameDetail/AnalyzeTreeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct AnalyzeTreeSlice: View {
.onTapGesture {
self.selectedPosition = position
}
.position(x: 15, y: 15)
}
}
// else {
Expand Down Expand Up @@ -186,7 +187,7 @@ struct AnalyzeTreeView: View {
}
}
}
}
}.frame(minHeight: geometry.size.height)
}.frame(minHeight: geometry.size.height)
}.frame(height: geometry.size.height)
}
Expand Down
22 changes: 12 additions & 10 deletions Surround/Views/GameDetail/GameDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ struct GameDetailView: View {
@State var analyzeMode = false

@ObservedObject var settings = userDefaults

var showsActiveGamesCarouselSetting = Setting(.showsActiveGamesCarousel).binding

var shouldShowActiveGamesCarousel: Bool {
guard !zenMode else {
Expand Down Expand Up @@ -271,7 +273,7 @@ struct GameDetailView: View {
return AnyView(
result.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: { withAnimation { analyzeMode.toggle() } }) {
Toggle(isOn: $analyzeMode.animation()) {
if currentGame.analysisAvailable {
Label("Toggle analyze mode", systemImage: "arrow.triangle.branch")
.labelStyle(IconOnlyLabelStyle())
Expand All @@ -282,16 +284,16 @@ struct GameDetailView: View {
}
}
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {
withAnimation {
if analyzeMode {
analyzeMode.toggle()
Setting(.showsActiveGamesCarousel).binding.wrappedValue = true
} else {
Setting(.showsActiveGamesCarousel).binding.wrappedValue.toggle()
Toggle(isOn: Binding<Bool>(
get: { showsActiveGamesCarouselSetting.wrappedValue },
set: { newValue in
withAnimation {
if newValue && analyzeMode {
analyzeMode.toggle()
}
showsActiveGamesCarouselSetting.wrappedValue = newValue
}
}
}) {
})) {
Label("Toggle thumbnails", systemImage: "rectangle.topthird.inset")
.labelStyle(IconOnlyLabelStyle())
}
Expand Down

0 comments on commit daf3295

Please sign in to comment.