From 8e84d48ce942088739aa130c20652e8c60dc3e84 Mon Sep 17 00:00:00 2001 From: Pablo P Varela Date: Wed, 12 Jun 2024 17:37:17 +0200 Subject: [PATCH] use secondary instead of gray --- Swift Shift.xcodeproj/project.pbxproj | 2 +- Swift Shift/src/View/AppView.swift | 2 +- Swift Shift/src/View/InfoView.swift | 2 +- Swift Shift/src/View/SettingsView.swift | 2 +- Swift Shift/src/View/ShortcutView.swift | 6 +++--- Swift Shift/src/lib/UIButton.swift | 15 ++++++++++++++- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Swift Shift.xcodeproj/project.pbxproj b/Swift Shift.xcodeproj/project.pbxproj index 3259e70..64418c2 100644 --- a/Swift Shift.xcodeproj/project.pbxproj +++ b/Swift Shift.xcodeproj/project.pbxproj @@ -116,8 +116,8 @@ 1781A5E12B31EE4A00F27910 /* App.swift */, E2E6F5E92B3EF03C005B0D96 /* Constants.swift */, 1751BFD72C19E98D00559AC7 /* lib */, - 1751BFD62C19E91300559AC7 /* Manager */, 1751BFD52C19E90200559AC7 /* View */, + 1751BFD62C19E91300559AC7 /* Manager */, ); path = src; sourceTree = ""; diff --git a/Swift Shift/src/View/AppView.swift b/Swift Shift/src/View/AppView.swift index 5b39572..5c6131a 100644 --- a/Swift Shift/src/View/AppView.swift +++ b/Swift Shift/src/View/AppView.swift @@ -19,7 +19,7 @@ struct TabButton: View { .frame(width: 40, height: 40) } .buttonStyle(PlainButtonStyle()) - .foregroundColor(selectedTab == tab ? .blue : .gray) + .foregroundColor(selectedTab == tab ? .blue : .secondary) } } diff --git a/Swift Shift/src/View/InfoView.swift b/Swift Shift/src/View/InfoView.swift index 827e05b..fd30058 100644 --- a/Swift Shift/src/View/InfoView.swift +++ b/Swift Shift/src/View/InfoView.swift @@ -57,7 +57,7 @@ struct InfoView: View { }, label: { HStack { Text("Quit") - Text("⌘+Q").foregroundStyle(.gray).font(.subheadline) + Text("⌘+Q").foregroundStyle(.secondary).font(.subheadline) } }) .keyboardShortcut("Q", modifiers: .command) diff --git a/Swift Shift/src/View/SettingsView.swift b/Swift Shift/src/View/SettingsView.swift index fe71838..829d1d6 100644 --- a/Swift Shift/src/View/SettingsView.swift +++ b/Swift Shift/src/View/SettingsView.swift @@ -50,7 +50,7 @@ struct SettingsView: View { }, label: { HStack { Text("Quit") - Text("⌘+Q").foregroundStyle(.gray).font(.subheadline) + Text("⌘+Q").foregroundStyle(.secondary).font(.subheadline) } }) .keyboardShortcut("Q", modifiers: .command) diff --git a/Swift Shift/src/View/ShortcutView.swift b/Swift Shift/src/View/ShortcutView.swift index a2efa14..37d44cb 100644 --- a/Swift Shift/src/View/ShortcutView.swift +++ b/Swift Shift/src/View/ShortcutView.swift @@ -72,19 +72,19 @@ struct ShortcutView: View { if requireMouseClick { HStack { Image(systemName: "magicmouse.fill") - .foregroundColor(.gray) + .foregroundColor(.secondary) .frame(width: 18) Text("Click") .font(.callout) - .foregroundStyle(.gray) + .foregroundStyle(.secondary) Spacer() HStack { ForEach(Array(MouseButton.allCases), id: \.self) { mouseButton in let selected = mouseButton == shortcut.mouseButton - let color: Color = selected ? .teal : .gray + let color: Color = selected ? .teal : .primary.opacity(0.8) UIButton(action: { shortcut.mouseButton = mouseButton ShortcutsManager.shared.save(shortcut) diff --git a/Swift Shift/src/lib/UIButton.swift b/Swift Shift/src/lib/UIButton.swift index 564ff39..eb3841b 100644 --- a/Swift Shift/src/lib/UIButton.swift +++ b/Swift Shift/src/lib/UIButton.swift @@ -89,5 +89,18 @@ struct UIButton: View { UIButton(action: {print("Pressed")}, plain: true, background: .cyan, label: { Text("Plain") }, backgroundHover: .teal.opacity(0.2)) - }.padding(120) + + ForEach(Array(MouseButton.allCases), id: \.self) { mouseButton in + let selected = mouseButton == .none + let color: Color = selected ? .teal : .primary + UIButton(action: { + print("hi") + }, plain: true, background: color, label: { + if mouseButton != .none { + Image(systemName: "capsule.lefthalf.filled") + } + Text(mouseButton.rawValue).font(.caption) + }, backgroundHover: .teal.opacity(0.2)) + } + }.padding(80) }