mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-29 20:44:25 +00:00
draft local action group for page links navigation
This commit is contained in:
parent
44ceb06db5
commit
39ed3edbb9
@ -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]
|
||||
|
@ -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(
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user