color change
This commit is contained in:
@@ -13,7 +13,9 @@ struct MenuBarButtonStyle: ButtonStyle {
|
|||||||
configuration.label
|
configuration.label
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 6)
|
RoundedRectangle(cornerRadius: 6)
|
||||||
.fill(configuration.isPressed ? Color.blue.opacity(0.2) : Color.gray.opacity(0.1))
|
.fill(
|
||||||
|
configuration.isPressed ? Color.blue.opacity(0.2) : Color.gray.opacity(0.1)
|
||||||
|
)
|
||||||
.opacity(configuration.isPressed ? 1 : 0)
|
.opacity(configuration.isPressed ? 1 : 0)
|
||||||
)
|
)
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
@@ -23,12 +25,12 @@ struct MenuBarButtonStyle: ButtonStyle {
|
|||||||
|
|
||||||
struct MenuBarHoverButtonStyle: ButtonStyle {
|
struct MenuBarHoverButtonStyle: ButtonStyle {
|
||||||
@State private var isHovered = false
|
@State private var isHovered = false
|
||||||
|
|
||||||
func makeBody(configuration: Configuration) -> some View {
|
func makeBody(configuration: Configuration) -> some View {
|
||||||
configuration.label
|
configuration.label
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 6)
|
RoundedRectangle(cornerRadius: 6)
|
||||||
.fill(isHovered ? Color.gray.opacity(0.15) : Color.clear)
|
.fill(isHovered ? Color.blue.opacity(0.55) : Color.clear)
|
||||||
)
|
)
|
||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
.onHover { hovering in
|
.onHover { hovering in
|
||||||
@@ -44,7 +46,7 @@ struct MenuBarContentView: View {
|
|||||||
@ObservedObject var timerEngine: TimerEngine
|
@ObservedObject var timerEngine: TimerEngine
|
||||||
@ObservedObject var settingsManager: SettingsManager
|
@ObservedObject var settingsManager: SettingsManager
|
||||||
var onQuit: () -> Void
|
var onQuit: () -> Void
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
// Header
|
// Header
|
||||||
@@ -57,9 +59,9 @@ struct MenuBarContentView: View {
|
|||||||
.fontWeight(.semibold)
|
.fontWeight(.semibold)
|
||||||
}
|
}
|
||||||
.padding()
|
.padding()
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
|
|
||||||
// Timer Status
|
// Timer Status
|
||||||
if !timerEngine.timerStates.isEmpty {
|
if !timerEngine.timerStates.isEmpty {
|
||||||
VStack(alignment: .leading, spacing: 12) {
|
VStack(alignment: .leading, spacing: 12) {
|
||||||
@@ -68,7 +70,7 @@ struct MenuBarContentView: View {
|
|||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
.padding(.top, 8)
|
.padding(.top, 8)
|
||||||
|
|
||||||
ForEach(TimerType.allCases) { timerType in
|
ForEach(TimerType.allCases) { timerType in
|
||||||
if let state = timerEngine.timerStates[timerType] {
|
if let state = timerEngine.timerStates[timerType] {
|
||||||
TimerStatusRow(
|
TimerStatusRow(
|
||||||
@@ -82,10 +84,10 @@ struct MenuBarContentView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.padding(.bottom, 8)
|
.padding(.bottom, 8)
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
VStack(spacing: 4) {
|
VStack(spacing: 4) {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
@@ -104,7 +106,7 @@ struct MenuBarContentView: View {
|
|||||||
.padding(.vertical, 6)
|
.padding(.vertical, 6)
|
||||||
}
|
}
|
||||||
.buttonStyle(MenuBarHoverButtonStyle())
|
.buttonStyle(MenuBarHoverButtonStyle())
|
||||||
|
|
||||||
Button(action: {
|
Button(action: {
|
||||||
// TODO: Open settings window
|
// TODO: Open settings window
|
||||||
}) {
|
}) {
|
||||||
@@ -120,9 +122,9 @@ struct MenuBarContentView: View {
|
|||||||
}
|
}
|
||||||
.padding(.vertical, 8)
|
.padding(.vertical, 8)
|
||||||
.padding(.horizontal, 8)
|
.padding(.horizontal, 8)
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
|
|
||||||
// Quit
|
// Quit
|
||||||
Button(action: onQuit) {
|
Button(action: onQuit) {
|
||||||
HStack {
|
HStack {
|
||||||
@@ -140,7 +142,7 @@ struct MenuBarContentView: View {
|
|||||||
}
|
}
|
||||||
.frame(width: 300)
|
.frame(width: 300)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var isPaused: Bool {
|
private var isPaused: Bool {
|
||||||
timerEngine.timerStates.values.first?.isPaused ?? false
|
timerEngine.timerStates.values.first?.isPaused ?? false
|
||||||
}
|
}
|
||||||
@@ -151,13 +153,13 @@ struct TimerStatusRow: View {
|
|||||||
let state: TimerState
|
let state: TimerState
|
||||||
var onSkip: () -> Void
|
var onSkip: () -> Void
|
||||||
@State private var isHovered = false
|
@State private var isHovered = false
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack {
|
HStack {
|
||||||
Image(systemName: type.iconName)
|
Image(systemName: type.iconName)
|
||||||
.foregroundColor(iconColor)
|
.foregroundColor(iconColor)
|
||||||
.frame(width: 20)
|
.frame(width: 20)
|
||||||
|
|
||||||
VStack(alignment: .leading, spacing: 2) {
|
VStack(alignment: .leading, spacing: 2) {
|
||||||
Text(type.displayName)
|
Text(type.displayName)
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
@@ -167,9 +169,9 @@ struct TimerStatusRow: View {
|
|||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
.monospacedDigit()
|
.monospacedDigit()
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Button(action: onSkip) {
|
Button(action: onSkip) {
|
||||||
Image(systemName: "forward.fill")
|
Image(systemName: "forward.fill")
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
@@ -189,7 +191,7 @@ struct TimerStatusRow: View {
|
|||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
.padding(.vertical, 4)
|
.padding(.vertical, 4)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var iconColor: Color {
|
private var iconColor: Color {
|
||||||
switch type {
|
switch type {
|
||||||
case .lookAway: return .blue
|
case .lookAway: return .blue
|
||||||
@@ -197,12 +199,12 @@ struct TimerStatusRow: View {
|
|||||||
case .posture: return .orange
|
case .posture: return .orange
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private var timeRemaining: String {
|
private var timeRemaining: String {
|
||||||
let seconds = state.remainingSeconds
|
let seconds = state.remainingSeconds
|
||||||
let minutes = seconds / 60
|
let minutes = seconds / 60
|
||||||
let remainingSeconds = seconds % 60
|
let remainingSeconds = seconds % 60
|
||||||
|
|
||||||
if minutes >= 60 {
|
if minutes >= 60 {
|
||||||
let hours = minutes / 60
|
let hours = minutes / 60
|
||||||
let remainingMinutes = minutes % 60
|
let remainingMinutes = minutes % 60
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ struct OnboardingContainerView: View {
|
|||||||
minWidth: 100, maxWidth: .infinity, minHeight: 44,
|
minWidth: 100, maxWidth: .infinity, minHeight: 44,
|
||||||
maxHeight: 44, alignment: .center
|
maxHeight: 44, alignment: .center
|
||||||
)
|
)
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.black)
|
||||||
}
|
}
|
||||||
.glassEffect(.regular.interactive(), in: .rect(cornerRadius: 10))
|
.glassEffect(.regular.interactive(), in: .rect(cornerRadius: 10))
|
||||||
}
|
}
|
||||||
@@ -126,7 +126,9 @@ struct OnboardingContainerView: View {
|
|||||||
)
|
)
|
||||||
.foregroundColor(.white)
|
.foregroundColor(.white)
|
||||||
}
|
}
|
||||||
.glassEffect(.regular.tint(currentPage == 5 ? .green : .blue).interactive(), in: .rect(cornerRadius: 10))
|
.glassEffect(
|
||||||
|
.regular.tint(currentPage == 5 ? .green : .blue).interactive(),
|
||||||
|
in: .rect(cornerRadius: 10))
|
||||||
}
|
}
|
||||||
.padding(.horizontal, 40)
|
.padding(.horizontal, 40)
|
||||||
.padding(.bottom, 20)
|
.padding(.bottom, 20)
|
||||||
|
|||||||
Reference in New Issue
Block a user