Update docs

This commit is contained in:
david-swift 2023-11-11 11:44:19 +01:00
parent da08bc435c
commit 88eaad2c12
6 changed files with 36 additions and 10 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -135,7 +135,8 @@ If you want to use _Adwaita_ in a project, but there are widgets missing, open a
| Syntax | Description |
| ------------------------------- | --------------------------------------------------------------------------------------- |
| `keyboardShortcut(_:action:)` | Create a keyboard shortcut available in one window. |
| `closeShortcut()` | Create a keyboard shortcut for closing the window with "Ctrl + w".
| `closeShortcut()` | Create a keyboard shortcut for closing the window with "Ctrl + w". |
| `overlay(windows:)` | Add windows that attach to a window of this type when being presented. |
### Menu Widgets
| Name | Description | Widget |

View File

@ -11,7 +11,7 @@ import Adwaita
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {

View File

@ -28,7 +28,7 @@ import Adwaita
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {
@ -53,7 +53,7 @@ import Adwaita
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {

View File

@ -26,7 +26,7 @@ import Adwaita
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {
@ -52,7 +52,7 @@ import Adwaita
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {

View File

@ -14,7 +14,7 @@ Whenever the last one disappears, the app terminates.
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {
@ -42,7 +42,7 @@ Another use case is showing a window:
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {
@ -75,7 +75,7 @@ if you want to add and focus another instance of a window type:
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {
@ -104,7 +104,7 @@ It's possible to customize how many windows are being presented at the app's sta
@main
struct HelloWorld: App {
let id = "io.github.david-swift.HelloWorld"
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {
@ -127,4 +127,29 @@ struct HelloWorld: App {
}
```
## Add Modal Windows
Modal windows are windows that attach to another window.
Currently, it makes only sense to attach modal windows to windows that don't exist more than once.
```swift
@main
struct HelloWorld: App {
let id = "io.github.david_swift.HelloWorld"
var app: GTUIApp!
var scene: Scene {
Window(id: "content") { _ in
// ...
}
// Add modal windows
.overlay {
Window(id: "overlay") { _ in
// ...
}
}
}
}
```
[image-1]: ../../Icons/TwoWindows.png