portico/Sources/Portico/Extensions/Popover+Extras.swift

24 lines
No EOL
832 B
Swift

import Gtk
extension WidgetView where Target: Gtk.Popover {
/// Applies the `.menu` style class.
///
/// Menu-like appearance for a popover containing a `Gtk.ListBox` or `Gtk.ListView`.
///
/// - Parameter enabled: Whether the style class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func menu(_ enabled: Bool = true) -> Self {
styleClass("menu", enabled)
}
/// Applies the `.menu` style class.
///
/// Menu-like appearance for a popover containing a `Gtk.ListBox` or `Gtk.ListView`.
///
/// - Parameter enabled: A binding that controls whether the class is applied.
/// - Returns: A copy of this view with the modifier applied.
public func menu(_ enabled: Binding<Bool>) -> Self {
styleClass("menu", enabled)
}
}