mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
save session on browser close only
This commit is contained in:
parent
196b55e072
commit
48198668fd
4 changed files with 38 additions and 79 deletions
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Navbar;
|
||||
|
||||
use \GdkEvent;
|
||||
use \Gtk;
|
||||
use \GtkEntry;
|
||||
|
||||
use \Yggverse\Yoda\Abstract\Entity\Entry;
|
||||
|
|
@ -17,9 +16,6 @@ class Request extends Entry
|
|||
// Defaults
|
||||
public const PLACEHOLDER = 'URL or search term...';
|
||||
|
||||
// Extras
|
||||
private ?int $_changed = null;
|
||||
|
||||
// Dependencies
|
||||
public Navbar $navbar;
|
||||
|
||||
|
|
@ -57,8 +53,6 @@ class Request extends Entry
|
|||
$this->navbar->page->open(
|
||||
$this->getValue()
|
||||
);
|
||||
|
||||
$this->navbar->page->container->tab->update();
|
||||
}
|
||||
|
||||
protected function _onKeyRelease(
|
||||
|
|
@ -81,33 +75,6 @@ class Request extends Entry
|
|||
|
||||
// Show suggestions autocomplete
|
||||
$this->completion->refresh();
|
||||
|
||||
// Update session
|
||||
if (isset($this->navbar->page->container->tab))
|
||||
{
|
||||
// Reset keyup time
|
||||
if ($this->_changed)
|
||||
{
|
||||
Gtk::source_remove(
|
||||
$this->_changed
|
||||
);
|
||||
|
||||
$this->_changed = null;
|
||||
}
|
||||
|
||||
// Wait for one second to apply act
|
||||
$this->_changed = Gtk::timeout_add(
|
||||
1000,
|
||||
function()
|
||||
{
|
||||
$this->navbar->page->container->tab->update();
|
||||
|
||||
$this->_changed = null;
|
||||
|
||||
return false; // stop
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function _onFocusOut(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue