mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
implement bookmarks browser
This commit is contained in:
parent
107718022d
commit
49ec6ee23d
16 changed files with 840 additions and 1 deletions
39
src/Entity/Browser/Bookmark/Container/Navbar/Delete.php
Normal file
39
src/Entity/Browser/Bookmark/Container/Navbar/Delete.php
Normal 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()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue