From 04b705b1de82bdf0af725830160c961ae5336487 Mon Sep 17 00:00:00 2001 From: david-swift Date: Tue, 15 Oct 2024 15:31:09 +0200 Subject: [PATCH] Update documentation to latest changes --- Advanced/CreatingWidgets.md | 61 +++++++++--------- Advanced/PublishingApps.md | 4 +- Adwaita.md | 2 +- Basics/CreatingViews.md | 11 ++-- Basics/KeyboardShortcuts.md | 16 +++-- Basics/{Windows.md => WindowsDoc.md} | 60 ++++++++--------- .../{Array1.swift => Array1D.swift} | 0 .../{Array2.swift => Array2D.swift} | 0 .../{Array3.swift => Array3D.swift} | 0 .../contents.xcworkspacedata | 7 ++ .../UserInterfaceState.xcuserstate | Bin 0 -> 13545 bytes Resources/HelloWorld/AdwaitaTemplate.swift | 3 +- Resources/HelloWorld/Package.resolved | 42 ++++++++++++ Resources/HelloWorld/Package.swift | 10 +-- ...io.github.AparokshaUI.AdwaitaTemplate.json | 10 +-- Resources/Navigation/ContentView1.swift | 2 +- Resources/Navigation/ContentView2.swift | 2 +- Resources/Navigation/ContentView3.swift | 2 +- Resources/Navigation/ContentView4.swift | 2 +- Resources/Navigation/ContentView5.swift | 2 +- Resources/Navigation/ContentView6.swift | 2 +- Resources/Navigation/ContentView7.swift | 2 +- Resources/Navigation/ContentView8.swift | 2 +- Resources/Navigation/ContentView9.swift | 2 +- Resources/Navigation/Subtasks7.swift | 3 +- Resources/Navigation/TaskList23.swift | 8 +-- Resources/Navigation/TaskList24.swift | 2 +- Resources/Navigation/TaskList25.swift | 2 +- Resources/Navigation/TaskList26.swift | 2 +- Resources/Navigation/TaskList27.swift | 2 +- Resources/Navigation/TaskList28.swift | 2 +- Resources/Navigation/TaskList29.swift | 2 +- Resources/Navigation/TaskList30.swift | 2 +- Resources/Navigation/TaskList31.swift | 2 +- Resources/Polishing/ContentView10.swift | 2 +- Resources/Polishing/ContentView11.swift | 2 +- Resources/Polishing/ContentView12.swift | 2 +- Resources/Polishing/ContentView13.swift | 2 +- Resources/Polishing/Subtasks8.swift | 3 +- Resources/Polishing/Subtasks9.swift | 3 +- Resources/Polishing/TaskList32.swift | 2 +- Resources/Polishing/TaskList33.swift | 2 +- Resources/Polishing/TaskList34.swift | 2 +- Resources/TaskList/Subtasks1.swift | 3 +- Resources/TaskList/Subtasks2.swift | 3 +- Resources/TaskList/Subtasks3.swift | 3 +- Resources/TaskList/Subtasks4.swift | 3 +- Resources/TaskList/Subtasks5.swift | 3 +- Resources/TaskList/Subtasks6.swift | 3 +- Resources/TaskList/TaskList10.swift | 4 +- Resources/TaskList/TaskList11.swift | 3 +- Resources/TaskList/TaskList12.swift | 4 +- Resources/TaskList/TaskList13.swift | 6 +- Resources/TaskList/TaskList14.swift | 8 +-- Resources/TaskList/TaskList15.swift | 8 +-- Resources/TaskList/TaskList16.swift | 8 +-- Resources/TaskList/TaskList17.swift | 10 +-- Resources/TaskList/TaskList18.swift | 12 ++-- Resources/TaskList/TaskList19.swift | 12 ++-- Resources/TaskList/TaskList20.swift | 14 ++-- Resources/TaskList/TaskList21.swift | 14 ++-- Resources/TaskList/TaskList22.swift | 14 ++-- Resources/TaskList/TaskList7.swift | 2 +- Resources/TaskList/TaskList8.swift | 2 +- Resources/TaskList/TaskList9.swift | 4 +- Resources/Views/AdwaitaTemplate1.swift | 3 +- Resources/Views/AdwaitaTemplate2.swift | 7 +- Resources/Views/AdwaitaTemplate3.swift | 7 +- Resources/Views/AdwaitaTemplate4.swift | 7 +- Resources/Views/AdwaitaTemplate5.swift | 7 +- Tutorial/Data/AppFlatpakData.tutorial | 2 +- Tutorial/Data/Flatpak.tutorial | 9 --- Tutorial/Essentials/HelloWorld.tutorial | 2 +- Tutorial/Essentials/Views.tutorial | 4 +- Tutorial/GNOME/GNOME.tutorial | 10 +-- Tutorial/GNOME/SetUpGNOME.tutorial | 2 +- .../Swift/DeclarativeProgramming.tutorial | 6 +- Tutorial/UserInterface/Details.tutorial | 2 +- Tutorial/UserInterface/Navigation.tutorial | 4 +- 79 files changed, 268 insertions(+), 238 deletions(-) rename Basics/{Windows.md => WindowsDoc.md} (72%) rename Resources/Declarative/{Array1.swift => Array1D.swift} (100%) rename Resources/Declarative/{Array2.swift => Array2D.swift} (100%) rename Resources/Declarative/{Array3.swift => Array3D.swift} (100%) create mode 100644 Resources/HelloWorld/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata create mode 100644 Resources/HelloWorld/.swiftpm/xcode/package.xcworkspace/xcuserdata/david-swift.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 Resources/HelloWorld/Package.resolved delete mode 100644 Tutorial/Data/Flatpak.tutorial diff --git a/Advanced/CreatingWidgets.md b/Advanced/CreatingWidgets.md index 27f55e9..747346f 100644 --- a/Advanced/CreatingWidgets.md +++ b/Advanced/CreatingWidgets.md @@ -19,7 +19,7 @@ struct CustomText: Widget { } ``` This widget can be called in a view body using `CustomText(text: "Hello, world!")`. -Now, add the two functions required by the protocol: +Now, add the function required by the protocol: ```swift import CAdw @@ -27,37 +27,36 @@ struct CustomText: Widget { var text: String - public func container(modifiers: [(View) -> View]) -> ViewStorage { } - public func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) { } - -} -``` -Import CAdw which exposes the whole C Libadwaita and Gtk API to Swift. - -## The `container(modifiers:)` function -This function initializes the widget when the widget appears for the first time. -It expects a ``ViewStorage`` as the return type. -In our case, this function is very simple: -```swift -func container(modifiers: [(View) -> View]) -> ViewStorage { - .init(gtk_label_new(text)?.opaque()) -} -``` - -## The `update(_:modifiers:updateProperties:)` function -Whenever a state of the app changes, the ``Widget/update(_:modifiers:updateProperties:)`` function of the widget gets called. -You get the view storage that you have previously initialized as a parameter. -Update the storage to reflect the current state of the widget: -```swift -func update(_ storage: ViewStorage, modifiers: [(View) -> View], updateProperties: Bool) { - if updateProperties { - gtk_label_set_label(storage.pointer, text) + func initializeWidget() -> Any { + gtk_label_new(text)?.opaque() } + } ``` -## Containers -Some widgets act as containers that accept other widgets as children. -In that case, use the ``ViewStorage``'s `content` property for storing their view storages. -In the ``Widget/update(_:modifiers:updateProperties:)`` function, update the children's storages. -Take a look at the code of the container widgets in this library as a reference. +## Updates +The widget will be rendered as expected, but updates do not work currently. +To mark properties as a widget property, use the ``Property`` property wrapper. + +```swift +import CAdw + +struct CustomText: Widget { + + @Property( + set: { gtk_label_set_label($0, text) }, + pointer: OpaquePointer.self + ) + var text: String + + func initializeWidget() -> Any { + gtk_label_new(text)?.opaque() + } + +} +``` + +## More Complex Widgets +If a property should allow two-way traffic (able to modify inside of the widget, e.g. the `isOn` property of a checkbox which can be updated when the user clicks the checkbox), use ``BindingProperty``. For views, use ``ViewProperty``. + +More help is available [here](https://meta.aparoksha.dev/documentation/meta/createbackend). diff --git a/Advanced/PublishingApps.md b/Advanced/PublishingApps.md index 958ae3a..f53aa7a 100644 --- a/Advanced/PublishingApps.md +++ b/Advanced/PublishingApps.md @@ -12,13 +12,13 @@ Find detailed information in the [Flatpak documentation](https://docs.flatpak.or This is the only code that should be submitted to Flathub. There will be a new repository created under `flathub/app-id` that hosts the manifest. -### SDK Extension for Swift 5 +### SDK Extension for Swift 6 I recommend using the SDK Extension for building the app. Add the following snippet. ```json "sdk-extensions": [ - "org.freedesktop.Sdk.Extension.swift5" + "org.freedesktop.Sdk.Extension.swift6" ] ``` diff --git a/Adwaita.md b/Adwaita.md index 6f5dbcd..36f7fbf 100644 --- a/Adwaita.md +++ b/Adwaita.md @@ -85,7 +85,7 @@ Find more information in the [template repository](https://github.com/AparokshaU ### Basics - -- +- - ### Advanced diff --git a/Basics/CreatingViews.md b/Basics/CreatingViews.md index f27faaa..5762806 100644 --- a/Basics/CreatingViews.md +++ b/Basics/CreatingViews.md @@ -11,15 +11,16 @@ import Adwaita @main struct HelloWorld: App { - let id = "io.github.david_swift.HelloWorld" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.HelloWorld") var scene: Scene { Window(id: "content") { _ in // These are the views: - HeaderBar.empty() Text("Hello, world!") .padding() + .topToolbar { + HeaderBar.empty() + } } } @@ -38,9 +39,11 @@ Create custom views by declaring types that conform to the ``View`` protocol: struct ContentView: View { var view: Body { - HeaderBar.empty() Text("Hello, world!") .padding() + .topToolbar { + HeaderBar.empty() + } } } diff --git a/Basics/KeyboardShortcuts.md b/Basics/KeyboardShortcuts.md index 3fdb11b..507bdd0 100644 --- a/Basics/KeyboardShortcuts.md +++ b/Basics/KeyboardShortcuts.md @@ -26,14 +26,15 @@ import Adwaita @main struct HelloWorld: App { - let id = "io.github.david_swift.HelloWorld" - var app: GTUIApp! + let app = AdwaitaApp(id: "io.github.david_swift.HelloWorld") var scene: Scene { Window(id: "content") { _ in - HeaderBar.empty() Text("Hello, world!") .padding() + .topToolbar { + HeaderBar.empty() + } } // Add the shortcut "Ctrl + W" for closing the window .keyboardShortcut("w".ctrl()) { window in @@ -52,14 +53,15 @@ import Adwaita @main struct HelloWorld: App { - let id = "io.github.david_swift.HelloWorld" - var app: GTUIApp! + let app = AdwaitaApp(id: "io.github.david_swift.HelloWorld") var scene: Scene { Window(id: "content") { _ in - HeaderBar.empty() Text("Hello, world!") .padding() + .topToolbar { + HeaderBar.empty() + } } // Add the shortcut "Ctrl + Q" for terminating the app .appKeyboardShortcut("q".ctrl()) { app in @@ -76,7 +78,7 @@ Here is an example using a menu button: ```swift struct TestView: View { - var app: GTUIApp + var app: AdwaitaApp var view: Body { Menu(icon: .default(icon: .openMenu), app: app) { diff --git a/Basics/Windows.md b/Basics/WindowsDoc.md similarity index 72% rename from Basics/Windows.md rename to Basics/WindowsDoc.md index b36e5ee..028d615 100644 --- a/Basics/Windows.md +++ b/Basics/WindowsDoc.md @@ -11,20 +11,23 @@ Whenever the last one disappears, the app terminates. @main struct HelloWorld: App { - let id = "io.github.david_swift.HelloWorld" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.HelloWorld") var scene: Scene { Window(id: "content") { _ in - HeaderBar.empty() Text("Hello, world!") .padding() + .topToolbar { + HeaderBar.empty() + } } // Add a second window: Window(id: "window-2") { _ in - HeaderBar.empty() Text("Window 2") .padding() + .topToolbar { + HeaderBar.empty() + } } } @@ -39,22 +42,25 @@ Another use case is showing a window: @main struct HelloWorld: App { - let id = "io.github.david_swift.HelloWorld" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.HelloWorld") var scene: Scene { Window(id: "content") { _ in - HeaderBar.empty() Text("Hello, world!") .padding() + .topToolbar { + HeaderBar.empty() + } } Window(id: "control") { _ in - HeaderBar.empty() Button("Show Window") { // Show the window with the identifier "content": app.showWindow("content") } .padding() + .topToolbar { + HeaderBar.empty() + } } } @@ -66,70 +72,64 @@ It should be used for opening windows that cannot be presented more than once and for moving a window that is already open into the foreground. ## Adding windows -You can call the ``GTUIApp/addWindow(_:parent:)`` function instead of ``GTUIApp/showWindow(_:)`` +You can call the ``AdwaitaApp/addWindow(_:)`` function instead of ``AdwaitaApp/showWindow(_:)`` if you want to add and focus another instance of a window type: ```swift @main struct HelloWorld: App { - let id = "io.github.david_swift.HelloWorld" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.HelloWorld") var scene: Scene { Window(id: "content") { _ in - HeaderBar.empty() Text("Hello, world!") .padding() + .topToolbar { + HeaderBar.empty() + } } Window(id: "control") { _ in - HeaderBar.empty() Button("Add Window") { // Add a new instance of the "content" window type app.addWindow("content") } .padding() + .topToolbar { + HeaderBar.empty() + } } } } ``` -It can be used to add an overlay window to a certain instance of a window type -by specifying the `parent` parameter, e.g. in the example above: -```swift -Window(id: "control") { window in - HeaderBar.empty() - Button("Add Child Window") { - // Add the new instance as a child window of this window - app.addWindow("content", parent: window) - } - .padding() -} -``` ## Customizing the initial number of windows + By default, every window type of the app's scene appears once when the app starts. It's possible to customize how many windows are being presented at the app's startup: ```swift @main struct HelloWorld: App { - let id = "io.github.david_swift.HelloWorld" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.HelloWorld") var scene: Scene { // Open no window of the "content" type Window(id: "content", open: 0) { _ in - HeaderBar.empty() Text("Hello, world!") .padding() + .topToolbar { + HeaderBar.empty() + } } // Open two windows of the "control" type Window(id: "control", open: 2) { _ in - HeaderBar.empty() Button("Show Window") { app.addWindow("content") } - .padding() + .topToolbar { + HeaderBar.empty() + } } } diff --git a/Resources/Declarative/Array1.swift b/Resources/Declarative/Array1D.swift similarity index 100% rename from Resources/Declarative/Array1.swift rename to Resources/Declarative/Array1D.swift diff --git a/Resources/Declarative/Array2.swift b/Resources/Declarative/Array2D.swift similarity index 100% rename from Resources/Declarative/Array2.swift rename to Resources/Declarative/Array2D.swift diff --git a/Resources/Declarative/Array3.swift b/Resources/Declarative/Array3D.swift similarity index 100% rename from Resources/Declarative/Array3.swift rename to Resources/Declarative/Array3D.swift diff --git a/Resources/HelloWorld/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata b/Resources/HelloWorld/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Resources/HelloWorld/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Resources/HelloWorld/.swiftpm/xcode/package.xcworkspace/xcuserdata/david-swift.xcuserdatad/UserInterfaceState.xcuserstate b/Resources/HelloWorld/.swiftpm/xcode/package.xcworkspace/xcuserdata/david-swift.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..08f7a12c7d1d08a0ae718edd0ec342aafe6bc946 GIT binary patch literal 13545 zcmeHtcYKrO*Y`C#XrbipNYiFDyKRy#HVV>03shF^VpBtNw+*C8Nm5Ed@roh>DkyGT zG$075;CLJ;f&<(lL&SlC%5dO9MO-}RzV9Y&Y329(yzlRQpMRd_(~SE%*FNWazUN%m z>?XI%AIQ%?h%h3Eq9_!NVo)rKpJJNN`}{7iXR68Jt8H+>uS!$E+cd@Gojr%I4fvA~ zUb?o1lTEA`$G7s%qIRKus27T>st7m&Ji}WPaVF}G`XB{LL+L07<)S>4j|xyf)E^B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qC(af!1#b-8-F+NqwWp08e@UZ}oC9aLYZ zzFvK!dX4&F_2cT-)$gdkRG(J=p#Dkyv-&ShnntNnYldq^Xo@tWG$oobno`X;%>+%I zra?1Dr}z(e~2DYx`*XYK>a6HdC9ewP|y-dD;SPf9*i+VC_(CwYFJ%kM?=( zXBp8M*%@Oq>NA#P+?;Vs#_EjQGw#pWknwQF=8Q)&9?RI4u_NQK?c z7y9G+llrgp-{?>4e>EUOZ-dd0Zy0L0)G*vI!cb(m+%VoS(NJb6H&hyYhE;|q3~w0@ z8@@7pV>oU2-teR0jNuog@#x$eSs5V}1Txi^AJY>SA0#mJN zwdp}q$h6+H(X`35#kAA(y6GL$Uei9)0n<^_Nz+%RZ%n66Kbw9v{bu^z^rt!AtT0>6 z{mq5uG3HY9IP(N^rMcQX#XQYC!_1p~X1_ULo^M`YzTUjdyuy65d6oHA^BVJm<~H*> z^F!t*%+HyhH}5d-H19FLZhq7Jw)tK2Ve>KbcjjNrXU*r#e^`hm$`WJgWr??_EoMtU zOQ~g?WrAgr7uXN}Domo*`4QkFaG#;mPb z`?7w?R%MUKo|S!d_L}T<*&DJqWpBxTDtkxv&g_@6U&-E`{aW_H><_a)$^I<+%j}cc zUuS=7jkDUVL#>xt3$3H9W3A(?6ReZ0v#j;j2J0Mai*>OzXkB8x!Mf6VtMzv4oz}ap zFImsnQfwNV)i&HV!Zy}cWoxj_v9;K)vMsg+ZA)#-Z8zF(w%uoIv#qy1YJ1A|oNbTo z9ou`h1GYo9BetWqFKj1lr|fa|BKsVBi+zE;)xOBS%)Z>d!hVze9{U>mz4rU<8|<6x zTkMb8x7&BvciLaJ@3y~Yf6sov{=WSK`%(Kb`xo|a?cdvf6a!U6i1bOnkv_xk_A~zt DS{HKL literal 0 HcmV?d00001 diff --git a/Resources/HelloWorld/AdwaitaTemplate.swift b/Resources/HelloWorld/AdwaitaTemplate.swift index 823eff7..cfcb031 100644 --- a/Resources/HelloWorld/AdwaitaTemplate.swift +++ b/Resources/HelloWorld/AdwaitaTemplate.swift @@ -6,8 +6,7 @@ import Adwaita @main struct AdwaitaTemplate: App { - let id = "io.github.AparokshaUI.AdwaitaTemplate" - var app: GTUIApp! + let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate") var scene: Scene { Window(id: "main") { window in diff --git a/Resources/HelloWorld/Package.resolved b/Resources/HelloWorld/Package.resolved new file mode 100644 index 0000000..98a764e --- /dev/null +++ b/Resources/HelloWorld/Package.resolved @@ -0,0 +1,42 @@ +{ + "originHash" : "af6fb6b129be2ee0c0916fac48a05560178b7f22f7940f6ab37ceda75820b4e4", + "pins" : [ + { + "identity" : "adwaita", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AparokshaUI/Adwaita", + "state" : { + "revision" : "c82957e2398a766458ff22129db26b46de75248b", + "version" : "0.2.6" + } + }, + { + "identity" : "levenshteintransformations", + "kind" : "remoteSourceControl", + "location" : "https://github.com/david-swift/LevenshteinTransformations", + "state" : { + "revision" : "002c3ae5c48f30d61c96045fd3ceb9928aa778d2", + "version" : "0.1.3" + } + }, + { + "identity" : "localized", + "kind" : "remoteSourceControl", + "location" : "https://github.com/AparokshaUI/Localized", + "state" : { + "revision" : "8135771fc0852cdea4361674d964d1c2e048db05", + "version" : "0.3.0" + } + }, + { + "identity" : "yams", + "kind" : "remoteSourceControl", + "location" : "https://github.com/jpsim/Yams", + "state" : { + "revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d", + "version" : "5.1.3" + } + } + ], + "version" : 3 +} diff --git a/Resources/HelloWorld/Package.swift b/Resources/HelloWorld/Package.swift index 5b0f9d9..6960dec 100644 --- a/Resources/HelloWorld/Package.swift +++ b/Resources/HelloWorld/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version: 5.8 +// swift-tools-version: 6.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -9,15 +9,15 @@ let package = Package( .macOS(.v13) ], dependencies: [ - .package(url: "https://github.com/AparokshaUI/Adwaita", from: "0.2.0"), - .package(url: "https://github.com/AparokshaUI/Localized", from: "0.2.0") + .package(url: "https://git.aparoksha.dev/aparoksha/adwaita-swift", from: "0.1.0"), + .package(url: "https://git.aparoksha.dev/aparoksha/localized", from: "0.1.0") ], targets: [ .executableTarget( name: "AdwaitaTemplate", dependencies: [ - .product(name: "Adwaita", package: "Adwaita"), - .product(name: "Localized", package: "Localized") + .product(name: "Adwaita", package: "adwaita-swift"), + .product(name: "Localized", package: "localized") ], path: "Sources", resources: [ diff --git a/Resources/HelloWorld/io.github.AparokshaUI.AdwaitaTemplate.json b/Resources/HelloWorld/io.github.AparokshaUI.AdwaitaTemplate.json index 6ee9059..dc46630 100644 --- a/Resources/HelloWorld/io.github.AparokshaUI.AdwaitaTemplate.json +++ b/Resources/HelloWorld/io.github.AparokshaUI.AdwaitaTemplate.json @@ -1,10 +1,10 @@ { "app-id": "io.github.AparokshaUI.AdwaitaTemplate", "runtime": "org.gnome.Platform", - "runtime-version": "46", + "runtime-version": "47", "sdk": "org.gnome.Sdk", "sdk-extensions": [ - "org.freedesktop.Sdk.Extension.swift5" + "org.freedesktop.Sdk.Extension.swift6" ], "command": "AdwaitaTemplate", "finish-args": [ @@ -14,8 +14,8 @@ "--socket=wayland" ], "build-options": { - "append-path": "/usr/lib/sdk/swift5/bin", - "prepend-ld-library-path": "/usr/lib/sdk/swift5/lib" + "append-path": "/usr/lib/sdk/swift6/bin", + "prepend-ld-library-path": "/usr/lib/sdk/swift6/lib" }, "cleanup": [ "/include", @@ -40,7 +40,7 @@ } ], "build-commands": [ - "swift build -c release --static-swift-stdlib", + "swift build -c debug --static-swift-stdlib", "install -Dm755 .build/release/AdwaitaTemplate /app/bin/AdwaitaTemplate", "install -Dm644 data/io.github.AparokshaUI.AdwaitaTemplate.metainfo.xml $DESTDIR/app/share/metainfo/io.github.AparokshaUI.AdwaitaTemplate.metainfo.xml", "install -Dm644 data/io.github.AparokshaUI.AdwaitaTemplate.desktop $DESTDIR/app/share/applications/io.github.AparokshaUI.AdwaitaTemplate.desktop", diff --git a/Resources/Navigation/ContentView1.swift b/Resources/Navigation/ContentView1.swift index d40e91e..46ef9ee 100644 --- a/Resources/Navigation/ContentView1.swift +++ b/Resources/Navigation/ContentView1.swift @@ -7,7 +7,7 @@ import Adwaita struct ContentView: View { - var app: GTUIApp + var app: AdwaitaApp var view: Body { Text("Hello, world!") diff --git a/Resources/Navigation/ContentView2.swift b/Resources/Navigation/ContentView2.swift index 7c1c000..69c1344 100644 --- a/Resources/Navigation/ContentView2.swift +++ b/Resources/Navigation/ContentView2.swift @@ -8,7 +8,7 @@ import Adwaita struct ContentView: View { @State("tasks") private var tasks: [Task] = [] - var app: GTUIApp + var app: AdwaitaApp var view: Body { Text("Hello, world!") diff --git a/Resources/Navigation/ContentView3.swift b/Resources/Navigation/ContentView3.swift index d52b09a..817207f 100644 --- a/Resources/Navigation/ContentView3.swift +++ b/Resources/Navigation/ContentView3.swift @@ -9,7 +9,7 @@ struct ContentView: View { @State("tasks") private var tasks: [Task] = [] @State private var destination: NavigationStack = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Navigation/ContentView4.swift b/Resources/Navigation/ContentView4.swift index 5f04bbf..7e2da83 100644 --- a/Resources/Navigation/ContentView4.swift +++ b/Resources/Navigation/ContentView4.swift @@ -9,7 +9,7 @@ struct ContentView: View { @State("tasks") private var tasks: [Task] = [] @State private var destination: NavigationStack = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Navigation/ContentView5.swift b/Resources/Navigation/ContentView5.swift index 1dc23bc..6b94f78 100644 --- a/Resources/Navigation/ContentView5.swift +++ b/Resources/Navigation/ContentView5.swift @@ -9,7 +9,7 @@ struct ContentView: View { @State("tasks") private var tasks: [Task] = [] @State private var destination: NavigationStack = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Navigation/ContentView6.swift b/Resources/Navigation/ContentView6.swift index fc6b245..c92bc82 100644 --- a/Resources/Navigation/ContentView6.swift +++ b/Resources/Navigation/ContentView6.swift @@ -9,7 +9,7 @@ struct ContentView: View { @State("tasks") private var tasks: [Task] = [] @State private var destination: NavigationStack> = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Navigation/ContentView7.swift b/Resources/Navigation/ContentView7.swift index d69ac87..61e34db 100644 --- a/Resources/Navigation/ContentView7.swift +++ b/Resources/Navigation/ContentView7.swift @@ -9,7 +9,7 @@ struct ContentView: View { @State("tasks") private var tasks: [Task] = [] @State private var destination: NavigationStack> = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Navigation/ContentView8.swift b/Resources/Navigation/ContentView8.swift index b16a7e4..2a29de0 100644 --- a/Resources/Navigation/ContentView8.swift +++ b/Resources/Navigation/ContentView8.swift @@ -9,7 +9,7 @@ struct ContentView: View { @State("tasks") private var tasks: [Task] = [] @State private var destination: NavigationStack> = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Navigation/ContentView9.swift b/Resources/Navigation/ContentView9.swift index db67867..dd23700 100644 --- a/Resources/Navigation/ContentView9.swift +++ b/Resources/Navigation/ContentView9.swift @@ -9,7 +9,7 @@ struct ContentView: View { @State("tasks") private var tasks: [Task] = [] @State private var destination: NavigationStack> = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Navigation/Subtasks7.swift b/Resources/Navigation/Subtasks7.swift index bf1e014..962465d 100644 --- a/Resources/Navigation/Subtasks7.swift +++ b/Resources/Navigation/Subtasks7.swift @@ -8,8 +8,7 @@ import Adwaita @main struct Subtasks: App { - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { _ in diff --git a/Resources/Navigation/TaskList23.swift b/Resources/Navigation/TaskList23.swift index dea1586..8d25b82 100644 --- a/Resources/Navigation/TaskList23.swift +++ b/Resources/Navigation/TaskList23.swift @@ -12,7 +12,7 @@ struct TaskList: View { @State private var showAddDialog = false @State private var addDialogText = "" @State private var focusEntry: Signal = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { ScrollView { @@ -33,7 +33,7 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } @@ -43,7 +43,7 @@ struct TaskList: View { .frame(maxWidth: 500) } - var dialog: View { + var dialog: AnyView { Form { EntryRow(Loc.label, text: $addDialogText) .entryActivated { @@ -69,7 +69,7 @@ struct TaskList: View { } } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { diff --git a/Resources/Navigation/TaskList24.swift b/Resources/Navigation/TaskList24.swift index f9a0dd5..d989ab1 100644 --- a/Resources/Navigation/TaskList24.swift +++ b/Resources/Navigation/TaskList24.swift @@ -12,7 +12,7 @@ struct TaskList: View { @State private var showAddDialog = false @State private var addDialogText = "" @State private var focusEntry: Signal = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { ScrollView { diff --git a/Resources/Navigation/TaskList25.swift b/Resources/Navigation/TaskList25.swift index 53d529b..53fc29f 100644 --- a/Resources/Navigation/TaskList25.swift +++ b/Resources/Navigation/TaskList25.swift @@ -12,7 +12,7 @@ struct TaskList: View { @State private var showAddDialog = false @State private var addDialogText = "" @State private var focusEntry: Signal = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { ScrollView { diff --git a/Resources/Navigation/TaskList26.swift b/Resources/Navigation/TaskList26.swift index 95f2200..1d6f420 100644 --- a/Resources/Navigation/TaskList26.swift +++ b/Resources/Navigation/TaskList26.swift @@ -13,7 +13,7 @@ struct TaskList: View { @State private var addDialogText = "" @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false - var app: GTUIApp + var app: AdwaitaApp var view: Body { ScrollView { diff --git a/Resources/Navigation/TaskList27.swift b/Resources/Navigation/TaskList27.swift index 1fa6ab4..41e6a30 100644 --- a/Resources/Navigation/TaskList27.swift +++ b/Resources/Navigation/TaskList27.swift @@ -13,7 +13,7 @@ struct TaskList: View { @State private var addDialogText = "" @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false - var app: GTUIApp + var app: AdwaitaApp var view: Body { ScrollView { diff --git a/Resources/Navigation/TaskList28.swift b/Resources/Navigation/TaskList28.swift index f31be1d..831e841 100644 --- a/Resources/Navigation/TaskList28.swift +++ b/Resources/Navigation/TaskList28.swift @@ -13,7 +13,7 @@ struct TaskList: View { @State private var addDialogText = "" @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false - var app: GTUIApp + var app: AdwaitaApp var deleteTask: (() -> Void)? var view: Body { diff --git a/Resources/Navigation/TaskList29.swift b/Resources/Navigation/TaskList29.swift index 395fbde..e2afafb 100644 --- a/Resources/Navigation/TaskList29.swift +++ b/Resources/Navigation/TaskList29.swift @@ -13,7 +13,7 @@ struct TaskList: View { @State private var addDialogText = "" @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false - var app: GTUIApp + var app: AdwaitaApp var deleteTask: (() -> Void)? var view: Body { diff --git a/Resources/Navigation/TaskList30.swift b/Resources/Navigation/TaskList30.swift index 00705ce..12d5368 100644 --- a/Resources/Navigation/TaskList30.swift +++ b/Resources/Navigation/TaskList30.swift @@ -13,7 +13,7 @@ struct TaskList: View { @State private var addDialogText = "" @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false - var app: GTUIApp + var app: AdwaitaApp var deleteTask: (() -> Void)? var view: Body { diff --git a/Resources/Navigation/TaskList31.swift b/Resources/Navigation/TaskList31.swift index 5a5fc30..0561c54 100644 --- a/Resources/Navigation/TaskList31.swift +++ b/Resources/Navigation/TaskList31.swift @@ -13,7 +13,7 @@ struct TaskList: View { @State private var addDialogText = "" @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false - var app: GTUIApp + var app: AdwaitaApp var deleteTask: (() -> Void)? var view: Body { diff --git a/Resources/Polishing/ContentView10.swift b/Resources/Polishing/ContentView10.swift index eb62d97..6fda617 100644 --- a/Resources/Polishing/ContentView10.swift +++ b/Resources/Polishing/ContentView10.swift @@ -9,7 +9,7 @@ struct ContentView: WindowView { @State("tasks") private var tasks: [Task] = [] @State private var destination: NavigationStack> = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Polishing/ContentView11.swift b/Resources/Polishing/ContentView11.swift index d2ecd59..f5b2229 100644 --- a/Resources/Polishing/ContentView11.swift +++ b/Resources/Polishing/ContentView11.swift @@ -12,7 +12,7 @@ struct ContentView: WindowView { @State("width") private var width = 500 @State("height") private var height = 400 @State("maximized") private var maximized = false - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Polishing/ContentView12.swift b/Resources/Polishing/ContentView12.swift index 61db432..596fc95 100644 --- a/Resources/Polishing/ContentView12.swift +++ b/Resources/Polishing/ContentView12.swift @@ -12,7 +12,7 @@ struct ContentView: WindowView { @State("width") private var width = 500 @State("height") private var height = 450 @State("maximized") private var maximized = false - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Polishing/ContentView13.swift b/Resources/Polishing/ContentView13.swift index 8c74699..b879652 100644 --- a/Resources/Polishing/ContentView13.swift +++ b/Resources/Polishing/ContentView13.swift @@ -12,7 +12,7 @@ struct ContentView: WindowView { @State("width") private var width = 500 @State("height") private var height = 450 @State("maximized") private var maximized = false - var app: GTUIApp + var app: AdwaitaApp var view: Body { NavigationView($destination, "Subtasks") { task in diff --git a/Resources/Polishing/Subtasks8.swift b/Resources/Polishing/Subtasks8.swift index b56df0e..fe99acc 100644 --- a/Resources/Polishing/Subtasks8.swift +++ b/Resources/Polishing/Subtasks8.swift @@ -8,8 +8,7 @@ import Adwaita @main struct Subtasks: App { - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { _ in diff --git a/Resources/Polishing/Subtasks9.swift b/Resources/Polishing/Subtasks9.swift index 9510879..5969537 100644 --- a/Resources/Polishing/Subtasks9.swift +++ b/Resources/Polishing/Subtasks9.swift @@ -8,8 +8,7 @@ import Adwaita @main struct Subtasks: App { - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { _ in diff --git a/Resources/Polishing/TaskList32.swift b/Resources/Polishing/TaskList32.swift index 5103a88..0f9d591 100644 --- a/Resources/Polishing/TaskList32.swift +++ b/Resources/Polishing/TaskList32.swift @@ -13,7 +13,7 @@ struct TaskList: View { @State private var addDialogText = "" @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false - var app: GTUIApp + var app: AdwaitaApp var deleteTask: (() -> Void)? var view: Body { diff --git a/Resources/Polishing/TaskList33.swift b/Resources/Polishing/TaskList33.swift index af26acd..5cbf9dd 100644 --- a/Resources/Polishing/TaskList33.swift +++ b/Resources/Polishing/TaskList33.swift @@ -14,7 +14,7 @@ struct TaskList: View { @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false @State private var showAboutDialog = false - var app: GTUIApp + var app: AdwaitaApp var deleteTask: (() -> Void)? var view: Body { diff --git a/Resources/Polishing/TaskList34.swift b/Resources/Polishing/TaskList34.swift index c0402af..65e4f2e 100644 --- a/Resources/Polishing/TaskList34.swift +++ b/Resources/Polishing/TaskList34.swift @@ -14,7 +14,7 @@ struct TaskList: View { @State private var focusEntry: Signal = .init() @State private var showDeleteDialog = false @State private var showAboutDialog = false - var app: GTUIApp + var app: AdwaitaApp var deleteTask: (() -> Void)? var view: Body { diff --git a/Resources/TaskList/Subtasks1.swift b/Resources/TaskList/Subtasks1.swift index 8155897..033a496 100644 --- a/Resources/TaskList/Subtasks1.swift +++ b/Resources/TaskList/Subtasks1.swift @@ -6,8 +6,7 @@ import Adwaita @main struct Subtasks: App { - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { window in diff --git a/Resources/TaskList/Subtasks2.swift b/Resources/TaskList/Subtasks2.swift index b830dbe..e3310dd 100644 --- a/Resources/TaskList/Subtasks2.swift +++ b/Resources/TaskList/Subtasks2.swift @@ -8,8 +8,7 @@ import Adwaita @main struct Subtasks: App { - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { window in diff --git a/Resources/TaskList/Subtasks3.swift b/Resources/TaskList/Subtasks3.swift index e96ffa1..9bb51a3 100644 --- a/Resources/TaskList/Subtasks3.swift +++ b/Resources/TaskList/Subtasks3.swift @@ -13,8 +13,7 @@ struct Subtasks: App { .init(label: "World"), .init(label: "Complete", done: true) ] - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { window in diff --git a/Resources/TaskList/Subtasks4.swift b/Resources/TaskList/Subtasks4.swift index ebfc088..9d3ce8c 100644 --- a/Resources/TaskList/Subtasks4.swift +++ b/Resources/TaskList/Subtasks4.swift @@ -13,8 +13,7 @@ struct Subtasks: App { .init(label: "World"), .init(label: "Complete", done: true) ] - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { window in diff --git a/Resources/TaskList/Subtasks5.swift b/Resources/TaskList/Subtasks5.swift index 7eecd90..6d30e9a 100644 --- a/Resources/TaskList/Subtasks5.swift +++ b/Resources/TaskList/Subtasks5.swift @@ -13,8 +13,7 @@ struct Subtasks: App { .init(label: "World"), .init(label: "Complete", done: true) ] - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { _ in diff --git a/Resources/TaskList/Subtasks6.swift b/Resources/TaskList/Subtasks6.swift index 2f8eaf8..b2e920a 100644 --- a/Resources/TaskList/Subtasks6.swift +++ b/Resources/TaskList/Subtasks6.swift @@ -13,8 +13,7 @@ struct Subtasks: App { .init(label: "World"), .init(label: "Complete", done: true) ] - let id = "io.github.david_swift.Subtasks" - var app: GTUIApp! + let app: AdwaitaApp = .init(id: "io.github.david_swift.Subtasks") var scene: Scene { Window(id: "main") { _ in diff --git a/Resources/TaskList/TaskList10.swift b/Resources/TaskList/TaskList10.swift index 678e09c..31b36e6 100644 --- a/Resources/TaskList/TaskList10.swift +++ b/Resources/TaskList/TaskList10.swift @@ -17,13 +17,13 @@ struct TaskList: View { .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } } diff --git a/Resources/TaskList/TaskList11.swift b/Resources/TaskList/TaskList11.swift index a2a70f4..3f93201 100644 --- a/Resources/TaskList/TaskList11.swift +++ b/Resources/TaskList/TaskList11.swift @@ -17,7 +17,7 @@ struct TaskList: View { .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { @@ -25,6 +25,7 @@ struct TaskList: View { .iconName(Icon.default(icon: .goNext).string) } } + .boxedList() .valign(.start) .padding(20) .style("boxed-list") diff --git a/Resources/TaskList/TaskList12.swift b/Resources/TaskList/TaskList12.swift index ff67e04..b0278b1 100644 --- a/Resources/TaskList/TaskList12.swift +++ b/Resources/TaskList/TaskList12.swift @@ -17,7 +17,7 @@ struct TaskList: View { .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { @@ -25,9 +25,9 @@ struct TaskList: View { .iconName(Icon.default(icon: .goNext).string) } } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } .topToolbar { diff --git a/Resources/TaskList/TaskList13.swift b/Resources/TaskList/TaskList13.swift index 448dd73..5273f1a 100644 --- a/Resources/TaskList/TaskList13.swift +++ b/Resources/TaskList/TaskList13.swift @@ -18,14 +18,14 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { @@ -33,9 +33,9 @@ struct TaskList: View { .iconName(Icon.default(icon: .goNext).string) } } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } diff --git a/Resources/TaskList/TaskList14.swift b/Resources/TaskList/TaskList14.swift index 0efc235..43de8cb 100644 --- a/Resources/TaskList/TaskList14.swift +++ b/Resources/TaskList/TaskList14.swift @@ -18,23 +18,23 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList15.swift b/Resources/TaskList/TaskList15.swift index 0b982e9..69ffe0b 100644 --- a/Resources/TaskList/TaskList15.swift +++ b/Resources/TaskList/TaskList15.swift @@ -23,23 +23,23 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList16.swift b/Resources/TaskList/TaskList16.swift index a85cfb6..90919c3 100644 --- a/Resources/TaskList/TaskList16.swift +++ b/Resources/TaskList/TaskList16.swift @@ -26,13 +26,13 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } @@ -44,13 +44,13 @@ struct TaskList: View { } } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList17.swift b/Resources/TaskList/TaskList17.swift index 8fba9b8..bdcb728 100644 --- a/Resources/TaskList/TaskList17.swift +++ b/Resources/TaskList/TaskList17.swift @@ -27,17 +27,17 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } - var dialog: View { + var dialog: AnyView { Form { EntryRow("Label", text: $addDialogText) .frame(minWidth: 250) @@ -49,13 +49,13 @@ struct TaskList: View { } } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList18.swift b/Resources/TaskList/TaskList18.swift index 85468f5..a22fdba 100644 --- a/Resources/TaskList/TaskList18.swift +++ b/Resources/TaskList/TaskList18.swift @@ -29,17 +29,17 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } - var dialog: View { + var dialog: AnyView { Form { EntryRow("Label", text: $addDialogText) .frame(minWidth: 250) @@ -57,19 +57,19 @@ struct TaskList: View { tasks.append(.init(label: addDialogText)) cancel() } - .style("suggested-action") + .suggested() } .showEndTitleButtons(false) } } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList19.swift b/Resources/TaskList/TaskList19.swift index 7185092..158ba83 100644 --- a/Resources/TaskList/TaskList19.swift +++ b/Resources/TaskList/TaskList19.swift @@ -29,17 +29,17 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } - var dialog: View { + var dialog: AnyView { Form { EntryRow("Label", text: $addDialogText) .entryActivated { @@ -59,19 +59,19 @@ struct TaskList: View { Button("Add") { add() } - .style("suggested-action") + .suggested() } .showEndTitleButtons(false) } } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList20.swift b/Resources/TaskList/TaskList20.swift index 26c136c..ec436df 100644 --- a/Resources/TaskList/TaskList20.swift +++ b/Resources/TaskList/TaskList20.swift @@ -11,7 +11,7 @@ struct TaskList: View { @State private var showAddDialog = false @State private var addDialogText = "" @State private var focusEntry: Signal = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { ScrollView { @@ -31,17 +31,17 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } - var dialog: View { + var dialog: AnyView { Form { EntryRow("Label", text: $addDialogText) .entryActivated { @@ -61,19 +61,19 @@ struct TaskList: View { Button("Add") { add() } - .style("suggested-action") + .suggested() } .showEndTitleButtons(false) } } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList21.swift b/Resources/TaskList/TaskList21.swift index 7b049ef..7499aa8 100644 --- a/Resources/TaskList/TaskList21.swift +++ b/Resources/TaskList/TaskList21.swift @@ -11,7 +11,7 @@ struct TaskList: View { @State private var showAddDialog = false @State private var addDialogText = "" @State private var focusEntry: Signal = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { ScrollView { @@ -31,17 +31,17 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } - var dialog: View { + var dialog: AnyView { Form { EntryRow("Label", text: $addDialogText) .entryActivated { @@ -61,19 +61,19 @@ struct TaskList: View { Button("Add") { add() } - .style("suggested-action") + .suggested() } .showEndTitleButtons(false) } } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList22.swift b/Resources/TaskList/TaskList22.swift index 16b18c4..a3c103f 100644 --- a/Resources/TaskList/TaskList22.swift +++ b/Resources/TaskList/TaskList22.swift @@ -11,7 +11,7 @@ struct TaskList: View { @State private var showAddDialog = false @State private var addDialogText = "" @State private var focusEntry: Signal = .init() - var app: GTUIApp + var app: AdwaitaApp var view: Body { ScrollView { @@ -32,17 +32,17 @@ struct TaskList: View { } } - var list: View { + var list: AnyView { List(tasks, selection: nil) { task in taskRow(task: task) } + .boxedList() .valign(.start) .padding(20) - .style("boxed-list") .frame(maxWidth: 500) } - var dialog: View { + var dialog: AnyView { Form { EntryRow(Loc.label, text: $addDialogText) .entryActivated { @@ -62,19 +62,19 @@ struct TaskList: View { Button(Loc.add) { add() } - .style("suggested-action") + .suggested() } .showEndTitleButtons(false) } } - func taskRow(task: Task) -> View { + func taskRow(task: Task) -> AnyView { ActionRow() .title(task.label) .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } .suffix { diff --git a/Resources/TaskList/TaskList7.swift b/Resources/TaskList/TaskList7.swift index f04317b..350bea2 100644 --- a/Resources/TaskList/TaskList7.swift +++ b/Resources/TaskList/TaskList7.swift @@ -15,8 +15,8 @@ struct TaskList: View { ActionRow() .title(task.label) } + .boxedList() .padding() - .style("boxed-list") } } diff --git a/Resources/TaskList/TaskList8.swift b/Resources/TaskList/TaskList8.swift index 6c13ae7..75a2c98 100644 --- a/Resources/TaskList/TaskList8.swift +++ b/Resources/TaskList/TaskList8.swift @@ -16,8 +16,8 @@ struct TaskList: View { .title(task.label) } .valign(.start) + .boxedList() .padding() - .style("boxed-list") } } diff --git a/Resources/TaskList/TaskList9.swift b/Resources/TaskList/TaskList9.swift index 04108cb..57db595 100644 --- a/Resources/TaskList/TaskList9.swift +++ b/Resources/TaskList/TaskList9.swift @@ -17,13 +17,13 @@ struct TaskList: View { .prefix { CheckButton() .active($tasks[id: task.id, default: .init(label: "")].done) - .style("selection-mode") + .selectionMode() .valign(.center) } } + .boxedList() .valign(.start) .padding() - .style("boxed-list") } } diff --git a/Resources/Views/AdwaitaTemplate1.swift b/Resources/Views/AdwaitaTemplate1.swift index 823eff7..cfcb031 100644 --- a/Resources/Views/AdwaitaTemplate1.swift +++ b/Resources/Views/AdwaitaTemplate1.swift @@ -6,8 +6,7 @@ import Adwaita @main struct AdwaitaTemplate: App { - let id = "io.github.AparokshaUI.AdwaitaTemplate" - var app: GTUIApp! + let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate") var scene: Scene { Window(id: "main") { window in diff --git a/Resources/Views/AdwaitaTemplate2.swift b/Resources/Views/AdwaitaTemplate2.swift index 34e7144..54f46ee 100644 --- a/Resources/Views/AdwaitaTemplate2.swift +++ b/Resources/Views/AdwaitaTemplate2.swift @@ -6,8 +6,7 @@ import Adwaita @main struct AdwaitaTemplate: App { - let id = "io.github.AparokshaUI.AdwaitaTemplate" - var app: GTUIApp! + let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate") var scene: Scene { Window(id: "main") { window in @@ -20,8 +19,8 @@ struct AdwaitaTemplate: App { struct Content: View { - var app: GTUIApp - var window: GTUIApplicationWindow + var app: AdwaitaApp + var window: AdwaitaApplicationWindow var view: Body { Text(Loc.helloWorld) diff --git a/Resources/Views/AdwaitaTemplate3.swift b/Resources/Views/AdwaitaTemplate3.swift index 6d801e1..b51c800 100644 --- a/Resources/Views/AdwaitaTemplate3.swift +++ b/Resources/Views/AdwaitaTemplate3.swift @@ -6,8 +6,7 @@ import Adwaita @main struct AdwaitaTemplate: App { - let id = "io.github.AparokshaUI.AdwaitaTemplate" - var app: GTUIApp! + let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate") var scene: Scene { Window(id: "main") { window in @@ -20,8 +19,8 @@ struct AdwaitaTemplate: App { struct Content: View { - var app: GTUIApp - var window: GTUIApplicationWindow + var app: AdwaitaApp + var window: AdwaitaApplicationWindow var view: Body { Button(Loc.helloWorld) { diff --git a/Resources/Views/AdwaitaTemplate4.swift b/Resources/Views/AdwaitaTemplate4.swift index 39d1b5c..9b63557 100644 --- a/Resources/Views/AdwaitaTemplate4.swift +++ b/Resources/Views/AdwaitaTemplate4.swift @@ -6,8 +6,7 @@ import Adwaita @main struct AdwaitaTemplate: App { - let id = "io.github.AparokshaUI.AdwaitaTemplate" - var app: GTUIApp! + let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate") var scene: Scene { Window(id: "main") { window in @@ -21,8 +20,8 @@ struct AdwaitaTemplate: App { struct Content: View { @State private var startAlign = false - var app: GTUIApp - var window: GTUIApplicationWindow + var app: AdwaitaApp + var window: AdwaitaApplicationWindow var view: Body { Button("Toggle Start Alignment") { diff --git a/Resources/Views/AdwaitaTemplate5.swift b/Resources/Views/AdwaitaTemplate5.swift index 6f0d7b7..324d09d 100644 --- a/Resources/Views/AdwaitaTemplate5.swift +++ b/Resources/Views/AdwaitaTemplate5.swift @@ -6,8 +6,7 @@ import Adwaita @main struct AdwaitaTemplate: App { - let id = "io.github.AparokshaUI.AdwaitaTemplate" - var app: GTUIApp! + let app = AdwaitaApp(id: "io.github.AparokshaUI.AdwaitaTemplate") var scene: Scene { Window(id: "main") { window in @@ -21,8 +20,8 @@ struct AdwaitaTemplate: App { struct Content: View { @State private var startAlign = false - var app: GTUIApp - var window: GTUIApplicationWindow + var app: AdwaitaApp + var window: AdwaitaApplicationWindow var view: Body { ButtonView(startAlign: $startAlign) diff --git a/Tutorial/Data/AppFlatpakData.tutorial b/Tutorial/Data/AppFlatpakData.tutorial index 4a5c75f..c80bb83 100644 --- a/Tutorial/Data/AppFlatpakData.tutorial +++ b/Tutorial/Data/AppFlatpakData.tutorial @@ -16,7 +16,7 @@ @Image(source: "ChangeDirectory.png", alt: "The GNOME Console app.") } @Step { - Clone the template repository into the `Subtasks` directory using `git clone https://github.com/AparokshaUI/AdwaitaTemplate Subtasks`. + Clone the template repository into the `Subtasks` directory using `git clone https://git.aparoksha.dev/aparoksha/adwaita-template Subtasks`. @Image(source: "CloneTemplateSubtasks.png", alt: "The GNOME Console app.") } @Step { diff --git a/Tutorial/Data/Flatpak.tutorial b/Tutorial/Data/Flatpak.tutorial deleted file mode 100644 index bc63061..0000000 --- a/Tutorial/Data/Flatpak.tutorial +++ /dev/null @@ -1,9 +0,0 @@ -@Article { - - @Intro(title: "About Flatpak") { - In the previous tutorial, you have named various files required for distributing apps via Flatpak. - } - - @ - -} diff --git a/Tutorial/Essentials/HelloWorld.tutorial b/Tutorial/Essentials/HelloWorld.tutorial index 19d642c..2d5f2fa 100644 --- a/Tutorial/Essentials/HelloWorld.tutorial +++ b/Tutorial/Essentials/HelloWorld.tutorial @@ -34,7 +34,7 @@ @Image(source: "ChangeDirectory.png", alt: "The GNOME Console app.") } @Step { - Clone the template repository into the `HelloWorld` directory using `git clone https://github.com/AparokshaUI/AdwaitaTemplate HelloWorld`. + Clone the template repository into the `HelloWorld` directory using `git clone https://git.aparoksha.dev/aparoksha/adwaita-template HelloWorld`. This creates a directory `HelloWorld` containing the content of the [Adwaita Template](https://github.com/AparokshaUI/AdwaitaTemplate). @Image(source: "GitClone.png", alt: "The GNOME Console app.") diff --git a/Tutorial/Essentials/Views.tutorial b/Tutorial/Essentials/Views.tutorial index 0fad927..6fda780 100644 --- a/Tutorial/Essentials/Views.tutorial +++ b/Tutorial/Essentials/Views.tutorial @@ -22,7 +22,7 @@ A window contains _views_. You can call other views inside of views (such as the ``Text`` or `ToolbarView` in this example). - Methods like ``View/padding(_:_:)`` and ``View/topToolbar(visible:_:)`` often used to tweak views or wrap views into other views (you'll get more familiar with them soon). + Methods like ``AnyView/padding(_:_:)`` and ``AnyView/topToolbar(visible:_:)`` are often used to tweak views or wrap views into other views (you'll get more familiar with them soon). @Code(name: "AdwaitaTemplate.swift", file: "AdwaitaTemplate1.swift") } @Step { @@ -73,7 +73,7 @@ @Binding var section: String @State private var title = "Title" - var app: GTUIApp + var app: AdwaitaApp var view: Body { ... diff --git a/Tutorial/GNOME/GNOME.tutorial b/Tutorial/GNOME/GNOME.tutorial index f2f7534..a7f42a1 100644 --- a/Tutorial/GNOME/GNOME.tutorial +++ b/Tutorial/GNOME/GNOME.tutorial @@ -1,14 +1,14 @@ @Article { - @Intro(title: "The GNOME project") { - Learn about the GNOME project and how you can get involved. + @Intro(title: "The GNOME Project") { + Learn about the GNOME Project and how you can get involved. } @ContentAndMedia { # GNOME shell - The GNOME shell is a popular open-source desktop environment for Linux. + The GNOME shell is a popular open source desktop environment for Linux. There is a vast app ecosystem built using its modern Adwaita design language, enabling a unique consistency across the platform. - GNOME apps follow strictly the philosophy "do one thing and do it well", and using them requires little technical knowledge. + GNOME apps strictly follow the philosophy "do one thing and do it well", and using them requires little technical knowledge. You can find more information in the [GNOME Human Interface Guidelines](https://developer.gnome.org/hig/index.html). ![The GNOME desktop environment showing some apps.](Screenshot.png) @@ -17,7 +17,7 @@ @ContentAndMedia { # Adwaita Adwaita is not only a design language, but a [C API](https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.5/) providing user interface elements, so called _widgets_, for native GNOME apps, built on top of the powerful [GTK widget toolkit](https://docs.gtk.org/gtk4/). - It offers various UI elements that support pointer, touch, and keyboard out of the box, and allows the creation of accessible apps without further configuration. + It offers various UI elements that support pointer, touch, and keyboard input out of the box, and allows the creation of accessible apps without further configuration. There are modern controls, containers, navigation design patterns and elements for visual feedback, working great on different types of screens, including phones. } diff --git a/Tutorial/GNOME/SetUpGNOME.tutorial b/Tutorial/GNOME/SetUpGNOME.tutorial index 6f53998..49b8e40 100644 --- a/Tutorial/GNOME/SetUpGNOME.tutorial +++ b/Tutorial/GNOME/SetUpGNOME.tutorial @@ -11,7 +11,7 @@ @Steps { @Step { - Install [Asahi Linux](https://asahilinux.org/) by running the following command into a macOS terminal: **`curl https://alx.sh | sh`** + Install [Asahi Linux](https://asahilinux.org/) by running the following command in a macOS terminal: **`curl https://alx.sh | sh`** Follow the instructions until you get to the OS selection. @Image(source: "Asahi.svg", alt: "A laptop showing the Asahi logo.") diff --git a/Tutorial/Swift/DeclarativeProgramming.tutorial b/Tutorial/Swift/DeclarativeProgramming.tutorial index 4c78f13..b5a8109 100644 --- a/Tutorial/Swift/DeclarativeProgramming.tutorial +++ b/Tutorial/Swift/DeclarativeProgramming.tutorial @@ -12,18 +12,18 @@ @Steps { @Step { You can see how creating an array in Swift with the content `[5, 10, 2, 3]` is done. - @Code(name: "main.swift", file: "Array1.swift") + @Code(name: "main.swift", file: "Array1D.swift") } @Step { Let's assume Swift wouldn't offer this convenient syntax - how would you create the same array starting from an empty array? - @Code(name: "main.swift", file: "Array2.swift") + @Code(name: "main.swift", file: "Array2D.swift") } @Step { The `append(_:)` function could be used for example. In this code, it gets clearer _how_ the result of having the array in the memory is accomplished, but one would have to mentally follow the commands to construct the _what_. Therefore, this code is more on the imperative side compared to the initial code example being rather on the declarative side. - @Code(name: "main.swift", file: "Array3.swift") + @Code(name: "main.swift", file: "Array3D.swift") } } } diff --git a/Tutorial/UserInterface/Details.tutorial b/Tutorial/UserInterface/Details.tutorial index 584f095..d72a4d3 100644 --- a/Tutorial/UserInterface/Details.tutorial +++ b/Tutorial/UserInterface/Details.tutorial @@ -117,7 +117,7 @@ } } @Step { - Then, add the ``View/aboutDialog(visible:app:developer:version:icon:website:issues:)`` modifier. + Then, add the ``AnyView/aboutDialog(visible:app:developer:version:icon:website:issues:)`` modifier. @Code(name: "TaskList.swift", file: "TaskList34.swift", previousFile: "TaskList33.swift") { @Image(source: "Localized7.png", alt: "The window.") } diff --git a/Tutorial/UserInterface/Navigation.tutorial b/Tutorial/UserInterface/Navigation.tutorial index 3d68601..01e2fec 100644 --- a/Tutorial/UserInterface/Navigation.tutorial +++ b/Tutorial/UserInterface/Navigation.tutorial @@ -30,7 +30,7 @@ @Step { Add the ``NavigationView``. - `destination` is of the type ``NavigationStack``, which means that it stores the navigation path. + `destination` is of the type ``NavigationView/NavigationStack``, which means that it stores the navigation path. If the path is empty, the `initialView` will be presented, otherwise, line 16 will be visible for the last element in the path which is of the type `Task`. @Code(name: "ContentView.swift", file: "ContentView3.swift") { @Image(source: "TaskList15.png", alt: "The window.") @@ -52,7 +52,7 @@ @Step { In the task list view, add the destination binding parameter and implement the navigation. - You can navigate using ``NavigationStack/push(_:)`` and ``NavigationStack/pop()``. + You can navigate using ``NavigationView/NavigationStack/push(_:)`` and ``NavigationView/NavigationStack/pop()``. @Code(name: "TaskList.swift", file: "TaskList23.swift", previousFile: "TaskList22.swift") { @Image(source: "TaskList15.png", alt: "The window.") }