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

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

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

Loading…
Cancel
Save