Browse Source

set entry focus on tab init

PHP-GTK3
yggverse 4 months ago
parent
commit
ff3fb354b4
  1. 25
      src/Entity/Browser/Container/Page.php
  2. 5
      src/Entity/Browser/Container/Tab.php

25
src/Entity/Browser/Container/Page.php

@ -95,12 +95,29 @@ class Page
} }
public function init( public function init(
?string $request = null ?string $request = null,
bool $focus = false
): void ): void
{ {
$this->navbar->request->setValue( if ($request)
$request {
); $this->navbar->request->setValue(
$request
);
}
if ($focus)
{
\Gtk::timeout_add(
100,
function()
{
$this->navbar->request->focus();
return false;
}
);
}
} }
public function open( public function open(

5
src/Entity/Browser/Container/Tab.php

@ -159,7 +159,10 @@ class Tab
else else
{ {
$page->init( $page->init(
$request $request,
empty(
$request
)
); );
} }

Loading…
Cancel
Save