mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
add go button released event
This commit is contained in:
parent
4b50edd3d0
commit
c7e4c00176
2 changed files with 94 additions and 82 deletions
|
|
@ -72,13 +72,29 @@ class Tab
|
||||||
true,
|
true,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
public function activate()
|
|
||||||
{
|
|
||||||
$this->navigation->address->entry->connect(
|
$this->navigation->address->entry->connect(
|
||||||
'activate',
|
'activate',
|
||||||
function ($entry)
|
function ($entry)
|
||||||
|
{
|
||||||
|
$this->navigate(
|
||||||
|
$entry->get_text()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->navigation->go->button->connect(
|
||||||
|
'released',
|
||||||
|
function ($entry)
|
||||||
|
{
|
||||||
|
$this->navigate(
|
||||||
|
$this->navigation->address->entry->get_text()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function navigate(string $url)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
|
@ -86,7 +102,7 @@ class Tab
|
||||||
sprintf(
|
sprintf(
|
||||||
'Open %s...',
|
'Open %s...',
|
||||||
urldecode(
|
urldecode(
|
||||||
$entry->get_text()
|
$url
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -98,7 +114,7 @@ class Tab
|
||||||
if ($config->resolver->enabled)
|
if ($config->resolver->enabled)
|
||||||
{
|
{
|
||||||
$address = new \Yggverse\Net\Address(
|
$address = new \Yggverse\Net\Address(
|
||||||
$entry->get_text()
|
$url
|
||||||
);
|
);
|
||||||
|
|
||||||
$name = $address->getHost();
|
$name = $address->getHost();
|
||||||
|
|
@ -129,7 +145,7 @@ class Tab
|
||||||
}
|
}
|
||||||
|
|
||||||
$request = new \Yggverse\Gemini\Client\Request(
|
$request = new \Yggverse\Gemini\Client\Request(
|
||||||
$entry->get_text(),
|
$url,
|
||||||
$host
|
$host
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -161,6 +177,4 @@ class Tab
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -63,8 +63,6 @@ $window->connect(
|
||||||
|
|
||||||
$tab = new \Yggverse\Yoda\Box\Tab();
|
$tab = new \Yggverse\Yoda\Box\Tab();
|
||||||
|
|
||||||
$tab->activate();
|
|
||||||
|
|
||||||
$window->add(
|
$window->add(
|
||||||
$tab->box
|
$tab->box
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue