Skip to content
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

Add method to update an existing context-menu of the menu bar #108

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/Facades/MenuBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
namespace Native\Laravel\Facades;

use Illuminate\Support\Facades\Facade;
use Native\Laravel\Menu\Menu;

/**
* @method static \Native\Laravel\MenuBar\PendingCreateMenuBar create()
* @method static void show()
* @method static void hide()
* @method static void label(string $label)
* @method static void contextMenu(Menu $contextMenu)
*/
class MenuBar extends Facade
{
Expand Down
8 changes: 8 additions & 0 deletions src/MenuBar/MenuBarManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Native\Laravel\MenuBar;

use Native\Laravel\Client\Client;
use Native\Laravel\Menu\Menu;

class MenuBarManager
{
Expand Down Expand Up @@ -32,4 +33,11 @@ public function label(string $label)
'label' => $label,
]);
}

public function contextMenu(Menu $contextMenu)
{
$this->client->post('menu-bar/context-menu', [
'contextMenu' => $contextMenu->toArray()['submenu'],
]);
}
}