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

Fix SwitchRow subtitles #1352

Merged
merged 1 commit into from
May 24, 2020
Merged

Fix SwitchRow subtitles #1352

merged 1 commit into from
May 24, 2020

Conversation

dnicolson
Copy link
Contributor

@dnicolson dnicolson commented May 23, 2020

This pull request uses the display.description variable as the SwitchRow subtitle if available (like with the .multi option).

It is dependent on QuickTableViewController v1.2.2 which includes bcylin/QuickTableViewController#45 so Carthage must be updated.

Before:
Screen Shot 2020-05-22 at 19 15 20

After:
Screen Shot 2020-05-22 at 19 14 16

@@ -60,7 +60,8 @@ final class CoreOptionsViewController: QuickTableViewController {
let rows: [TableRow] = $0.options.map { option in
switch option {
case let .bool(display, defaultValue):
return SwitchRow(text: display.title, detailText: .none, switchValue: core.valueForOption(Bool.self, option.key) ?? defaultValue, action: { _ in
let detailText: DetailText = display.description != nil ? DetailText.subtitle(display.description!) : .none
return SwitchRow(text: display.title, detailText: detailText, switchValue: core.valueForOption(Bool.self, option.key) ?? defaultValue, action: { _ in
Copy link

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 169 characters (line_length)

@@ -60,7 +60,8 @@ final class CoreOptionsViewController: QuickTableViewController {
let rows: [TableRow] = $0.options.map { option in
switch option {
case let .bool(display, defaultValue):
return SwitchRow(text: display.title, detailText: .none, switchValue: core.valueForOption(Bool.self, option.key) ?? defaultValue, action: { _ in
let detailText: DetailText = display.description != nil ? DetailText.subtitle(display.description!) : .none
Copy link

Choose a reason for hiding this comment

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

Line Length Violation: Line should be 120 characters or less: currently 127 characters (line_length)

@dnicolson dnicolson marked this pull request as ready for review May 24, 2020 18:55
@jasarien jasarien merged commit 238fc5d into Provenance-Emu:develop May 24, 2020
@dnicolson dnicolson deleted the fix-switchrow-subtitles branch June 14, 2020 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants