mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-06 09:47:22 +01:00
@@ -24,7 +24,7 @@ extension View {
|
||||
|
||||
}
|
||||
|
||||
struct MenuButtonModifier: ViewModifier {
|
||||
struct ToolbarCircleButtonModifier: ViewModifier {
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
if #available(macOS 26.0, *) {
|
||||
@@ -40,8 +40,8 @@ struct MenuButtonModifier: ViewModifier {
|
||||
|
||||
extension View {
|
||||
|
||||
func menuButton() -> some View {
|
||||
modifier(MenuButtonModifier())
|
||||
func toolbarCircleButton() -> some View {
|
||||
modifier(ToolbarCircleButtonModifier())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct ToolbarButtonStyle: ButtonStyle {
|
||||
struct ToolbarStatusButtonStyle: ButtonStyle {
|
||||
|
||||
private let lightColor: Color
|
||||
private let darkColor: Color
|
||||
@@ -56,3 +56,24 @@ struct ToolbarButtonStyle: ButtonStyle {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct ToolbarButtonStyle: PrimitiveButtonStyle {
|
||||
|
||||
var tint: Color = .white.opacity(0.1)
|
||||
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
if #available(macOS 26.0, *) {
|
||||
configuration
|
||||
.label
|
||||
.padding(.vertical, 10)
|
||||
.padding(.horizontal, 12)
|
||||
.glassEffect(.regular.interactive().tint(tint))
|
||||
} else {
|
||||
BorderedButtonStyle().makeBody(configuration: configuration)
|
||||
.padding(EdgeInsets(top: 6, leading: 8, bottom: 6, trailing: 8))
|
||||
.foregroundColor(.white)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 5))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user