Skip to content

MenuBars continued #420

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 4 commits into from
Nov 26, 2024
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
23 changes: 23 additions & 0 deletions src/Events/MenuBar/MenuBarClicked.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Native\Laravel\Events\MenuBar;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class MenuBarClicked implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public function __construct(public array $combo, public array $bounds, public array $position) {}

public function broadcastOn()
{
return [
new Channel('nativephp'),
];
}
}
23 changes: 23 additions & 0 deletions src/Events/MenuBar/MenuBarDoubleClicked.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Native\Laravel\Events\MenuBar;

use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class MenuBarDoubleClicked implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public function __construct(public array $combo, public array $bounds) {}

public function broadcastOn()
{
return [
new Channel('nativephp'),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class MenuBarContextMenuOpened implements ShouldBroadcastNow
class MenuBarRightClicked implements ShouldBroadcastNow
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public function __construct(public array $combo, public array $bounds) {}

public function broadcastOn()
{
return [
Expand Down
10 changes: 0 additions & 10 deletions src/MenuBar/MenuBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class MenuBar

protected bool $alwaysOnTop = false;

protected ?string $event = null;

protected bool $showDockIcon = false;

protected Client $client;
Expand Down Expand Up @@ -97,13 +95,6 @@ public function alwaysOnTop($alwaysOnTop = true): self
return $this;
}

public function event(string $event): self
{
$this->event = $event;

return $this;
}

public function withContextMenu(Menu $menu): self
{
$this->contextMenu = $menu;
Expand Down Expand Up @@ -131,7 +122,6 @@ public function toArray(): array
'onlyShowContextMenu' => $this->onlyShowContextMenu,
'contextMenu' => ! is_null($this->contextMenu) ? $this->contextMenu->toArray()['submenu'] : null,
'alwaysOnTop' => $this->alwaysOnTop,
'event' => $this->event,
];
}
}
Loading