Skip to content

Commit e22e2a1

Browse files
Enhances UI and build process
Adds an app icon to the settings view for improved visual appeal. Updates the build number configuration for more consistent versioning. Adds a note to the readme about allowing execution of the app in MacOS security settings.
1 parent ceaa159 commit e22e2a1

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CURRENT_PROJECT_VERSION = 251003.0759
1+
CURRENT_PROJECT_VERSION = 260107.1748

HeadsetControl-MacOSTray/SettingsView.swift

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
import SwiftUI
2+
import AppKit
3+
4+
// SwiftUI wrapper for NSImage
5+
struct AppIconImage: NSViewRepresentable {
6+
func makeNSView(context: Context) -> NSImageView {
7+
let imageView = NSImageView()
8+
imageView.image = NSApplication.shared.applicationIconImage
9+
imageView.imageScaling = .scaleProportionallyUpOrDown
10+
imageView.wantsLayer = true
11+
imageView.layer?.cornerRadius = 12
12+
imageView.layer?.masksToBounds = true
13+
return imageView
14+
}
15+
func updateNSView(_ nsView: NSImageView, context: Context) {}
16+
}
217

318
struct SettingsView: View {
419
@AppStorage("sidetoneOff") var sidetoneOff: Int = 0
@@ -14,10 +29,20 @@ struct SettingsView: View {
1429

1530
var body: some View {
1631
VStack(alignment: .leading, spacing: 24) {
32+
// App Icon at the top
33+
HStack {
34+
Spacer()
35+
AppIconImage()
36+
.frame(width: 64, height: 64)
37+
.shadow(radius: 4)
38+
.padding(.top, 16)
39+
Spacer()
40+
}
41+
1742
Text(NSLocalizedString("HeadsetControl-MacOSTray", comment: "App title"))
1843
.font(.largeTitle)
1944
.bold()
20-
.padding(.top, 16)
45+
.padding(.top, 8)
2146
.padding(.bottom, 8)
2247

2348
// General Settings Section

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ These menu items only appear if the headset reports the corresponding capability
5252
```
5353
3. Verify the headsetcontrol binary works in a terminal (headsetcontrol -o json)
5454
4. Check/change settings of the app when the headsetcontrol binary is not found
55+
5. You need to allow the execution of the app in MacOS security settings.
5556

5657
## Build with Xcode
5758

0 commit comments

Comments
 (0)