forked from aparoksha/adwaita-swift
Add support for AboutWindow's issues URL
This commit is contained in:
parent
fd3c81d520
commit
aef77da78b
@ -29,6 +29,8 @@ public struct AboutWindow: WindowScene {
|
|||||||
var icon: Icon?
|
var icon: Icon?
|
||||||
/// The app's website.
|
/// The app's website.
|
||||||
var website: URL?
|
var website: URL?
|
||||||
|
/// The link for opening issues.
|
||||||
|
var issues: URL?
|
||||||
/// The path to the app data file.
|
/// The path to the app data file.
|
||||||
var path: URL?
|
var path: URL?
|
||||||
|
|
||||||
@ -72,6 +74,15 @@ public struct AboutWindow: WindowScene {
|
|||||||
return newSelf
|
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.
|
/// Get the storage for the window.
|
||||||
/// - Parameter app: The application.
|
/// - Parameter app: The application.
|
||||||
/// - Returns: The storage.
|
/// - Returns: The storage.
|
||||||
@ -115,6 +126,7 @@ public struct AboutWindow: WindowScene {
|
|||||||
window.generalData(title: appName, icon: icon, developer: developer, version: version)
|
window.generalData(title: appName, icon: icon, developer: developer, version: version)
|
||||||
}
|
}
|
||||||
if let website { window.website(url: website.absoluteString) }
|
if let website { window.website(url: website.absoluteString) }
|
||||||
|
if let issues { window.issues(url: issues.absoluteString) }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,8 +22,9 @@ struct Demo: App {
|
|||||||
.defaultSize(width: 650, height: 450)
|
.defaultSize(width: 650, height: 450)
|
||||||
.overlay {
|
.overlay {
|
||||||
AboutWindow(id: "about", appName: "Demo", developer: "david-swift", version: "Test")
|
AboutWindow(id: "about", appName: "Demo", developer: "david-swift", version: "Test")
|
||||||
.icon(.default(icon: .emojiNature))
|
.icon(.default(icon: .applicationXExecutable))
|
||||||
.website(.init(string: "david-swift.gitbook.io/adwaita"))
|
.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
|
Window(id: "overlay", open: 0) { window in
|
||||||
OverlayWindowDemo.WindowContent(window: window)
|
OverlayWindowDemo.WindowContent(window: window)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -166,7 +166,8 @@ There are many more widgets available using auto-generation. Learn [how to use t
|
|||||||
| Syntax | Description |
|
| Syntax | Description |
|
||||||
| --------------- | --------------------------------------------------------------------------------------- |
|
| --------------- | --------------------------------------------------------------------------------------- |
|
||||||
| `icon(_:)` | Set the app icon. |
|
| `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
|
### Menu Widgets
|
||||||
| Name | Description | Widget |
|
| Name | Description | Widget |
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user