Browse Source

set entry focus on tab init

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

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

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

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

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

Loading…
Cancel
Save