mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
29 lines
584 B
Swift
29 lines
584 B
Swift
import SwiftUI
|
|
|
|
/// View for a map zoom button
|
|
struct MapZoomButton: View {
|
|
// MARK: Properties
|
|
|
|
/// The kind
|
|
var kind: MapZoomButton.Kind
|
|
|
|
|
|
/// The actual view
|
|
var body: some View {
|
|
Button {
|
|
if kind == .in {
|
|
Controls.zoomIn()
|
|
} else if kind == .out {
|
|
Controls.zoomOut()
|
|
}
|
|
} label: {
|
|
Label {
|
|
Text(kind.description)
|
|
} icon: {
|
|
kind.image
|
|
}
|
|
}
|
|
.buttonStyle(FloatingButtonStyle())
|
|
}
|
|
}
|