8000 Update application-menu.md · SRWieZ/fork-nativephp.com@abba6cd · GitHub
[go: up one dir, main page]

Skip to content

Commit abba6cd

Browse files
authored
Update application-menu.md
1 parent 4372153 commit abba6cd

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

resources/views/docs/1/the-basics/application-menu.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ order: 300
55

66
## Configuring the Application Menu
77

8-
NativePHP allows you to configure the native menu of your application, as well as context menus and Dock menus, using a
8+
NativePHP allows you to configure the native menu of your application, as well as context menus, MenuBar and Dock menus, using a
99
single, unified and expressive Menu API, available through the `Menu` facade. Use this for building all of your app's menus.
1010

1111
```php
@@ -65,27 +65,30 @@ Menu::default();
6565

6666
### Recreating the menu
6767

68-
It's sometimes desirable to update the main application menu in response to changes in your application, making it
69-
contextually sensitive perhaps based on which window currently has focus.
68+
It's sometimes desirable to update the main application menu with a brand new configuration in response to changes in your
69+
application, making it contextually sensitive, perhaps based on which window currently has focus.
7070

71-
You can update your application menu at any time by calling `Menu::create()` with your desired menu structure.
71+
You can update your application menu at any time simply by calling `Menu::create()` again with your desired menu structure.
72+
This might be in an event listener, a controller action or even a Livewire action method.
7273

7374
## Predefined menus
7475

7576
NativePHP comes with a few predefined menus that you can use out of the box. These are a convenience and, for the most
7677
part, the only thing that can be changed about them is their label.
7778

78-
> On macOS, the first item in your application menu will _always_ use the name of your application as its label.
79-
8079
You may change this by passing a string as the first parameter to each method, for example:
8180

8281
```php
8382
Menu::edit('My Edit Menu')
8483
```
8584

86-
> The default menus often enable a number of common keyboard shortcuts, such as those typically used for cut, copy, and
87-
> paste. If you decide to build custom versions of these menus, you will need to explicitly define these shortcuts
88-
> ("hotkeys") yourself.
85+
**The default menus enable a number of common keyboard shortcuts ("hotkeys"), such as those typically used for cut,
86+
copy, and paste. If you decide to build custom versions of these menus, you will need to explicitly define these
87+
shortcuts yourself.**
88+
89+
**On macOS, the first item in your application menu will _always_ use the name of your application as its label,
90+
overriding any custom label you set, regardless of which type of submenu you place first.**
91+
8992

9093
### The App menu
9194

@@ -98,9 +101,11 @@ Menu::create(
98101
);
99102
```
100103

104+
**The app menu is only available for macOS. It is typically used as the first menu in your application's menu.**
105+
101106
### The File menu
102107

103-
You may use the `Menu::file()` method to create the default edit menu. This menu contains items and functionality that
108+
You may use the `Menu::file()` method to create the default file menu. This menu contains items and functionality that
104109
you would expect in a file menu (e.g. Close/Quit).
105110

106111
```php

0 commit comments

Comments
 (0)
0