Skip to content

Commit

Permalink
Merge pull request #60 from pablopunk/no-gray
Browse files Browse the repository at this point in the history
use secondary instead of gray
  • Loading branch information
pablopunk authored Jun 12, 2024
2 parents c60d14e + 8e84d48 commit 50ca63b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Swift Shift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
1781A5E12B31EE4A00F27910 /* App.swift */,
E2E6F5E92B3EF03C005B0D96 /* Constants.swift */,
1751BFD72C19E98D00559AC7 /* lib */,
1751BFD62C19E91300559AC7 /* Manager */,
1751BFD52C19E90200559AC7 /* View */,
1751BFD62C19E91300559AC7 /* Manager */,
);
path = src;
sourceTree = "<group>";
Expand Down
2 changes: 1 addition & 1 deletion Swift Shift/src/View/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct TabButton: View {
.frame(width: 40, height: 40)
}
.buttonStyle(PlainButtonStyle())
.foregroundColor(selectedTab == tab ? .blue : .gray)
.foregroundColor(selectedTab == tab ? .blue : .secondary)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Swift Shift/src/View/InfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Swift Shift/src/View/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions Swift Shift/src/View/ShortcutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 14 additions & 1 deletion Swift Shift/src/lib/UIButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,18 @@ struct UIButton<Label: View>: 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)
}

0 comments on commit 50ca63b

Please sign in to comment.