diff --git a/src/App.php b/src/App.php index 8c06ad1c..0ebb54b8 100644 --- a/src/App.php +++ b/src/App.php @@ -34,6 +34,21 @@ public function isHidden(): bool return $this->client->get('app/is-hidden')->json('is_hidden'); } + public function getLocale(): string + { + return $this->client->get('app/locale')->json('locale'); + } + + public function getLocaleCountryCode(): string + { + return $this->client->get('app/locale-country-code')->json('locale_country_code'); + } + + public function getSystemLocale(): string + { + return $this->client->get('app/system-locale')->json('system_locale'); + } + public function version(): string { return $this->client->get('app/version')->json('version'); diff --git a/src/Facades/App.php b/src/Facades/App.php index 8754580e..6c0b8410 100644 --- a/src/Facades/App.php +++ b/src/Facades/App.php @@ -10,6 +10,9 @@ * @method static void focus() * @method static void hide() * @method static bool isHidden() + * @method static string getLocale() + * @method static string getLocaleCountryCode() + * @method static string getSystemLocale() * @method static string version() * @method static int badgeCount($count = null) * @method static void addRecentDocument(string $path) diff --git a/src/Facades/Window.php b/src/Facades/Window.php index f73e2164..1f4aba82 100644 --- a/src/Facades/Window.php +++ b/src/Facades/Window.php @@ -17,6 +17,7 @@ * @method static void reload($id = null) * @method static void maximize($id = null) * @method static void minimize($id = null) + * @method static void zoomFactor(float $zoomFactor = 1.0) */ class Window extends Facade { diff --git a/src/Windows/Window.php b/src/Windows/Window.php index 92af58b5..245ae0bc 100644 --- a/src/Windows/Window.php +++ b/src/Windows/Window.php @@ -68,6 +68,8 @@ class Window protected array $webPreferences = []; + protected float $zoomFactor = 1.0; + public function __construct(string $id) { $this->id = $id; @@ -326,6 +328,20 @@ public function webPreferences(array $preferences): static return $this; } + public function zoomFactor(float $zoomFactor = 1.0): self + { + $this->zoomFactor = $zoomFactor; + + if (! $this instanceof PendingOpenWindow) { + $this->client->post('window/set-zoom-factor', [ + 'id' => $this->id, + 'zoomFactor' => $zoomFactor, + ]); + } + + return $this; + } + public function toArray() { return [ @@ -364,6 +380,7 @@ public function toArray() 'autoHideMenuBar' => $this->autoHideMenuBar, 'transparent' => $this->transparent, 'webPreferences' => $this->webPreferences, + 'zoomFactor' => $this->zoomFactor, ]; }