Skip to content

Docs for v0.5.4 #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 64 additions & 1 deletion resources/views/docs/1/the-basics/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ You can use the ID to reference the window in other methods, such as `Window::cl
### Closing Windows

To close a window, you may use the `Window::close()` method.
You may pass a unique identifier to the `close()` method to specify which window to close.

You may pass a unique identifier to the `close()` method to specify which window to close.

If you do not specify a window ID, NativePHP will try to detect the window ID automatically based on the current route.

```php
Expand All @@ -60,6 +62,50 @@ Window::resize(400, 300);
Window::resize(400, 300, 'settings');
```

### Minimizing and Maximizing

There are convenience methods that allow you to minimize and maximize windows.

#### Minimize a Window

To maximize a window, you may use the `Window::minimize()` method.

You may pass the window ID to the `minimize()` method to specify which window to minimize.

If you do not specify a window ID, NativePHP will try to detect the window ID automatically based on the current route.

```php
Window::open('secondary');

// Later...

Window::minimize('secondary');
```

#### Maximize a Window

To maximize a window, you may use the `Window::maximize()` method.

You may pass the window ID to the `maximize()` method to specify which window to maximize.

If you do not specify a window ID, NativePHP will try to detect the window ID automatically based on the current route.

```php
Window::open('secondary');

// Later...

Window::maximize('secondary');
```

Of course, you may also wish to open windows in a minimized or maximized state. You can achieve this simply by chaining the
`minimized()` and `maximized()` methods to your `Window::open()` call:

```php
Window::open()
->maximized();
```

### Retrieving the Current Window

You may use the `Window::current()` method to retrieve the currently focused window.
Expand Down Expand Up @@ -191,6 +237,7 @@ Window::open()
### Movable Windows

By default, all windows created with the `Window` facade are movable.

You may use the `movable()` method to disable moving.

```php
Expand All @@ -211,6 +258,22 @@ Window::open()
->closable(false);
```

### Full Screen Windows

By default, all windows created with the `Window` facade are fullscreen-able, meaning that they can enter Full Screen Mode.

You may use the `fullscreenable()` method to disable this feature.

```php
Window::open()->fullscreenable(false);
```

If you wish, you may open a window in full screen mode using the `fullscreen()` method.

```php
Window::open()->fullscreen();
```

### Window Shadow

By default, all windows created with the `Window` facade have a shadow. You may use the `hasShadow()` method to disable the shadow.
Expand Down