Skip to content

Commit f4e849b

Browse files
committed
wip
1 parent 48a26e4 commit f4e849b

19 files changed

+249
-41
lines changed

src/Concerns/HasDimensions.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ trait HasDimensions
99
protected int $height = 400;
1010

1111
protected int $minWidth = 0;
12-
1312
protected int $minHeight = 0;
13+
protected int $maxWidth = 0;
14+
protected int $maxHeight = 0;
1415

1516
protected $x;
1617

@@ -44,6 +45,20 @@ public function minHeight($height): self
4445
return $this;
4546
}
4647

48+
public function maxWidth($width): self
49+
{
50+
$this->maxWidth = $width;
51+
52+
return $this;
53+
}
54+
55+
public function maxHeight($height): self
56+
{
57+
$this->maxHeight = $height;
58+
59+
return $this;
60+
}
61+
4762
public function position($x, $y): self
4863
{
4964
$this->x = $x;

src/Concerns/HasUrl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public function url(string $url): self
1313
return $this;
1414
}
1515

16-
public function route(string $route): self
16+
public function route(string $route, array $parameters = []): self
1717
{
18-
$this->url = route($route);
18+
$this->url = route($route, $parameters);
1919

2020
return $this;
2121
}

src/Concerns/HasVibrancy.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ trait HasVibrancy
1010

1111
protected bool $transparent = false;
1212

13+
public function backgroundColor($color): self
14+
{
15+
$this->backgroundColor = $color;
16+
17+
return $this;
18+
}
19+
1320
public function transparent($value = true): self
1421
{
1522
$this->transparent = $value;

src/Dialog.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function asSheet(string $windowId = null): self
112112
return $this;
113113
}
114114

115-
public function show()
115+
public function open()
116116
{
117117
$result = $this->client->post('dialog/open', [
118118
'title' => $this->title,

src/Enums/RolesEnum.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
enum RolesEnum: string
66
{
77
case APP_MENU = 'appMenu';
8+
case FILE_MENU = 'fileMenu';
9+
case EDIT_MENU = 'editMenu';
10+
case VIEW_MENU = 'viewMenu';
11+
case WINDOW_MENU = 'windowMenu';
812
case QUIT = 'quit';
913
case TOGGLE_FULL_SCREEN = 'togglefullscreen';
1014
case TOGGLE_DEV_TOOLS = 'toggleDevTools';
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Native\Laravel\Events\MenuBar;
4+
5+
use Illuminate\Broadcasting\Channel;
6+
use Illuminate\Broadcasting\InteractsWithSockets;
7+
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
8+
use Illuminate\Foundation\Events\Dispatchable;
9+
use Illuminate\Queue\SerializesModels;
10+
11+
class MenuBarContextMenuOpened implements ShouldBroadcastNow
12+
{
13+
use Dispatchable, InteractsWithSockets, SerializesModels;
14+
15+
public function broadcastOn()
16+
{
17+
return [
18+
new Channel('nativephp'),
19+
];
20+
}
21+
}

src/Events/MenuBar/MenuBarClicked.php renamed to src/Events/MenuBar/MenuBarHidden.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Illuminate\Foundation\Events\Dispatchable;
99
use Illuminate\Queue\SerializesModels;
1010

11-
class MenuBarClicked implements ShouldBroadcastNow
11+
class MenuBarHidden implements ShouldBroadcastNow
1212
{
1313
use Dispatchable, InteractsWithSockets, SerializesModels;
1414

src/Events/MenuBar/MenuBarShown.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Native\Laravel\Events\MenuBar;
4+
5+
use Illuminate\Broadcasting\Channel;
6+
use Illuminate\Broadcasting\InteractsWithSockets;
7+
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
8+
use Illuminate\Foundation\Events\Dispatchable;
9+
use Illuminate\Queue\SerializesModels;
10+
11+
class MenuBarShown implements ShouldBroadcastNow
12+
{
13+
use Dispatchable, InteractsWithSockets, SerializesModels;
14+
15+
public function broadcastOn()
16+
{
17+
return [
18+
new Channel('nativephp'),
19+
];
20+
}
21+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Native\Laravel\Events\Windows;
4+
5+
use Illuminate\Broadcasting\Channel;
6+
use Illuminate\Broadcasting\InteractsWithSockets;
7+
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
8+
use Illuminate\Foundation\Events\Dispatchable;
9+
use Illuminate\Queue\SerializesModels;
10+
11+
class WindowMaximized implements ShouldBroadcastNow
12+
{
13+
use Dispatchable, InteractsWithSockets, SerializesModels;
14+
15+
public function __construct(public string $id)
16+
{
17+
//
18+
}
19+
20+
public function broadcastOn()
21+
{
22+
return [
23+
new Channel('nativephp'),
24+
];
25+
}
26+
}

src/Events/Windows/WindowMinimized.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ class WindowMinimized implements ShouldBroadcastNow
1212
{
1313
use Dispatchable, InteractsWithSockets, SerializesModels;
1414

15+
public function __construct(public string $id)
16+
{
17+
//
18+
}
19+
1520
public function broadcastOn()
1621
{
1722
return [

0 commit comments

Comments
 (0)