From 99e9b7fc254575489bf5a05cb5ad86b3940995e4 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Mon, 5 Aug 2024 21:42:30 +0100 Subject: [PATCH 1/3] Add fullscreenable support --- src/Windows/Window.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Windows/Window.php b/src/Windows/Window.php index 2348577..115c0db 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -17,6 +17,8 @@ class Window protected bool $fullscreen = false; + protected bool $fullscreenable = true; + protected bool $kiosk = false; protected $rememberState = false; @@ -209,6 +211,13 @@ public function fullscreen($fullscreen = false): static return $this; } + public function fullscreenable($fullscreenable = true): static + { + $this->fullscreenable = $fullscreenable; + + return $this; + } + public function kiosk($kiosk = false): static { $this->kiosk = $kiosk; @@ -247,6 +256,7 @@ public function toArray() 'closable' => $this->closable, 'title' => $this->title, 'fullscreen' => $this->fullscreen, + 'fullscreenable' => $this->fullscreenable, 'kiosk' => $this->kiosk, 'autoHideMenuBar' => $this->autoHideMenuBar, ]; From 8e3e51b73b97a0e54f43e54325dc87c338b3233f Mon Sep 17 00:00:00 2001 From: simonhamp Date: Mon, 5 Aug 2024 20:42:48 +0000 Subject: [PATCH 2/3] Fix styling --- src/Commands/MinifyApplicationCommand.php | 2 +- src/Dialog.php | 2 +- src/Http/Controllers/NativeAppBootedController.php | 2 +- src/Menu/Menu.php | 4 ++-- src/MenuBar/MenuBarManager.php | 2 +- src/Notification.php | 2 +- src/ProgressBar.php | 2 +- src/System.php | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Commands/MinifyApplicationCommand.php b/src/Commands/MinifyApplicationCommand.php index 5b7373c..37d8378 100644 --- a/src/Commands/MinifyApplicationCommand.php +++ b/src/Commands/MinifyApplicationCommand.php @@ -26,7 +26,7 @@ public function handle() $this->cleanUpEnvFile($appPath); $this->removeIgnoredFilesAndFolders($appPath); - $compactor = new Php(); + $compactor = new Php; $phpFiles = Finder::create() ->files() diff --git a/src/Dialog.php b/src/Dialog.php index a217b56..223c853 100644 --- a/src/Dialog.php +++ b/src/Dialog.php @@ -30,7 +30,7 @@ public function __construct(protected Client $client) {} public static function new() { - return new static(new Client()); + return new static(new Client); } public function title(string $title): self diff --git a/src/Http/Controllers/NativeAppBootedController.php b/src/Http/Controllers/NativeAppBootedController.php index 8d56bc5..36ed735 100644 --- a/src/Http/Controllers/NativeAppBootedController.php +++ b/src/Http/Controllers/NativeAppBootedController.php @@ -12,7 +12,7 @@ public function __invoke(Request $request) $provider = app(config('nativephp.provider')); $provider->boot(); - event(new ApplicationBooted()); + event(new ApplicationBooted); return response()->json([ 'success' => true, diff --git a/src/Menu/Menu.php b/src/Menu/Menu.php index 379b4e2..47a81b0 100644 --- a/src/Menu/Menu.php +++ b/src/Menu/Menu.php @@ -25,7 +25,7 @@ public function __construct(protected Client $client) {} public static function new(): static { - return new static(new Client()); + return new static(new Client); } public function register(): void @@ -51,7 +51,7 @@ public function submenu(string $header, Menu $submenu): static public function separator(): static { - return $this->add(new Separator()); + return $this->add(new Separator); } public function quit(): static diff --git a/src/MenuBar/MenuBarManager.php b/src/MenuBar/MenuBarManager.php index 3101f2b..04aedb0 100644 --- a/src/MenuBar/MenuBarManager.php +++ b/src/MenuBar/MenuBarManager.php @@ -11,7 +11,7 @@ public function __construct(protected Client $client) {} public function create() { - return (new PendingCreateMenuBar())->setClient($this->client); + return (new PendingCreateMenuBar)->setClient($this->client); } public function show() diff --git a/src/Notification.php b/src/Notification.php index 18d27af..85c7a73 100644 --- a/src/Notification.php +++ b/src/Notification.php @@ -16,7 +16,7 @@ public function __construct(protected Client $client) {} public static function new() { - return new static(new Client()); + return new static(new Client); } public function title(string $title): self diff --git a/src/ProgressBar.php b/src/ProgressBar.php index 0f0c29b..74ca9d7 100644 --- a/src/ProgressBar.php +++ b/src/ProgressBar.php @@ -20,7 +20,7 @@ public function __construct(protected int $maxSteps, protected Client $client) { public static function create(int $maxSteps): static { - return new static($maxSteps, new Client()); + return new static($maxSteps, new Client); } public function start() diff --git a/src/System.php b/src/System.php index c750886..5535368 100644 --- a/src/System.php +++ b/src/System.php @@ -58,7 +58,7 @@ public function printToPDF(string $html): string public function timezone(): string { - $timezones = new Timezones(); + $timezones = new Timezones; if (PHP_OS_FAMILY === 'Windows') { $timezone = $timezones->translateFromWindowsString(exec('tzutil /g')); From 562c5fd357c896beb157716e5976400ad3930359 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Wed, 7 Aug 2024 22:46:20 +0100 Subject: [PATCH 3/3] Change default parameter value --- src/Windows/Window.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Windows/Window.php b/src/Windows/Window.php index 115c0db..67308af 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -204,7 +204,7 @@ public function hideMenu($autoHideMenuBar = true): static return $this; } - public function fullscreen($fullscreen = false): static + public function fullscreen($fullscreen = true): static { $this->fullscreen = $fullscreen;