draft action dependencies

This commit is contained in:
yggverse 2024-09-08 03:49:08 +03:00
parent 45dc3b160a
commit c940e5f7df
18 changed files with 137 additions and 54 deletions

View file

@ -8,7 +8,9 @@
using namespace app::browser::main::tab::page;
Navigation::Navigation(
const Glib::ustring & REQUEST
const Glib::ustring & REQUEST,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD
) {
// Init container
set_orientation(
@ -42,7 +44,10 @@ Navigation::Navigation(
* navigationBase
);
navigationHistory = Gtk::make_managed<navigation::History>();
navigationHistory = Gtk::make_managed<navigation::History>(
ACTION__NAVIGATION_HISTORY_BACK,
ACTION__NAVIGATION_HISTORY_FORWARD
);
append(
* navigationHistory

View file

@ -1,7 +1,9 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HPP
#include <giomm/simpleaction.h>
#include <giomm/simpleactiongroup.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <gtkmm/box.h>
#include <gtkmm/object.h>
@ -33,7 +35,9 @@ namespace app::browser::main::tab::page
public:
Navigation(
const Glib::ustring & REQUEST
const Glib::ustring & REQUEST,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__NAVIGATION_HISTORY_FORWARD
);
// Actions

View file

@ -4,19 +4,25 @@
using namespace app::browser::main::tab::page::navigation;
History::History()
{
History::History(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__HISTORY_FORWARD
) {
add_css_class(
"linked" // merge children elements
);
historyBack = Gtk::make_managed<history::Back>();
historyBack = Gtk::make_managed<history::Back>(
ACTION__HISTORY_BACK
);
append(
* historyBack
);
historyForward = Gtk::make_managed<history::Forward>();
historyForward = Gtk::make_managed<history::Forward>(
ACTION__HISTORY_FORWARD
);
append(
* historyForward

View file

@ -2,7 +2,9 @@
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_HPP
#include <ctime>
#include <giomm/simpleaction.h>
#include <glibmm/i18n.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <gtkmm/box.h>
#include <gtkmm/object.h>
@ -37,7 +39,10 @@ namespace app::browser::main::tab::page::navigation
// Define navigation history storage
std::vector<Memory> memory;
History();
History(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__HISTORY_BACK,
const Glib::RefPtr<Gio::SimpleAction> & ACTION__HISTORY_FORWARD
);
// Actions
void add(

View file

@ -2,10 +2,11 @@
using namespace app::browser::main::tab::page::navigation::history;
Back::Back()
{
Back::Back(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__BACK
) {
set_action_name(
"win.main_tab_page_navigation_history_back"
"win.main_tab_page_navigation_history_back" // @TODO
);
set_icon_name(

View file

@ -1,7 +1,9 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_BACK_HPP
#include <giomm/simpleaction.h>
#include <glibmm/i18n.h>
#include <glibmm/refptr.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navigation::history
@ -10,7 +12,9 @@ namespace app::browser::main::tab::page::navigation::history
{
public:
Back();
Back(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__BACK
);
void refresh(
const bool & ENABLED

View file

@ -2,10 +2,11 @@
using namespace app::browser::main::tab::page::navigation::history;
Forward::Forward()
{
Forward::Forward(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__FORWARD
) {
set_action_name(
"win.main_tab_page_navigation_history_forward"
"win.main_tab_page_navigation_history_forward" // @TODO
);
set_icon_name(

View file

@ -1,7 +1,9 @@
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD_HPP
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_HISTORY_FORWARD_HPP
#include <giomm/simpleaction.h>
#include <glibmm/i18n.h>
#include <glibmm/refptr.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::page::navigation::history
@ -10,7 +12,9 @@ namespace app::browser::main::tab::page::navigation::history
{
public:
Forward();
Forward(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__FORWARD
);
void refresh(
const bool & ENABLED