Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #27 from kamaal111/release/3.3.0
Browse files Browse the repository at this point in the history
Redesinging steppers for macOS
  • Loading branch information
kamaal111 committed Mar 23, 2021
2 parents 864c236 + 0151442 commit 36e4b6f
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Sources/SalmonUI/Views/KStepper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public struct KStepper: View {
self.onDecrement = onDecrement
}

#if !os(macOS) && !targetEnvironment(macCatalyst)
#if os(iOS)
public var body: some View {
HStack {
Image(systemName: "minus.rectangle.fill")
Expand Down Expand Up @@ -65,7 +65,24 @@ public struct KStepper: View {
}
.foregroundColor(.accentColor)
}
#else
#elseif targetEnvironment(macCatalyst)
public var body: some View {
HStack {
Button(action: onDecrement) {
Image(systemName: "minus.rectangle.fill")
.size(size)
.foregroundColor(.accentColor)
}
.disabled(disableDecrement)
Button(action: onIncrement) {
Image(systemName: "plus.rectangle.fill")
.size(size)
.foregroundColor(.accentColor)
}
.disabled(disableIncrement)
}
}
#elseif os(macOS)
public var body: some View {
HStack {
Button(action: onDecrement) {
Expand All @@ -74,12 +91,14 @@ public struct KStepper: View {
.foregroundColor(.accentColor)
}
.disabled(disableDecrement)
.buttonStyle(PlainButtonStyle())
Button(action: onIncrement) {
Image(systemName: "plus.rectangle.fill")
.size(size)
.foregroundColor(.accentColor)
}
.disabled(disableIncrement)
.buttonStyle(PlainButtonStyle())
}
}
#endif
Expand Down

0 comments on commit 36e4b6f

Please sign in to comment.