Skip to content

Commit

Permalink
Add fullscreenable support (#340)
Browse files Browse the repository at this point in the history
* Add fullscreenable support

* Fix styling

* Change default parameter value

---------

Co-authored-by: simonhamp <[email protected]>
  • Loading branch information
simonhamp and simonhamp authored Aug 7, 2024
1 parent 047c774 commit 1fdd34b
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Commands/MinifyApplicationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function handle()
$this->cleanUpEnvFile($appPath);
$this->removeIgnoredFilesAndFolders($appPath);

$compactor = new Php();
$compactor = new Php;

$phpFiles = Finder::create()
->files()
Expand Down
2 changes: 1 addition & 1 deletion src/Dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/NativeAppBootedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/Menu/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/MenuBar/MenuBarManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
12 changes: 11 additions & 1 deletion src/Windows/Window.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Window

protected bool $fullscreen = false;

protected bool $fullscreenable = true;

protected bool $kiosk = false;

protected $rememberState = false;
Expand Down Expand Up @@ -202,13 +204,20 @@ public function hideMenu($autoHideMenuBar = true): static
return $this;
}

public function fullscreen($fullscreen = false): static
public function fullscreen($fullscreen = true): static
{
$this->fullscreen = $fullscreen;

return $this;
}

public function fullscreenable($fullscreenable = true): static
{
$this->fullscreenable = $fullscreenable;

return $this;
}

public function kiosk($kiosk = false): static
{
$this->kiosk = $kiosk;
Expand Down Expand Up @@ -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,
];
Expand Down

0 comments on commit 1fdd34b

Please sign in to comment.