Browse Source

add onChanged event

PHP-GTK3
yggverse 4 months ago
parent
commit
2322d1f4aa
  1. 15
      src/Abstract/Entity/Entry.php
  2. 13
      src/Entity/Browser/Container/Page/Navbar/Request.php
  3. 5
      src/Entity/Browser/Container/Page/Response/Query.php

15
src/Abstract/Entity/Entry.php

@ -66,6 +66,17 @@ abstract class Entry @@ -66,6 +66,17 @@ abstract class Entry
);
}
);
$this->gtk->connect(
'changed',
function (
\GtkEntry $entry
) {
$this->_onChanged(
$entry
);
}
);
}
abstract protected function _onActivate(
@ -77,6 +88,10 @@ abstract class Entry @@ -77,6 +88,10 @@ abstract class Entry
\GdkEvent $event
): void;
abstract protected function _onChanged(
\GtkEntry $entry
): void;
public function setLength(
?int $value = null
): void

13
src/Entity/Browser/Container/Page/Navbar/Request.php

@ -29,19 +29,10 @@ class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navb @@ -29,19 +29,10 @@ class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navb
$this->navbar->page->container->tab->updateSession();
}
// Update setter with session update feature
public function setValue(
?string $value = null
protected function _onChanged(
\GtkEntry $entry
): void
{
$this->gtk->set_text(
is_null($value) ? $this->_value : trim(
strval(
$value
)
)
);
// Update session on tab initiated only
if (isset($this->navbar->page->container->tab))
{

5
src/Entity/Browser/Container/Page/Response/Query.php

@ -36,6 +36,11 @@ class Query extends \Yggverse\Yoda\Abstract\Entity\Entry @@ -36,6 +36,11 @@ class Query extends \Yggverse\Yoda\Abstract\Entity\Entry
$this->response->refresh();
}
protected function _onChanged(
\GtkEntry $entry
): void
{}
public function refresh(): void
{
// @TODO

Loading…
Cancel
Save