Browse Source

implement status code 11 route

PHP-GTK3
yggverse 4 months ago
parent
commit
dca454cf50
  1. 4
      src/Entity/Browser/Container/Tab/Page/Content.php
  2. 16
      src/Entity/Browser/Container/Tab/Page/Response.php

4
src/Entity/Browser/Container/Tab/Page/Content.php

@ -190,6 +190,7 @@ class Content @@ -190,6 +190,7 @@ class Content
switch ($response->getCode())
{
case 10: // response expected
case 11: // sensitive input
$this->page->title->setValue(
$address->getHost(),
@ -202,7 +203,8 @@ class Content @@ -202,7 +203,8 @@ class Content
);
$this->page->response->show(
$response->getMeta() // pass to placeholder
$response->getMeta(), // placeholder
boolval(10 === $response->getCode()) // input visibility
);
break;

16
src/Entity/Browser/Container/Tab/Page/Response.php

@ -80,16 +80,24 @@ class Response @@ -80,16 +80,24 @@ class Response
}
public function show(
?string $placeholder = null
?string $placeholder = null,
?bool $visible = null
): void
{
if ($placeholder)
if (!is_null($placeholder))
{
$this->query->setPlaceholder(
$placeholder
);
}
if (!is_null($visible))
{
$this->query->setVisible(
$visible
);
}
$this->gtk->show();
}
@ -99,6 +107,10 @@ class Response @@ -99,6 +107,10 @@ class Response
null
);
$this->query->setVisible(
null
);
$this->gtk->hide();
}

Loading…
Cancel
Save