diff --git a/Sources/Core/Model/Enumerations/ToolbarStyle.swift b/Sources/Core/Model/Enumerations/ToolbarStyle.swift new file mode 100644 index 0000000..c2b1699 --- /dev/null +++ b/Sources/Core/Model/Enumerations/ToolbarStyle.swift @@ -0,0 +1,25 @@ +// +// ToolbarStyle.swift +// Adwaita +// +// Created by david-swift on 15.04.25. +// + +import CAdw + +/// The top and bottom bar styles. +public enum ToolbarStyle: UInt32 { + + /// No background, shadow only for scrolled content. + case flat + /// Opaque background with a persistent shadow. + case raised + /// Opaque background with a persistent border. + case raisedBorder + + /// The ToolbarStyle value as an AdwToolbarStyle value. + var gtkValue: AdwToolbarStyle { + .init(rawValue) + } + +} diff --git a/Sources/Core/View/Generated/ActionRow.swift b/Sources/Core/View/Generated/ActionRow.swift index 04ab465..0948950 100644 --- a/Sources/Core/View/Generated/ActionRow.swift +++ b/Sources/Core/View/Generated/ActionRow.swift @@ -2,7 +2,7 @@ // ActionRow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/AspectFrame.swift b/Sources/Core/View/Generated/AspectFrame.swift index bfea154..52addd7 100644 --- a/Sources/Core/View/Generated/AspectFrame.swift +++ b/Sources/Core/View/Generated/AspectFrame.swift @@ -2,7 +2,7 @@ // AspectFrame.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Avatar.swift b/Sources/Core/View/Generated/Avatar.swift index 7cf81a0..23ce5e8 100644 --- a/Sources/Core/View/Generated/Avatar.swift +++ b/Sources/Core/View/Generated/Avatar.swift @@ -2,7 +2,7 @@ // Avatar.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Banner.swift b/Sources/Core/View/Generated/Banner.swift index a2350a2..80ab63c 100644 --- a/Sources/Core/View/Generated/Banner.swift +++ b/Sources/Core/View/Generated/Banner.swift @@ -2,7 +2,7 @@ // Banner.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Bin.swift b/Sources/Core/View/Generated/Bin.swift index a56fe9a..3c53c48 100644 --- a/Sources/Core/View/Generated/Bin.swift +++ b/Sources/Core/View/Generated/Bin.swift @@ -2,7 +2,7 @@ // Bin.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Box.swift b/Sources/Core/View/Generated/Box.swift index 57744a7..cc7bd13 100644 --- a/Sources/Core/View/Generated/Box.swift +++ b/Sources/Core/View/Generated/Box.swift @@ -2,7 +2,7 @@ // Box.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Button.swift b/Sources/Core/View/Generated/Button.swift index 908a277..853869b 100644 --- a/Sources/Core/View/Generated/Button.swift +++ b/Sources/Core/View/Generated/Button.swift @@ -2,7 +2,7 @@ // Button.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ButtonContent.swift b/Sources/Core/View/Generated/ButtonContent.swift index 29e1838..e03a148 100644 --- a/Sources/Core/View/Generated/ButtonContent.swift +++ b/Sources/Core/View/Generated/ButtonContent.swift @@ -2,7 +2,7 @@ // ButtonContent.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Carousel.swift b/Sources/Core/View/Generated/Carousel.swift index 9f5eed3..a5ca5c3 100644 --- a/Sources/Core/View/Generated/Carousel.swift +++ b/Sources/Core/View/Generated/Carousel.swift @@ -2,7 +2,7 @@ // Carousel.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/CenterBox.swift b/Sources/Core/View/Generated/CenterBox.swift index 6c8c013..33d175b 100644 --- a/Sources/Core/View/Generated/CenterBox.swift +++ b/Sources/Core/View/Generated/CenterBox.swift @@ -2,7 +2,7 @@ // CenterBox.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/CheckButton.swift b/Sources/Core/View/Generated/CheckButton.swift index 5e9ce05..9791af4 100644 --- a/Sources/Core/View/Generated/CheckButton.swift +++ b/Sources/Core/View/Generated/CheckButton.swift @@ -2,7 +2,7 @@ // CheckButton.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Clamp.swift b/Sources/Core/View/Generated/Clamp.swift index 30df04a..0a1b1ff 100644 --- a/Sources/Core/View/Generated/Clamp.swift +++ b/Sources/Core/View/Generated/Clamp.swift @@ -2,7 +2,7 @@ // Clamp.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ComboRow.swift b/Sources/Core/View/Generated/ComboRow.swift index 4f30156..8db7336 100644 --- a/Sources/Core/View/Generated/ComboRow.swift +++ b/Sources/Core/View/Generated/ComboRow.swift @@ -2,7 +2,7 @@ // ComboRow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/DropDown.swift b/Sources/Core/View/Generated/DropDown.swift index 11cd49e..3f034a5 100644 --- a/Sources/Core/View/Generated/DropDown.swift +++ b/Sources/Core/View/Generated/DropDown.swift @@ -2,7 +2,7 @@ // DropDown.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/EntryRow.swift b/Sources/Core/View/Generated/EntryRow.swift index 44e49e2..4727352 100644 --- a/Sources/Core/View/Generated/EntryRow.swift +++ b/Sources/Core/View/Generated/EntryRow.swift @@ -2,7 +2,7 @@ // EntryRow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ExpanderRow.swift b/Sources/Core/View/Generated/ExpanderRow.swift index a066d66..ed15a4b 100644 --- a/Sources/Core/View/Generated/ExpanderRow.swift +++ b/Sources/Core/View/Generated/ExpanderRow.swift @@ -2,7 +2,7 @@ // ExpanderRow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Fixed.swift b/Sources/Core/View/Generated/Fixed.swift index 44e6f46..7810456 100644 --- a/Sources/Core/View/Generated/Fixed.swift +++ b/Sources/Core/View/Generated/Fixed.swift @@ -2,7 +2,7 @@ // Fixed.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/FlowBox.swift b/Sources/Core/View/Generated/FlowBox.swift index 4a32e48..e1a3933 100644 --- a/Sources/Core/View/Generated/FlowBox.swift +++ b/Sources/Core/View/Generated/FlowBox.swift @@ -2,7 +2,7 @@ // FlowBox.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/HeaderBar.swift b/Sources/Core/View/Generated/HeaderBar.swift index 512ddda..7411ea2 100644 --- a/Sources/Core/View/Generated/HeaderBar.swift +++ b/Sources/Core/View/Generated/HeaderBar.swift @@ -2,7 +2,7 @@ // HeaderBar.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Label.swift b/Sources/Core/View/Generated/Label.swift index 0c9adb0..0854708 100644 --- a/Sources/Core/View/Generated/Label.swift +++ b/Sources/Core/View/Generated/Label.swift @@ -2,7 +2,7 @@ // Label.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/LevelBar.swift b/Sources/Core/View/Generated/LevelBar.swift index e011d10..8879e86 100644 --- a/Sources/Core/View/Generated/LevelBar.swift +++ b/Sources/Core/View/Generated/LevelBar.swift @@ -2,7 +2,7 @@ // LevelBar.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/LinkButton.swift b/Sources/Core/View/Generated/LinkButton.swift index d8b0fac..8c8b8c8 100644 --- a/Sources/Core/View/Generated/LinkButton.swift +++ b/Sources/Core/View/Generated/LinkButton.swift @@ -2,7 +2,7 @@ // LinkButton.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ListBox.swift b/Sources/Core/View/Generated/ListBox.swift index 3334572..d26e2c1 100644 --- a/Sources/Core/View/Generated/ListBox.swift +++ b/Sources/Core/View/Generated/ListBox.swift @@ -2,7 +2,7 @@ // ListBox.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Menu.swift b/Sources/Core/View/Generated/Menu.swift index af59eac..be13586 100644 --- a/Sources/Core/View/Generated/Menu.swift +++ b/Sources/Core/View/Generated/Menu.swift @@ -2,7 +2,7 @@ // Menu.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/NavigationView.swift b/Sources/Core/View/Generated/NavigationView.swift index 645c68a..0f73791 100644 --- a/Sources/Core/View/Generated/NavigationView.swift +++ b/Sources/Core/View/Generated/NavigationView.swift @@ -2,7 +2,7 @@ // NavigationView.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Overlay.swift b/Sources/Core/View/Generated/Overlay.swift index 904286b..137061b 100644 --- a/Sources/Core/View/Generated/Overlay.swift +++ b/Sources/Core/View/Generated/Overlay.swift @@ -2,7 +2,7 @@ // Overlay.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/OverlaySplitView.swift b/Sources/Core/View/Generated/OverlaySplitView.swift index b88c628..222f7d3 100644 --- a/Sources/Core/View/Generated/OverlaySplitView.swift +++ b/Sources/Core/View/Generated/OverlaySplitView.swift @@ -2,7 +2,7 @@ // OverlaySplitView.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/PasswordEntryRow.swift b/Sources/Core/View/Generated/PasswordEntryRow.swift index 77bf827..abd461f 100644 --- a/Sources/Core/View/Generated/PasswordEntryRow.swift +++ b/Sources/Core/View/Generated/PasswordEntryRow.swift @@ -2,7 +2,7 @@ // PasswordEntryRow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Picture.swift b/Sources/Core/View/Generated/Picture.swift index 62adf9d..2a0bd60 100644 --- a/Sources/Core/View/Generated/Picture.swift +++ b/Sources/Core/View/Generated/Picture.swift @@ -2,7 +2,7 @@ // Picture.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Popover.swift b/Sources/Core/View/Generated/Popover.swift index d021e52..971003d 100644 --- a/Sources/Core/View/Generated/Popover.swift +++ b/Sources/Core/View/Generated/Popover.swift @@ -2,7 +2,7 @@ // Popover.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/PreferencesGroup.swift b/Sources/Core/View/Generated/PreferencesGroup.swift index 47bc015..a5d1ae8 100644 --- a/Sources/Core/View/Generated/PreferencesGroup.swift +++ b/Sources/Core/View/Generated/PreferencesGroup.swift @@ -2,7 +2,7 @@ // PreferencesGroup.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/PreferencesPage.swift b/Sources/Core/View/Generated/PreferencesPage.swift index c15d419..79d6033 100644 --- a/Sources/Core/View/Generated/PreferencesPage.swift +++ b/Sources/Core/View/Generated/PreferencesPage.swift @@ -2,7 +2,7 @@ // PreferencesPage.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/PreferencesRow.swift b/Sources/Core/View/Generated/PreferencesRow.swift index 122bf22..a91f79d 100644 --- a/Sources/Core/View/Generated/PreferencesRow.swift +++ b/Sources/Core/View/Generated/PreferencesRow.swift @@ -2,7 +2,7 @@ // PreferencesRow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ProgressBar.swift b/Sources/Core/View/Generated/ProgressBar.swift index 73fa154..f039973 100644 --- a/Sources/Core/View/Generated/ProgressBar.swift +++ b/Sources/Core/View/Generated/ProgressBar.swift @@ -2,7 +2,7 @@ // ProgressBar.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ScrolledWindow.swift b/Sources/Core/View/Generated/ScrolledWindow.swift index 9f4b3b4..97133c4 100644 --- a/Sources/Core/View/Generated/ScrolledWindow.swift +++ b/Sources/Core/View/Generated/ScrolledWindow.swift @@ -2,7 +2,7 @@ // ScrolledWindow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/SearchBar.swift b/Sources/Core/View/Generated/SearchBar.swift index 45ad59a..d4f82ba 100644 --- a/Sources/Core/View/Generated/SearchBar.swift +++ b/Sources/Core/View/Generated/SearchBar.swift @@ -2,7 +2,7 @@ // SearchBar.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/SearchEntry.swift b/Sources/Core/View/Generated/SearchEntry.swift index 7c3d01f..8252f08 100644 --- a/Sources/Core/View/Generated/SearchEntry.swift +++ b/Sources/Core/View/Generated/SearchEntry.swift @@ -2,7 +2,7 @@ // SearchEntry.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Separator.swift b/Sources/Core/View/Generated/Separator.swift index 70b1974..05e43e3 100644 --- a/Sources/Core/View/Generated/Separator.swift +++ b/Sources/Core/View/Generated/Separator.swift @@ -2,7 +2,7 @@ // Separator.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/SpinRow.swift b/Sources/Core/View/Generated/SpinRow.swift index 932a116..a09fe3a 100644 --- a/Sources/Core/View/Generated/SpinRow.swift +++ b/Sources/Core/View/Generated/SpinRow.swift @@ -2,7 +2,7 @@ // SpinRow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/Spinner.swift b/Sources/Core/View/Generated/Spinner.swift index e3bca43..621411e 100644 --- a/Sources/Core/View/Generated/Spinner.swift +++ b/Sources/Core/View/Generated/Spinner.swift @@ -2,7 +2,7 @@ // Spinner.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/SplitButton.swift b/Sources/Core/View/Generated/SplitButton.swift index 4d61daa..06042e4 100644 --- a/Sources/Core/View/Generated/SplitButton.swift +++ b/Sources/Core/View/Generated/SplitButton.swift @@ -2,7 +2,7 @@ // SplitButton.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/StatusPage.swift b/Sources/Core/View/Generated/StatusPage.swift index b821c29..fef649e 100644 --- a/Sources/Core/View/Generated/StatusPage.swift +++ b/Sources/Core/View/Generated/StatusPage.swift @@ -2,7 +2,7 @@ // StatusPage.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/SwitchRow.swift b/Sources/Core/View/Generated/SwitchRow.swift index afbaa21..6c6a077 100644 --- a/Sources/Core/View/Generated/SwitchRow.swift +++ b/Sources/Core/View/Generated/SwitchRow.swift @@ -2,7 +2,7 @@ // SwitchRow.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ToastOverlay.swift b/Sources/Core/View/Generated/ToastOverlay.swift index 6cd4d65..45b98c0 100644 --- a/Sources/Core/View/Generated/ToastOverlay.swift +++ b/Sources/Core/View/Generated/ToastOverlay.swift @@ -2,7 +2,7 @@ // ToastOverlay.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ToggleButton.swift b/Sources/Core/View/Generated/ToggleButton.swift index 762508b..514d567 100644 --- a/Sources/Core/View/Generated/ToggleButton.swift +++ b/Sources/Core/View/Generated/ToggleButton.swift @@ -2,7 +2,7 @@ // ToggleButton.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Core/View/Generated/ToolbarView.swift b/Sources/Core/View/Generated/ToolbarView.swift index 167c291..997a5d0 100644 --- a/Sources/Core/View/Generated/ToolbarView.swift +++ b/Sources/Core/View/Generated/ToolbarView.swift @@ -2,7 +2,7 @@ // ToolbarView.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw @@ -90,6 +90,31 @@ public struct ToolbarView: AdwaitaWidget { /// /// See [property@ToolbarView:top-bar-height]. var bottomBarHeight: Int? + /// Appearance of the bottom bars. + /// + /// If set to `ADW_TOOLBAR_FLAT`, bottom bars are flat and scrolling content + /// has a subtle undershoot shadow when touching them, same as the + /// [`.undershoot-bottom`](style-classes.html#undershoot-indicators) + /// style class. This works well for simple content, e.g. [class@StatusPage] or + /// [class@PreferencesPage], where the background at the bottom of the page is + /// uniform. Additionally, windows with sidebars should always use this style. + /// + /// Undershoot shadow is only present if a bottom bar is actually present and + /// visible. It is also never present if + /// [property@ToolbarView:extend-content-to-bottom-edge] is set to `TRUE`. + /// + /// If set to `ADW_TOOLBAR_RAISED`, bottom bars have an opaque background and a + /// persistent shadow, this is suitable for content such as + /// [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html), + /// where some elements are directly adjacent to the bottom bars, or + /// [class@TabView], where each page can have a different background. + /// + /// `ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the + /// shadow is replaced with a more subtle border. This can be useful for + /// applications like image viewers. + /// + /// See also [property@ToolbarView:top-bar-style]. + var bottomBarStyle: ToolbarStyle? /// The content widget. var content: (() -> Body)? /// Whether the content widget can extend behind bottom bars. @@ -134,6 +159,31 @@ public struct ToolbarView: AdwaitaWidget { /// /// See [property@ToolbarView:bottom-bar-height]. var topBarHeight: Int? + /// Appearance of the top bars. + /// + /// If set to `ADW_TOOLBAR_FLAT`, top bars are flat and scrolling content has a + /// subtle undershoot shadow when touching them, same as the + /// [`.undershoot-top`](style-classes.html#undershoot-indicators) + /// style class. This works well for simple content, e.g. [class@StatusPage] or + /// [class@PreferencesPage], where the background at the top of the page is + /// uniform. Additionally, windows with sidebars should always use this style. + /// + /// Undershoot shadow is only present if a top bar is actually present and + /// visible. It is also never present if + /// [property@ToolbarView:extend-content-to-top-edge] is set to `TRUE`. + /// + /// If set to `ADW_TOOLBAR_RAISED`, top bars have an opaque background and a + /// persistent shadow, this is suitable for content such as + /// [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html), + /// where some elements are directly adjacent to the top bars, or + /// [class@TabView], where each page can have a different background. + /// + /// `ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the + /// shadow is replaced with a more subtle border. This can be useful for + /// applications like image viewers. + /// + /// See also [property@ToolbarView:bottom-bar-style]. + var topBarStyle: ToolbarStyle? /// The body for the widget "bottom". var bottom: () -> Body = { [] } /// The body for the widget "top". @@ -183,6 +233,9 @@ public struct ToolbarView: AdwaitaWidget { public func update(_ storage: ViewStorage, data: WidgetData, updateProperties: Bool, type: Data.Type) where Data: ViewRenderData { storage.modify { widget in + if let bottomBarStyle, updateProperties, (storage.previousState as? Self)?.bottomBarStyle != bottomBarStyle { + adw_toolbar_view_set_bottom_bar_style(widget, bottomBarStyle.gtkValue) + } if let widget = storage.content["content"]?.first { content?().updateStorage(widget, data: data, updateProperties: updateProperties, type: type) } @@ -198,6 +251,9 @@ public struct ToolbarView: AdwaitaWidget { if let revealTopBars, updateProperties, (storage.previousState as? Self)?.revealTopBars != revealTopBars { adw_toolbar_view_set_reveal_top_bars(widget, revealTopBars.cBool) } + if let topBarStyle, updateProperties, (storage.previousState as? Self)?.topBarStyle != topBarStyle { + adw_toolbar_view_set_top_bar_style(widget, topBarStyle.gtkValue) + } if let bottomStorage = storage.content["bottom"] { for (index, view) in bottom().enumerated() { @@ -246,6 +302,36 @@ public struct ToolbarView: AdwaitaWidget { return newSelf } + /// Appearance of the bottom bars. + /// + /// If set to `ADW_TOOLBAR_FLAT`, bottom bars are flat and scrolling content + /// has a subtle undershoot shadow when touching them, same as the + /// [`.undershoot-bottom`](style-classes.html#undershoot-indicators) + /// style class. This works well for simple content, e.g. [class@StatusPage] or + /// [class@PreferencesPage], where the background at the bottom of the page is + /// uniform. Additionally, windows with sidebars should always use this style. + /// + /// Undershoot shadow is only present if a bottom bar is actually present and + /// visible. It is also never present if + /// [property@ToolbarView:extend-content-to-bottom-edge] is set to `TRUE`. + /// + /// If set to `ADW_TOOLBAR_RAISED`, bottom bars have an opaque background and a + /// persistent shadow, this is suitable for content such as + /// [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html), + /// where some elements are directly adjacent to the bottom bars, or + /// [class@TabView], where each page can have a different background. + /// + /// `ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the + /// shadow is replaced with a more subtle border. This can be useful for + /// applications like image viewers. + /// + /// See also [property@ToolbarView:top-bar-style]. + public func bottomBarStyle(_ bottomBarStyle: ToolbarStyle?) -> Self { + var newSelf = self + newSelf.bottomBarStyle = bottomBarStyle + return newSelf + } + /// The content widget. public func content(@ViewBuilder _ content: @escaping (() -> Body)) -> Self { var newSelf = self @@ -320,6 +406,36 @@ public struct ToolbarView: AdwaitaWidget { return newSelf } + /// Appearance of the top bars. + /// + /// If set to `ADW_TOOLBAR_FLAT`, top bars are flat and scrolling content has a + /// subtle undershoot shadow when touching them, same as the + /// [`.undershoot-top`](style-classes.html#undershoot-indicators) + /// style class. This works well for simple content, e.g. [class@StatusPage] or + /// [class@PreferencesPage], where the background at the top of the page is + /// uniform. Additionally, windows with sidebars should always use this style. + /// + /// Undershoot shadow is only present if a top bar is actually present and + /// visible. It is also never present if + /// [property@ToolbarView:extend-content-to-top-edge] is set to `TRUE`. + /// + /// If set to `ADW_TOOLBAR_RAISED`, top bars have an opaque background and a + /// persistent shadow, this is suitable for content such as + /// [utility panes](https://developer.gnome.org/hig/patterns/containers/utility-panes.html), + /// where some elements are directly adjacent to the top bars, or + /// [class@TabView], where each page can have a different background. + /// + /// `ADW_TOOLBAR_RAISED_BORDER` is similar to `ADW_TOOLBAR_RAISED`, but the + /// shadow is replaced with a more subtle border. This can be useful for + /// applications like image viewers. + /// + /// See also [property@ToolbarView:bottom-bar-style]. + public func topBarStyle(_ topBarStyle: ToolbarStyle?) -> Self { + var newSelf = self + newSelf.topBarStyle = topBarStyle + return newSelf + } + /// Set the body for "bottom". /// - Parameter body: The body. /// - Returns: The widget. diff --git a/Sources/Core/View/Generated/WindowTitle.swift b/Sources/Core/View/Generated/WindowTitle.swift index 81c67d3..7d00f4e 100644 --- a/Sources/Core/View/Generated/WindowTitle.swift +++ b/Sources/Core/View/Generated/WindowTitle.swift @@ -2,7 +2,7 @@ // WindowTitle.swift // Adwaita // -// Created by auto-generation on 09.04.25. +// Created by auto-generation on 15.04.25. // import CAdw diff --git a/Sources/Generation/GenerationConfiguration.swift b/Sources/Generation/GenerationConfiguration.swift index 15469c3..30e9686 100644 --- a/Sources/Generation/GenerationConfiguration.swift +++ b/Sources/Generation/GenerationConfiguration.swift @@ -150,8 +150,7 @@ struct GenerationConfiguration { staticWidgets: [ .init(name: "bottom", add: "adw_toolbar_view_add_bottom_bar"), .init(name: "top", add: "adw_toolbar_view_add_top_bar") - ], - excludeProperties: ["top-bar-style", "bottom-bar-style"] + ] ), .init(class: "ToastOverlay"), .init( @@ -331,7 +330,8 @@ struct GenerationConfiguration { "GdkPaintable*": "OpaquePointer", "NavigationPage": "NavigationPage", "ContentFit": "ContentFit", - "PolicyType": "ScrollbarVisibility" + "PolicyType": "ScrollbarVisibility", + "ToolbarStyle": "ToolbarStyle" ] /// Modifications for converting a Swift into a C type. @@ -340,7 +340,8 @@ struct GenerationConfiguration { "Int": "cInt", "UInt": "cInt", "ContentFit": "gtkValue", - "ScrollbarVisibility": "gtkValue" + "ScrollbarVisibility": "gtkValue", + "ToolbarStyle": "gtkValue" ] /// Default values for modifiers with a certain type.