43 lines
1009 B
Swift
43 lines
1009 B
Swift
//
|
|
// Divider.swift
|
|
// MacBackend
|
|
//
|
|
// Created by david-swift on 22.10.23.
|
|
//
|
|
|
|
import AppKit
|
|
|
|
/// A button widget for menus.
|
|
public struct Divider: MenuWidget {
|
|
|
|
/// Initialize a section for menus.
|
|
public init() { }
|
|
|
|
/// The view storage.
|
|
/// - Parameters:
|
|
/// - data: The widget data.
|
|
/// - type: The type of the views.
|
|
/// - Returns: The view storage.
|
|
public func container<Data>(
|
|
data: WidgetData,
|
|
type: Data.Type
|
|
) -> ViewStorage where Data: ViewRenderData {
|
|
.init(NSMenuItem.separator())
|
|
}
|
|
|
|
/// Update the stored content.
|
|
/// - Parameters:
|
|
/// - storage: The storage to update.
|
|
/// - data: The widget data.
|
|
/// - updateProperties: Whether to update the properties.
|
|
/// - type: The type of the views.
|
|
public func update<Data>(
|
|
_ storage: ViewStorage,
|
|
data: WidgetData,
|
|
updateProperties: Bool,
|
|
type: Data.Type
|
|
) where Data: ViewRenderData {
|
|
}
|
|
|
|
}
|