mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +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(
|
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(
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,10 @@ class Tab
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$page->init(
|
$page->init(
|
||||||
$request
|
$request,
|
||||||
|
empty(
|
||||||
|
$request
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue