Skip to content

Commit

Permalink
Add setting to hide transposition menu (#85)
Browse files Browse the repository at this point in the history
* Hide concert pitch setting

* Use AppStorage property wrapper

* Wrap the whole header view

* Revert development team

* Update string to "Hide Transposition Menu"

* Lint
  • Loading branch information
soffes authored Nov 12, 2023
1 parent 6729f12 commit 69b2842
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
21 changes: 21 additions & 0 deletions BuildSupport/iOS/Settings.bundle/Root.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>StringsTable</key>
<string>Root</string>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Type</key>
<string>PSToggleSwitchSpecifier</string>
<key>Title</key>
<string>Hide Transposition Menu</string>
<key>Key</key>
<string>HidesTranspositionMenu</string>
<key>DefaultValue</key>
<false/>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
4 changes: 4 additions & 0 deletions ZenTuner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
21E9A5582AFDC0CE00673532 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 21E9A5572AFDC0CE00673532 /* Settings.bundle */; };
8F13E1C225ED533800C3F23D /* ClosestNoteTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F13E1C125ED533800C3F23D /* ClosestNoteTests.swift */; };
8F2D975126938AF900B512D0 /* TunerScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F2D975026938AF900B512D0 /* TunerScreen.swift */; };
8F2D975326938B0500B512D0 /* TunerScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F2D975026938AF900B512D0 /* TunerScreen.swift */; };
Expand Down Expand Up @@ -84,6 +85,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
21E9A5572AFDC0CE00673532 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
8F13E1C125ED533800C3F23D /* ClosestNoteTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ClosestNoteTests.swift; sourceTree = "<group>"; };
8F2D975026938AF900B512D0 /* TunerScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TunerScreen.swift; sourceTree = "<group>"; };
8F2D9754269390D800B512D0 /* MicrophoneAccessAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MicrophoneAccessAlert.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -231,6 +233,7 @@
isa = PBXGroup;
children = (
8FB571B425B72147007C28BC /* Info.plist */,
21E9A5572AFDC0CE00673532 /* Settings.bundle */,
);
path = iOS;
sourceTree = "<group>";
Expand Down Expand Up @@ -441,6 +444,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
21E9A5582AFDC0CE00673532 /* Settings.bundle in Resources */,
8FB571C125B72147007C28BC /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
13 changes: 9 additions & 4 deletions ZenTuner/Views/TunerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ struct TunerView: View {
tunerData.closestNote.inTransposition(ScaleNote.allCases[selectedTransposition])
}

@AppStorage("HidesTranspositionMenu")
private var hidesTranspositionMenu = false

var body: some View {
#if os(watchOS)
ZStack(alignment: Alignment(horizontal: .noteCenter, vertical: .noteTickCenter)) {
Expand All @@ -31,11 +34,13 @@ struct TunerView: View {
}
#else
VStack(alignment: .noteCenter) {
HStack {
TranspositionMenu(selectedTransposition: $selectedTransposition)
.padding()
if !hidesTranspositionMenu {
HStack {
TranspositionMenu(selectedTransposition: $selectedTransposition)
.padding()

Spacer()
Spacer()
}
}

Spacer()
Expand Down

0 comments on commit 69b2842

Please sign in to comment.