implement bookmarks browser

This commit is contained in:
yggverse 2024-07-24 20:16:41 +03:00
parent 107718022d
commit 49ec6ee23d
16 changed files with 840 additions and 1 deletions

View file

@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Entity\Browser\Bookmark\Container\Navbar;
use \GtkButton;
use \Yggverse\Yoda\Abstract\Entity\Browser\Bookmark\Container\Navbar\Button;
class Delete extends Button
{
public const IMAGE = 'edit-delete-symbolic';
public const LABEL = 'Delete';
public const TOOLTIP = 'Delete';
protected function _onCLick(
GtkButton $entity
): void
{
if ($id = $this->navbar->container->content->table->getSelectedId())
{
$this->navbar->container->bookmark->browser->database->deleteBookmark(
$id
);
}
$this->navbar->container->refresh();
}
public function refresh(): void
{
$this->gtk->set_sensitive(
boolval(
$this->navbar->container->content->table->getSelectedId()
)
);
}
}