mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
move Page entity out of Tab namespace
This commit is contained in:
parent
46adc640e9
commit
63bc991bda
21 changed files with 111 additions and 111 deletions
43
src/Entity/Browser/Container/Page/Response/Query.php
Normal file
43
src/Entity/Browser/Container/Page/Response/Query.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Response;
|
||||
|
||||
class Query extends \Yggverse\Yoda\Abstract\Entity\Entry
|
||||
{
|
||||
public \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response;
|
||||
|
||||
// Defaults
|
||||
protected string $_placeholder = 'Enter response...';
|
||||
|
||||
public function __construct(
|
||||
\Yggverse\Yoda\Entity\Browser\Container\Page\Response $response
|
||||
) {
|
||||
// Use parent features
|
||||
parent::__construct();
|
||||
|
||||
// Init dependency
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
protected function _onActivate(
|
||||
\GtkEntry $entry
|
||||
): void
|
||||
{
|
||||
$this->response->send();
|
||||
}
|
||||
|
||||
protected function _onKeyRelease(
|
||||
\GtkEntry $entry,
|
||||
\GdkEvent $event
|
||||
): void
|
||||
{
|
||||
$this->response->refresh();
|
||||
}
|
||||
|
||||
public function refresh(): void
|
||||
{
|
||||
// @TODO
|
||||
}
|
||||
}
|
||||
38
src/Entity/Browser/Container/Page/Response/Send.php
Normal file
38
src/Entity/Browser/Container/Page/Response/Send.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Entity\Browser\Container\Page\Response;
|
||||
|
||||
class Send extends \Yggverse\Yoda\Abstract\Entity\Button
|
||||
{
|
||||
// Dependencies
|
||||
public \Yggverse\Yoda\Entity\Browser\Container\Page\Response $response;
|
||||
|
||||
// Defaults
|
||||
protected string $_label = 'Send';
|
||||
|
||||
public function __construct(
|
||||
\Yggverse\Yoda\Entity\Browser\Container\Page\Response $response
|
||||
) {
|
||||
// Use parent features
|
||||
parent::__construct();
|
||||
|
||||
// Init dependency
|
||||
$this->response = $response;
|
||||
}
|
||||
|
||||
protected function _onCLick(
|
||||
\GtkButton $entity
|
||||
): void
|
||||
{
|
||||
$this->response->send();
|
||||
}
|
||||
|
||||
public function refresh(): void
|
||||
{
|
||||
$this->gtk->set_sensitive(
|
||||
!empty($this->response->query->getValue())
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue