mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
update widget construction, implement refresh method
This commit is contained in:
parent
c940e5f7df
commit
1a548977a2
4 changed files with 46 additions and 8 deletions
|
|
@ -5,10 +5,10 @@ using namespace app::browser::main::tab::page::navigation::history;
|
||||||
Back::Back(
|
Back::Back(
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__BACK
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__BACK
|
||||||
) {
|
) {
|
||||||
set_action_name(
|
// Init actions
|
||||||
"win.main_tab_page_navigation_history_back" // @TODO
|
action__back = ACTION__BACK;
|
||||||
);
|
|
||||||
|
|
||||||
|
// Init widget
|
||||||
set_icon_name(
|
set_icon_name(
|
||||||
"go-previous-symbolic"
|
"go-previous-symbolic"
|
||||||
);
|
);
|
||||||
|
|
@ -16,10 +16,27 @@ Back::Back(
|
||||||
set_tooltip_text(
|
set_tooltip_text(
|
||||||
_("Back")
|
_("Back")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
set_sensitive(
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
signal_clicked().connect(
|
||||||
|
[this]
|
||||||
|
{
|
||||||
|
action__back->activate();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Back::refresh(
|
void Back::refresh(
|
||||||
const bool & ENABLED
|
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
|
class Back : public Gtk::Button
|
||||||
{
|
{
|
||||||
|
Glib::RefPtr<Gio::SimpleAction> action__back;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Back(
|
Back(
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@ using namespace app::browser::main::tab::page::navigation::history;
|
||||||
Forward::Forward(
|
Forward::Forward(
|
||||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__FORWARD
|
const Glib::RefPtr<Gio::SimpleAction> & ACTION__FORWARD
|
||||||
) {
|
) {
|
||||||
set_action_name(
|
// Init actions
|
||||||
"win.main_tab_page_navigation_history_forward" // @TODO
|
action__forward = ACTION__FORWARD;
|
||||||
);
|
|
||||||
|
|
||||||
|
// Init widget
|
||||||
set_icon_name(
|
set_icon_name(
|
||||||
"go-next-symbolic"
|
"go-next-symbolic"
|
||||||
);
|
);
|
||||||
|
|
@ -16,10 +16,27 @@ Forward::Forward(
|
||||||
set_tooltip_text(
|
set_tooltip_text(
|
||||||
_("Forward")
|
_("Forward")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
set_sensitive(
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
signal_clicked().connect(
|
||||||
|
[this]
|
||||||
|
{
|
||||||
|
action__forward->activate();
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Forward::refresh(
|
void Forward::refresh(
|
||||||
const bool & ENABLED
|
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
|
class Forward : public Gtk::Button
|
||||||
{
|
{
|
||||||
|
Glib::RefPtr<Gio::SimpleAction> action__forward;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Forward(
|
Forward(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue