diff --git a/Sources/Adwaita/Window/AboutWindow.swift b/Sources/Adwaita/Window/AboutWindow.swift index bb8986d..09ef989 100644 --- a/Sources/Adwaita/Window/AboutWindow.swift +++ b/Sources/Adwaita/Window/AboutWindow.swift @@ -29,6 +29,8 @@ public struct AboutWindow: WindowScene { var icon: Icon? /// The app's website. var website: URL? + /// The link for opening issues. + var issues: URL? /// The path to the app data file. var path: URL? @@ -72,6 +74,15 @@ public struct AboutWindow: WindowScene { return newSelf } + /// Set the app's website. + /// - Parameter url: The URL to the issue tracker. + /// - Returns: The window. + public func issues(_ url: URL?) -> Self { + var newSelf = self + newSelf.issues = url + return newSelf + } + /// Get the storage for the window. /// - Parameter app: The application. /// - Returns: The storage. @@ -115,6 +126,7 @@ public struct AboutWindow: WindowScene { window.generalData(title: appName, icon: icon, developer: developer, version: version) } if let website { window.website(url: website.absoluteString) } + if let issues { window.issues(url: issues.absoluteString) } } } diff --git a/Tests/Demo.swift b/Tests/Demo.swift index 39df86c..735a0a6 100644 --- a/Tests/Demo.swift +++ b/Tests/Demo.swift @@ -22,8 +22,9 @@ struct Demo: App { .defaultSize(width: 650, height: 450) .overlay { AboutWindow(id: "about", appName: "Demo", developer: "david-swift", version: "Test") - .icon(.default(icon: .emojiNature)) - .website(.init(string: "david-swift.gitbook.io/adwaita")) + .icon(.default(icon: .applicationXExecutable)) + .website(.init(string: "https://david-swift.gitbook.io/adwaita")) + .issues(.init(string: "https://github.com/AparokshaUI/adwaita-swift/issues")) Window(id: "overlay", open: 0) { window in OverlayWindowDemo.WindowContent(window: window) } diff --git a/user-manual/Information/Widgets.md b/user-manual/Information/Widgets.md index e089c67..b443ee9 100644 --- a/user-manual/Information/Widgets.md +++ b/user-manual/Information/Widgets.md @@ -166,7 +166,8 @@ There are many more widgets available using auto-generation. Learn [how to use t | Syntax | Description | | --------------- | --------------------------------------------------------------------------------------- | | `icon(_:)` | Set the app icon. | -| `website(_:)` | Set the app's website | +| `website(_:)` | Set the app's website. | +| `issues(_:)` | Set the app's bug tracker. | ### Menu Widgets | Name | Description | Widget |