Browse Source

set entry focus on tab init

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

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

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

Loading…
Cancel
Save