draft local action group for page links navigation

This commit is contained in:
yggverse 2024-09-15 13:09:18 +03:00
parent 44ceb06db5
commit 39ed3edbb9
4 changed files with 31 additions and 22 deletions

View File

@ -26,27 +26,6 @@ Browser::Browser(
}
);
add_action_with_parameter(
"open",
Glib::VARIANT_TYPE_STRING,
[this](const Glib::VariantBase & PARAMETER)
{
if (PARAMETER.is_of_type(Glib::VARIANT_TYPE_STRING))
{
browserMain->update(
Glib::VariantBase::cast_dynamic<Glib::Variant<Glib::ustring>>(
PARAMETER
).get()
);
browserHeader->update(
browserMain->get_tab_page_title(),
browserMain->get_tab_page_description()
);
}
}
);
const auto ACTION__SESSION_CLEAN = add_action(
"session_clean",
[this]

View File

@ -52,6 +52,35 @@ Page::Page(
* pageContent
);
// Init widget action group @TODO
auto GioSimpleActionGroup = Gio::SimpleActionGroup::create();
// Define group actions
GioSimpleActionGroup->add_action_with_parameter(
"open",
Glib::VARIANT_TYPE_STRING,
[this](const Glib::VariantBase & PARAMETER)
{
if (PARAMETER.is_of_type(Glib::VARIANT_TYPE_STRING))
{
pageNavigation->set_request_text(
Glib::VariantBase::cast_dynamic<Glib::Variant<Glib::ustring>>(
PARAMETER
).get()
);
navigation_reload(
true
);
}
}
);
insert_action_group(
"page",
GioSimpleActionGroup
);
// Connect events
/* activated twice on tab change @TODO
signal_realize().connect(

View File

@ -5,6 +5,7 @@
#include <giomm/inputstream.h>
#include <giomm/outputstream.h>
#include <giomm/simpleaction.h>
#include <giomm/simpleactiongroup.h>
#include <giomm/socketclient.h>
#include <giomm/socketconnection.h>
#include <glibmm/i18n.h>

View File

@ -126,7 +126,7 @@ Reader::Reader(
if (SCHEME == NULL || SCHEME == Glib::ustring("gemini"))
{
return activate_action(
"win.open", // @TODO
"page.open", // @TODO use action argument
Glib::Variant<Glib::ustring>::create(
URI
)