add go button released event

This commit is contained in:
yggverse 2024-04-10 06:17:19 +03:00
parent 4b50edd3d0
commit c7e4c00176
2 changed files with 94 additions and 82 deletions

View file

@ -72,13 +72,29 @@ class Tab
true,
0
);
}
public function activate()
{
$this->navigation->address->entry->connect(
'activate',
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;
@ -86,7 +102,7 @@ class Tab
sprintf(
'Open %s...',
urldecode(
$entry->get_text()
$url
)
)
);
@ -98,7 +114,7 @@ class Tab
if ($config->resolver->enabled)
{
$address = new \Yggverse\Net\Address(
$entry->get_text()
$url
);
$name = $address->getHost();
@ -129,7 +145,7 @@ class Tab
}
$request = new \Yggverse\Gemini\Client\Request(
$entry->get_text(),
$url,
$host
);
@ -161,6 +177,4 @@ class Tab
)
);
}
);
}
}

View file

@ -63,8 +63,6 @@ $window->connect(
$tab = new \Yggverse\Yoda\Box\Tab();
$tab->activate();
$window->add(
$tab->box
);