mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
set entry focus on tab init
This commit is contained in:
parent
2e8e065371
commit
ff3fb354b4
2 changed files with 25 additions and 5 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -159,7 +159,10 @@ class Tab
|
|||
else
|
||||
{
|
||||
$page->init(
|
||||
$request
|
||||
$request,
|
||||
empty(
|
||||
$request
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue