-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Single mode for all views #60: Move settings view from a sheet presen…
…tation.
- Loading branch information
Showing
11 changed files
with
140 additions
and
36 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// ButtonModifier.swift | ||
// ReaderTranslator | ||
// | ||
// Created by Viktor Kushnerov on 18/1/20. | ||
// Copyright © 2020 Viktor Kushnerov. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ButtonModifier: ViewModifier { | ||
func body(content: Content) -> some View { | ||
content | ||
.aspectRatio(contentMode: .fit) | ||
.fixedSize(horizontal: true, vertical: false) | ||
.padding([.top, .bottom], 8) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// RoundedEdge.swift | ||
// ReaderTranslator | ||
// | ||
// Created by Viktor Kushnerov on 18/1/20. | ||
// Copyright © 2020 Viktor Kushnerov. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct RoundedEdge: ViewModifier { | ||
let width: CGFloat | ||
let color: Color | ||
let cornerRadius: CGFloat | ||
|
||
func body(content: Content) -> some View { | ||
content | ||
.cornerRadius(cornerRadius - width) | ||
.padding(width) | ||
.background(color) | ||
.cornerRadius(cornerRadius) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
ReaderTranslator/Views/StatusBarView/StatusBarView_SettingsView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// SettingsView.swift | ||
// ReaderTranslator | ||
// | ||
// Created by Viktor Kushnerov on 9/12/19. | ||
// Copyright © 2019 Viktor Kushnerov. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct StatusBarView_SettingsView: View { | ||
// @ObservedObject var viewStore = ViewsStore.shared //TextField uses ViewsStore via enum AvailableView | ||
|
||
var body: some View { | ||
Button(action: { ViewsStore.shared.showSettings = true }, label: { Text("Settings") }) | ||
} | ||
} | ||
|
||
struct StatusBarView_SettingsView_Previews: PreviewProvider { | ||
static var previews: some View { | ||
SettingsView() | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters