init navbar actions

This commit is contained in:
yggverse 2024-08-14 09:16:45 +03:00
parent 49fd7d0ab8
commit d95b85932f
4 changed files with 68 additions and 17 deletions

View file

@ -34,7 +34,7 @@ Navbar::Navbar()
MARGIN
);
// Init elements
// Init components
base = new navbar::Base();
append(
@ -64,6 +64,38 @@ Navbar::Navbar()
append(
* bookmark
);
// Init actions group
action_group = Gio::SimpleActionGroup::create();
// Define group actions
action_group->add_action(
"refresh",
sigc::mem_fun(
* this,
& Navbar::refresh
)
);
insert_action_group(
"navbar",
action_group
);
}
Navbar::~Navbar() = default;
// Actions
void Navbar::refresh()
{
// Deactivate on request value is empty
update->set_sensitive(
(bool) request->get_text_length()
);
}
// Getters
Glib::ustring Navbar::get_request_value()
{
return request->get_text();
}