Skip to content

Commit

Permalink
Dock goodies (#421)
Browse files Browse the repository at this point in the history
* Dock goodies

* Fix styling

* fix

---------

Co-authored-by: simonhamp <[email protected]>
  • Loading branch information
simonhamp and simonhamp authored Nov 26, 2024
1 parent 41459c2 commit 79f8966
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/Dock.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,38 @@ public function menu(Menu $menu)
'items' => $items,
]);
}

public function show()
{
$this->client->post('dock/show');
}

public function hide()
{
$this->client->post('dock/hide');
}

public function icon(string $path)
{
$this->client->post('dock/icon', ['path' => $path]);
}

public function bounce(string $type = 'informational')
{
$this->client->post('dock/bounce', ['type' => $type]);
}

public function cancelBounce()
{
$this->client->post('dock/cancel-bounce');
}

public function badge(?string $label = null): void|string
{
if (is_null($label)) {
return $this->client->get('dock/badge');
}

$this->client->post('dock/badge', ['label' => $label]);
}
}
6 changes: 6 additions & 0 deletions src/Facades/Dock.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@
use Native\Laravel\Menu\Menu;

/**
* @method static void bounce()
* @method static void|string badge(string $type = null)
* @method static void cancelBounce()
* @method static void hide()
* @method static void icon(string $Path)
* @method static void menu(Menu $menu)
* @method static void show()
*/
class Dock extends Facade
{
Expand Down

0 comments on commit 79f8966

Please sign in to comment.