Skip to content

Commit 6eb011b

Browse files
authored
Merge pull request #108 from bbredewold/main
Add method to update an existing context-menu of the menu bar
2 parents ff17c33 + 8235273 commit 6eb011b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Facades/MenuBar.php

+2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
namespace Native\Laravel\Facades;
44

55
use Illuminate\Support\Facades\Facade;
6+
use Native\Laravel\Menu\Menu;
67

78
/**
89
* @method static \Native\Laravel\MenuBar\PendingCreateMenuBar create()
910
* @method static void show()
1011
* @method static void hide()
1112
* @method static void label(string $label)
13+
* @method static void contextMenu(Menu $contextMenu)
1214
*/
1315
class MenuBar extends Facade
1416
{

src/MenuBar/MenuBarManager.php

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Native\Laravel\MenuBar;
44

55
use Native\Laravel\Client\Client;
6+
use Native\Laravel\Menu\Menu;
67

78
class MenuBarManager
89
{
@@ -32,4 +33,11 @@ public function label(string $label)
3233
'label' => $label,
3334
]);
3435
}
36+
37+
public function contextMenu(Menu $contextMenu)
38+
{
39+
$this->client->post('menu-bar/context-menu', [
40+
'contextMenu' => $contextMenu->toArray()['submenu'],
41+
]);
42+
}
3543
}

0 commit comments

Comments
 (0)