Skip to content

fix: menu facade + better default for quit #536

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
Apr 2, 2025
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
37 changes: 19 additions & 18 deletions src/Facades/Menu.php
Original file line number Diff line number Diff line change
@@ -19,25 +19,26 @@
* @method static Link route(string $url, string $label = null, ?string $hotkey = null)
* @method static Radio radio(string $label, bool $checked = false, ?string $hotkey = null)
* @method static Role app()
* @method static Role file()
* @method static Role edit()
* @method static Role view()
* @method static Role window()
* @method static Role help()
* @method static Role fullscreen()
* @method static Role about(?string $label = null)
* @method static Role file(?string $label = null)
* @method static Role edit(?string $label = null)
* @method static Role view(?string $label = null)
* @method static Role window(?string $label = null)
* @method static Role help(?string $label = null)
* @method static Role fullscreen(?string $label = null)
* @method static Role separator()
* @method static Role devTools()
* @method static Role undo()
* @method static Role redo()
* @method static Role cut()
* @method static Role copy()
* @method static Role paste()
* @method static Role pasteAndMatchStyle()
* @method static Role reload()
* @method static Role minimize()
* @method static Role close()
* @method static Role quit()
* @method static Role hide()
* @method static Role devTools(?string $label = null)
* @method static Role undo(?string $label = null)
* @method static Role redo(?string $label = null)
* @method static Role cut(?string $label = null)
* @method static Role copy(?string $label = null)
* @method static Role paste(?string $label = null)
* @method static Role pasteAndMatchStyle(?string $label = null)
* @method static Role reload(?string $label = null)
* @method static Role minimize(?string $label = null)
* @method static Role close(?string $label = null)
* @method static Role quit(?string $label = null)
* @method static Role hide(?string $label = null)
* @method static void create(MenuItem ...$items)
* @method static void default()
*/
4 changes: 4 additions & 0 deletions src/Menu/MenuBuilder.php
Original file line number Diff line number Diff line change
@@ -150,6 +150,10 @@ public function close(?string $label = null): Items\Role

public function quit(?string $label = null): Items\Role
{
if (is_null($label)) {
$label = __('Quit').' '.config('app.name');
}

return new Items\Role(RolesEnum::QUIT, $label);
}

Loading
Oops, something went wrong.