mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-12 05:31:06 +00:00
update widget construction, implement refresh method
This commit is contained in:
parent
c940e5f7df
commit
1a548977a2
@ -5,10 +5,10 @@ using namespace app::browser::main::tab::page::navigation::history;
|
||||
Back::Back(
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__BACK
|
||||
) {
|
||||
set_action_name(
|
||||
"win.main_tab_page_navigation_history_back" // @TODO
|
||||
);
|
||||
// Init actions
|
||||
action__back = ACTION__BACK;
|
||||
|
||||
// Init widget
|
||||
set_icon_name(
|
||||
"go-previous-symbolic"
|
||||
);
|
||||
@ -16,10 +16,27 @@ Back::Back(
|
||||
set_tooltip_text(
|
||||
_("Back")
|
||||
);
|
||||
|
||||
set_sensitive(
|
||||
false
|
||||
);
|
||||
|
||||
signal_clicked().connect(
|
||||
[this]
|
||||
{
|
||||
action__back->activate();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void Back::refresh(
|
||||
const bool & ENABLED
|
||||
) {
|
||||
// @TODO update action status
|
||||
set_sensitive(
|
||||
ENABLED
|
||||
);
|
||||
|
||||
action__back->set_enabled(
|
||||
ENABLED
|
||||
);
|
||||
}
|
@ -10,6 +10,8 @@ namespace app::browser::main::tab::page::navigation::history
|
||||
{
|
||||
class Back : public Gtk::Button
|
||||
{
|
||||
Glib::RefPtr<Gio::SimpleAction> action__back;
|
||||
|
||||
public:
|
||||
|
||||
Back(
|
||||
|
@ -5,10 +5,10 @@ using namespace app::browser::main::tab::page::navigation::history;
|
||||
Forward::Forward(
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__FORWARD
|
||||
) {
|
||||
set_action_name(
|
||||
"win.main_tab_page_navigation_history_forward" // @TODO
|
||||
);
|
||||
// Init actions
|
||||
action__forward = ACTION__FORWARD;
|
||||
|
||||
// Init widget
|
||||
set_icon_name(
|
||||
"go-next-symbolic"
|
||||
);
|
||||
@ -16,10 +16,27 @@ Forward::Forward(
|
||||
set_tooltip_text(
|
||||
_("Forward")
|
||||
);
|
||||
|
||||
set_sensitive(
|
||||
false
|
||||
);
|
||||
|
||||
signal_clicked().connect(
|
||||
[this]
|
||||
{
|
||||
action__forward->activate();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void Forward::refresh(
|
||||
const bool & ENABLED
|
||||
) {
|
||||
// @TODO update action status
|
||||
set_sensitive(
|
||||
ENABLED
|
||||
);
|
||||
|
||||
action__forward->set_enabled(
|
||||
ENABLED
|
||||
);
|
||||
}
|
@ -10,6 +10,8 @@ namespace app::browser::main::tab::page::navigation::history
|
||||
{
|
||||
class Forward : public Gtk::Button
|
||||
{
|
||||
Glib::RefPtr<Gio::SimpleAction> action__forward;
|
||||
|
||||
public:
|
||||
|
||||
Forward(
|
||||
|
Loading…
x
Reference in New Issue
Block a user