import Adw public extension ExpanderRow { /// Creates an ExpanderRow with static text and child views. /// /// Text is applied once; children are mounted into the expanded list. /// - Parameter title: The row title. /// - Parameter subtitle: The optional row subtitle. /// - Parameter children: The child views to add as rows. @_disfavoredOverload init(_ title: S, subtitle: String? = nil, @ViewBuilder _ children: () -> [AnyView] = { [] }) { self.init() self = self.title(String(title)) if let subtitle { self = self.subtitle(subtitle) } self = self.addRow(children) } /// Creates an ExpanderRow whose text follows bindings. /// /// Binding text updates the widget in place and writes widget changes back. /// - Parameter title: The title binding. /// - Parameter subtitle: The optional subtitle binding. /// - Parameter children: The child views to add as rows. init(_ title: Portico.Binding, subtitle: Portico.Binding? = nil, @ViewBuilder _ children: () -> [AnyView] = { [] }) { self.init() self = self.title(title) if let subtitle { self = self.subtitle(subtitle) } self = self.addRow(children) } /// Creates an ExpanderRow with live interpolated text values. /// /// Interpolated segments are re-evaluated when their dependencies change. /// - Parameter title: The interpolated title. /// - Parameter subtitle: The optional interpolated subtitle. /// - Parameter children: The child views to add as rows. init(_ title: Portico.InterpolatedText, subtitle: Portico.InterpolatedText? = nil, @ViewBuilder _ children: () -> [AnyView] = { [] }) { self.init() self = self.title(title) if let subtitle { self = self.subtitle(subtitle) } self = self.addRow(children) } } extension WidgetView where Target: Adw.ExpanderRow { /// Applies the `.property` style class. /// /// De-emphasizes the row title and emphasizes the subtitle, for read-only properties; typically paired with a selectable subtitle. Since libadwaita 1.4. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func property(_ enabled: Bool = true) -> Self { styleClass("property", enabled) } /// Applies the `.property` style class. /// /// De-emphasizes the row title and emphasizes the subtitle, for read-only properties; typically paired with a selectable subtitle. Since libadwaita 1.4. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func property(_ enabled: Binding) -> Self { styleClass("property", enabled) } }