mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
draft local action group for page links navigation
This commit is contained in:
parent
44ceb06db5
commit
39ed3edbb9
4 changed files with 31 additions and 22 deletions
|
|
@ -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(
|
const auto ACTION__SESSION_CLEAN = add_action(
|
||||||
"session_clean",
|
"session_clean",
|
||||||
[this]
|
[this]
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,35 @@ Page::Page(
|
||||||
* pageContent
|
* 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
|
// Connect events
|
||||||
/* activated twice on tab change @TODO
|
/* activated twice on tab change @TODO
|
||||||
signal_realize().connect(
|
signal_realize().connect(
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
#include <giomm/inputstream.h>
|
#include <giomm/inputstream.h>
|
||||||
#include <giomm/outputstream.h>
|
#include <giomm/outputstream.h>
|
||||||
#include <giomm/simpleaction.h>
|
#include <giomm/simpleaction.h>
|
||||||
|
#include <giomm/simpleactiongroup.h>
|
||||||
#include <giomm/socketclient.h>
|
#include <giomm/socketclient.h>
|
||||||
#include <giomm/socketconnection.h>
|
#include <giomm/socketconnection.h>
|
||||||
#include <glibmm/i18n.h>
|
#include <glibmm/i18n.h>
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ Reader::Reader(
|
||||||
if (SCHEME == NULL || SCHEME == Glib::ustring("gemini"))
|
if (SCHEME == NULL || SCHEME == Glib::ustring("gemini"))
|
||||||
{
|
{
|
||||||
return activate_action(
|
return activate_action(
|
||||||
"win.open", // @TODO
|
"page.open", // @TODO use action argument
|
||||||
Glib::Variant<Glib::ustring>::create(
|
Glib::Variant<Glib::ustring>::create(
|
||||||
URI
|
URI
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue