import Gtk extension WidgetView { /// Applies the `.dimmed` style class. /// /// Partially transparent. The opacity is tracked by the `--dim-opacity` CSS variable and differs under high contrast. Since libadwaita 1.7. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func dimmed(_ enabled: Bool = true) -> Self { styleClass("dimmed", enabled) } /// Applies the `.dimmed` style class. /// /// Partially transparent. The opacity is tracked by the `--dim-opacity` CSS variable and differs under high contrast. Since libadwaita 1.7. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func dimmed(_ enabled: Binding) -> Self { styleClass("dimmed", enabled) } /// Applies the `.title-1` style class. /// /// Largest of four title levels indicating hierarchy; suits big views with plenty of whitespace. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func title1(_ enabled: Bool = true) -> Self { styleClass("title-1", enabled) } /// Applies the `.title-1` style class. /// /// Largest of four title levels indicating hierarchy; suits big views with plenty of whitespace. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func title1(_ enabled: Binding) -> Self { styleClass("title-1", enabled) } /// Applies the `.title-2` style class. /// /// Second of four title levels indicating hierarchy. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func title2(_ enabled: Bool = true) -> Self { styleClass("title-2", enabled) } /// Applies the `.title-2` style class. /// /// Second of four title levels indicating hierarchy. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func title2(_ enabled: Binding) -> Self { styleClass("title-2", enabled) } /// Applies the `.title-3` style class. /// /// Third of four title levels indicating hierarchy. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func title3(_ enabled: Bool = true) -> Self { styleClass("title-3", enabled) } /// Applies the `.title-3` style class. /// /// Third of four title levels indicating hierarchy. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func title3(_ enabled: Binding) -> Self { styleClass("title-3", enabled) } /// Applies the `.title-4` style class. /// /// Fourth and smallest of four title levels indicating hierarchy. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func title4(_ enabled: Bool = true) -> Self { styleClass("title-4", enabled) } /// Applies the `.title-4` style class. /// /// Fourth and smallest of four title levels indicating hierarchy. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func title4(_ enabled: Binding) -> Self { styleClass("title-4", enabled) } /// Applies the `.heading` style class. /// /// Standard UI heading at the default text size, e.g. for window titles or boxed-list labels. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func heading(_ enabled: Bool = true) -> Self { styleClass("heading", enabled) } /// Applies the `.heading` style class. /// /// Standard UI heading at the default text size, e.g. for window titles or boxed-list labels. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func heading(_ enabled: Binding) -> Self { styleClass("heading", enabled) } /// Applies the `.document` style class. /// /// Document font: larger size and line height for the app's main content. Since libadwaita 1.8. Use ``body`` for other long text. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func document(_ enabled: Bool = true) -> Self { styleClass("document", enabled) } /// Applies the `.document` style class. /// /// Document font: larger size and line height for the app's main content. Since libadwaita 1.8. Use ``body`` for other long text. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func document(_ enabled: Binding) -> Self { styleClass("document", enabled) } /// Applies the `.body` style class. /// /// Increased line height for UI text such as descriptions or dialog bodies. Avoid for non-wrapping text; use ``document`` for main content. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func body(_ enabled: Bool = true) -> Self { styleClass("body", enabled) } /// Applies the `.body` style class. /// /// Increased line height for UI text such as descriptions or dialog bodies. Avoid for non-wrapping text; use ``document`` for main content. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func body(_ enabled: Binding) -> Self { styleClass("body", enabled) } /// Applies the `.caption-heading` style class. /// /// Smaller text that differentiates sub-text accompanying body text. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func captionHeading(_ enabled: Bool = true) -> Self { styleClass("caption-heading", enabled) } /// Applies the `.caption-heading` style class. /// /// Smaller text that differentiates sub-text accompanying body text. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func captionHeading(_ enabled: Binding) -> Self { styleClass("caption-heading", enabled) } /// Applies the `.caption` style class. /// /// Smaller text for captions and supplementary labels. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func caption(_ enabled: Bool = true) -> Self { styleClass("caption", enabled) } /// Applies the `.caption` style class. /// /// Smaller text for captions and supplementary labels. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func caption(_ enabled: Binding) -> Self { styleClass("caption", enabled) } /// Applies the `.monospace` style class. /// /// Monospace font, for code, logs, or shell output. On `Adw.EntryRow` only the editable part becomes monospace - apply it to the surrounding `Gtk.ListBox` to cover the whole row. Named `monospaceStyle` because `Gtk.TextView` already has a `monospace(_:)` property modifier. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func monospaceStyle(_ enabled: Bool = true) -> Self { styleClass("monospace", enabled) } /// Applies the `.monospace` style class. /// /// Monospace font, for code, logs, or shell output. On `Adw.EntryRow` only the editable part becomes monospace - apply it to the surrounding `Gtk.ListBox` to cover the whole row. Named `monospaceStyle` because `Gtk.TextView` already has a `monospace(_:)` property modifier. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func monospaceStyle(_ enabled: Binding) -> Self { styleClass("monospace", enabled) } /// Applies the `.numeric` style class. /// /// Tabular figures, equivalent to Pango "tnum=1"; use for vertically aligned numbers, clocks, and progress. Named `numericStyle` because `Gtk.SpinButton` / `Adw.SpinRow` already has a `numeric(_:)` property modifier. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func numericStyle(_ enabled: Bool = true) -> Self { styleClass("numeric", enabled) } /// Applies the `.numeric` style class. /// /// Tabular figures, equivalent to Pango "tnum=1"; use for vertically aligned numbers, clocks, and progress. Named `numericStyle` because `Gtk.SpinButton` / `Adw.SpinRow` already has a `numeric(_:)` property modifier. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func numericStyle(_ enabled: Binding) -> Self { styleClass("numeric", enabled) } /// Applies the `.accent` style class. /// /// Recolors the widget with the accent color. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func accent(_ enabled: Bool = true) -> Self { styleClass("accent", enabled) } /// Applies the `.accent` style class. /// /// Recolors the widget with the accent color. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func accent(_ enabled: Binding) -> Self { styleClass("accent", enabled) } /// Applies the `.success` style class. /// /// Success color. Also usable on `Gtk.Entry` to signal input validation state, where it additionally changes the accent color. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func success(_ enabled: Bool = true) -> Self { styleClass("success", enabled) } /// Applies the `.success` style class. /// /// Success color. Also usable on `Gtk.Entry` to signal input validation state, where it additionally changes the accent color. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func success(_ enabled: Binding) -> Self { styleClass("success", enabled) } /// Applies the `.warning` style class. /// /// Warning color. Also usable on `Gtk.Entry` to signal input validation state, where it additionally changes the accent color. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func warning(_ enabled: Bool = true) -> Self { styleClass("warning", enabled) } /// Applies the `.warning` style class. /// /// Warning color. Also usable on `Gtk.Entry` to signal input validation state, where it additionally changes the accent color. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func warning(_ enabled: Binding) -> Self { styleClass("warning", enabled) } /// Applies the `.error` style class. /// /// Error color. Also usable on `Gtk.Entry` to signal input validation state, where it additionally changes the accent color. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func error(_ enabled: Bool = true) -> Self { styleClass("error", enabled) } /// Applies the `.error` style class. /// /// Error color. Also usable on `Gtk.Entry` to signal input validation state, where it additionally changes the accent color. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func error(_ enabled: Binding) -> Self { styleClass("error", enabled) } /// Applies the `.card` style class. /// /// Gives any widget a boxed-list-like card appearance. Combined with ``activatableStyle`` it gains hover and active states; a `Gtk.Button` gets those states automatically without ``activatableStyle``. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func card(_ enabled: Bool = true) -> Self { styleClass("card", enabled) } /// Applies the `.card` style class. /// /// Gives any widget a boxed-list-like card appearance. Combined with ``activatableStyle`` it gains hover and active states; a `Gtk.Button` gets those states automatically without ``activatableStyle``. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func card(_ enabled: Binding) -> Self { styleClass("card", enabled) } /// Applies the `.activatable` style class. /// /// Only meaningful together with ``card``; adds hover and active states to the card. Named `activatableStyle` because `Gtk.ListBoxRow` already has an `activatable(_:)` property modifier. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func activatableStyle(_ enabled: Bool = true) -> Self { styleClass("activatable", enabled) } /// Applies the `.activatable` style class. /// /// Only meaningful together with ``card``; adds hover and active states to the card. Named `activatableStyle` because `Gtk.ListBoxRow` already has an `activatable(_:)` property modifier. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func activatableStyle(_ enabled: Binding) -> Self { styleClass("activatable", enabled) } /// Applies the `.osd` style class. /// /// Dark, partially transparent background with a white accent. On `Gtk.Button` it produces large standalone overlay buttons (combinable with ``circular`` / ``pill``). Combine with ``toolbar`` on a `Gtk.Box` for a floating toolbar. On `Gtk.ProgressBar` it makes the bar thinner and removes the trough. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func osd(_ enabled: Bool = true) -> Self { styleClass("osd", enabled) } /// Applies the `.osd` style class. /// /// Dark, partially transparent background with a white accent. On `Gtk.Button` it produces large standalone overlay buttons (combinable with ``circular`` / ``pill``). Combine with ``toolbar`` on a `Gtk.Box` for a floating toolbar. On `Gtk.ProgressBar` it makes the bar thinner and removes the trough. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func osd(_ enabled: Binding) -> Self { styleClass("osd", enabled) } /// Applies the `.background` style class. /// /// Default window background and foreground colors; useful when a widget needs an opaque background. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func background(_ enabled: Bool = true) -> Self { styleClass("background", enabled) } /// Applies the `.background` style class. /// /// Default window background and foreground colors; useful when a widget needs an opaque background. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func background(_ enabled: Binding) -> Self { styleClass("background", enabled) } /// Applies the `.view` style class. /// /// Default view background and foreground colors. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func view(_ enabled: Bool = true) -> Self { styleClass("view", enabled) } /// Applies the `.view` style class. /// /// Default view background and foreground colors. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func view(_ enabled: Binding) -> Self { styleClass("view", enabled) } /// Applies the `.frame` style class. /// /// Default 1px border. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. public func frame(_ enabled: Bool = true) -> Self { styleClass("frame", enabled) } /// Applies the `.frame` style class. /// /// Default 1px border. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. public func frame(_ enabled: Binding) -> Self { styleClass("frame", enabled) } /// Applies the `.sidebar` style class. /// /// Border at the end of the widget plus background removal from a contained list. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. @available(*, deprecated, message: "Deprecated by libadwaita. Use navigationSidebar() on the list widget plus a Separator for the border.") public func sidebar(_ enabled: Bool = true) -> Self { styleClass("sidebar", enabled) } /// Applies the `.sidebar` style class. /// /// Border at the end of the widget plus background removal from a contained list. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. @available(*, deprecated, message: "Deprecated by libadwaita. Use navigationSidebar() on the list widget plus a Separator for the border.") public func sidebar(_ enabled: Binding) -> Self { styleClass("sidebar", enabled) } /// Applies the `.large-title` style class. /// /// Large thin display heading. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. @available(*, deprecated, message: "Deprecated since libadwaita 1.2. Use title1() instead.") public func largeTitle(_ enabled: Bool = true) -> Self { styleClass("large-title", enabled) } /// Applies the `.large-title` style class. /// /// Large thin display heading. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. @available(*, deprecated, message: "Deprecated since libadwaita 1.2. Use title1() instead.") public func largeTitle(_ enabled: Binding) -> Self { styleClass("large-title", enabled) } /// Applies the `.dim-label` style class. /// /// Equivalent to ``dimmed``. /// /// - Parameter enabled: Whether the style class is applied. /// - Returns: A copy of this view with the modifier applied. @available(*, deprecated, message: "Deprecated since libadwaita 1.7. Use dimmed() instead.") public func dimLabel(_ enabled: Bool = true) -> Self { styleClass("dim-label", enabled) } /// Applies the `.dim-label` style class. /// /// Equivalent to ``dimmed``. /// /// - Parameter enabled: A binding that controls whether the class is applied. /// - Returns: A copy of this view with the modifier applied. @available(*, deprecated, message: "Deprecated since libadwaita 1.7. Use dimmed() instead.") public func dimLabel(_ enabled: Binding) -> Self { styleClass("dim-label", enabled) } }