mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-29 20:44:25 +00:00
draft back/forward actions
This commit is contained in:
parent
b3c00d29be
commit
75aaa6e717
@ -81,14 +81,14 @@ void Main::tab_close_all()
|
||||
|
||||
void Main::tab_history_back()
|
||||
{
|
||||
mainTab->history_back(
|
||||
mainTab->back(
|
||||
mainTab->get_current_page()
|
||||
);
|
||||
};
|
||||
|
||||
void Main::tab_history_forward()
|
||||
{
|
||||
mainTab->history_forward(
|
||||
mainTab->forward(
|
||||
mainTab->get_current_page()
|
||||
);
|
||||
};
|
||||
|
@ -98,30 +98,20 @@ void Tab::close_all()
|
||||
}
|
||||
}
|
||||
|
||||
void Tab::history_back(
|
||||
void Tab::back(
|
||||
const int & PAGE_NUMBER
|
||||
) {
|
||||
auto tabPage = get_tabPage(
|
||||
get_tabPage(
|
||||
PAGE_NUMBER
|
||||
);
|
||||
|
||||
// @TODO tabPage->back()
|
||||
|
||||
// Refresh children widgets
|
||||
tabPage->refresh();
|
||||
)->back();
|
||||
}
|
||||
|
||||
void Tab::history_forward(
|
||||
void Tab::forward(
|
||||
const int & PAGE_NUMBER
|
||||
) {
|
||||
auto tabPage = get_tabPage(
|
||||
get_tabPage(
|
||||
PAGE_NUMBER
|
||||
);
|
||||
|
||||
// @TODO tabPage->forward()
|
||||
|
||||
// Refresh children widgets
|
||||
tabPage->refresh();
|
||||
)->forward();
|
||||
}
|
||||
|
||||
void Tab::refresh(
|
||||
@ -134,9 +124,6 @@ void Tab::refresh(
|
||||
get_tabLabel(PAGE_NUMBER)->set_label(
|
||||
tabPage->get_title()
|
||||
);
|
||||
|
||||
// Refresh children widgets
|
||||
tabPage->refresh();
|
||||
}
|
||||
|
||||
void Tab::update(
|
||||
|
@ -54,11 +54,11 @@ namespace app::browser::main
|
||||
void close_right();
|
||||
void close_all();
|
||||
|
||||
void history_back(
|
||||
void back(
|
||||
const int & PAGE_NUMBER
|
||||
);
|
||||
|
||||
void history_forward(
|
||||
void forward(
|
||||
const int & PAGE_NUMBER
|
||||
);
|
||||
|
||||
|
@ -80,15 +80,20 @@ Glib::ustring Page::get_subtitle()
|
||||
}
|
||||
|
||||
// Actions
|
||||
void Page::refresh()
|
||||
void Page::back()
|
||||
{
|
||||
pageNavbar->refresh();
|
||||
pageNavbar->back();
|
||||
}
|
||||
|
||||
void Page::forward()
|
||||
{
|
||||
pageNavbar->forward();
|
||||
}
|
||||
|
||||
void Page::update()
|
||||
{
|
||||
// Update navigation history
|
||||
pageNavbar->history_push(
|
||||
pageNavbar->push(
|
||||
pageNavbar->get_request_text()
|
||||
);
|
||||
|
||||
|
@ -62,7 +62,8 @@ namespace app::browser::main::tab
|
||||
Glib::ustring get_subtitle();
|
||||
|
||||
// Actions
|
||||
void refresh();
|
||||
void back();
|
||||
void forward();
|
||||
void update();
|
||||
};
|
||||
}
|
||||
|
@ -96,7 +96,17 @@ Navbar::~Navbar()
|
||||
};
|
||||
|
||||
// Actions
|
||||
void Navbar::history_push(
|
||||
void Navbar::back()
|
||||
{
|
||||
navbarHistory->back();
|
||||
}
|
||||
|
||||
void Navbar::forward()
|
||||
{
|
||||
navbarHistory->forward();
|
||||
}
|
||||
|
||||
void Navbar::push(
|
||||
const Glib::ustring & VALUE
|
||||
) {
|
||||
navbarHistory->push(
|
||||
|
@ -38,7 +38,11 @@ namespace app::browser::main::tab::page
|
||||
~Navbar();
|
||||
|
||||
// Actions
|
||||
void history_push(
|
||||
void back();
|
||||
|
||||
void forward();
|
||||
|
||||
void push(
|
||||
const Glib::ustring & VALUE
|
||||
);
|
||||
|
||||
|
@ -30,6 +30,16 @@ History::~History()
|
||||
};
|
||||
|
||||
// Actions
|
||||
void History::back()
|
||||
{
|
||||
historyBack->activate();
|
||||
}
|
||||
|
||||
void History::forward()
|
||||
{
|
||||
historyForward->activate();
|
||||
}
|
||||
|
||||
void History::push(
|
||||
const Glib::ustring & REQUEST
|
||||
) {
|
||||
@ -50,10 +60,10 @@ void History::push(
|
||||
void History::refresh()
|
||||
{
|
||||
historyBack->set_sensitive(
|
||||
false // @TODO
|
||||
false // @TODO memory.size() > 0
|
||||
);
|
||||
|
||||
historyForward->set_sensitive(
|
||||
false // @TODO
|
||||
false // @TODO memory.size() > 0
|
||||
);
|
||||
}
|
@ -38,6 +38,9 @@ namespace app::browser::main::tab::page::navbar
|
||||
|
||||
~History();
|
||||
|
||||
void back();
|
||||
void forward();
|
||||
|
||||
void push(
|
||||
const Glib::ustring & REQUEST
|
||||
);
|
||||
|
@ -19,6 +19,15 @@ Back::Back()
|
||||
set_sensitive(
|
||||
false // @TODO no effect by set_action_name
|
||||
);
|
||||
|
||||
signal_clicked().connect(
|
||||
[this]
|
||||
{
|
||||
activate_action(
|
||||
"win.tab_history_back"
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Back::~Back() = default;
|
||||
|
@ -19,6 +19,15 @@ Forward::Forward()
|
||||
set_sensitive(
|
||||
false // @TODO no effect by set_action_name
|
||||
);
|
||||
|
||||
signal_clicked().connect(
|
||||
[this]
|
||||
{
|
||||
activate_action(
|
||||
"win.tab_history_forward"
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Forward::~Forward() = default;
|
||||
|
Loading…
x
Reference in New Issue
Block a user