Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various UI improvements #6

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Saved game list appearance tweaks
michaeltyson committed Aug 5, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 6af6faedd09c8b9c4acc5083b7c1e3af5129084c
5 changes: 3 additions & 2 deletions Quake2-iOS/Main.storyboard
Original file line number Diff line number Diff line change
@@ -341,9 +341,10 @@
<constraint firstAttribute="width" secondItem="SOe-Tg-0Ox" secondAttribute="height" multiplier="16:9" id="dqG-Lt-h0r"/>
</constraints>
</imageView>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Tob-r4-Kgp">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="Tob-r4-Kgp">
<rect key="frame" x="64" y="20" width="684" height="274"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<outlet property="dataSource" destination="Crn-DM-9m3" id="Z6u-u9-hPQ"/>
<outlet property="delegate" destination="Crn-DM-9m3" id="gB1-mq-xIh"/>
17 changes: 5 additions & 12 deletions Quake2-iOS/SavedGameViewController.swift
Original file line number Diff line number Diff line change
@@ -69,15 +69,6 @@ extension SavedGameViewController: UITableViewDelegate {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
selectedSavedGame = saves[indexPath.row]
loadGameButton.isHidden = false
#if os(tvOS)
tableView.cellForRow(at: indexPath)?.contentView.backgroundColor = .lightGray
#endif
}

func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) {
#if os(tvOS)
tableView.cellForRow(at: indexPath)?.contentView.backgroundColor = .none
#endif
}

// func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
@@ -95,9 +86,11 @@ extension SavedGameViewController: UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell")!

cell.textLabel?.text = saves[indexPath.row]//.replacingOccurrences(of: ".svg", with: "")
#if os(tvOS)
cell.textLabel?.textColor = .black
#endif
cell.textLabel?.textColor = .white
cell.backgroundColor = .clear
cell.selectedBackgroundView = UIView.init(frame: .zero)
cell.selectedBackgroundView?.backgroundColor = UIColor.init(white: 1, alpha: 0.2)
cell.selectedBackgroundView?.layer.cornerRadius = 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test these changes on tvOS? It appears as though the save games are unreadable now with white text on a white background that was fixed in #5.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guilty as charged! I hadn't tried it on tvOS. There we go; needed a storyboard update.

return cell
}