mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-30 13:04:13 +00:00
define events inline
This commit is contained in:
parent
d4d81890f6
commit
4da1e4d9c2
@ -4,6 +4,7 @@ using namespace app::browser::main::tab::data::navbar;
|
||||
|
||||
Request::Request()
|
||||
{
|
||||
// Init entry
|
||||
set_placeholder_text(
|
||||
_("URL or search term...")
|
||||
);
|
||||
@ -12,33 +13,24 @@ Request::Request()
|
||||
true
|
||||
);
|
||||
|
||||
// Connect events
|
||||
signal_changed().connect(
|
||||
sigc::mem_fun(
|
||||
* this,
|
||||
& Request::on_change
|
||||
)
|
||||
[this]
|
||||
{
|
||||
activate_action(
|
||||
"navbar.refresh"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
signal_activate().connect(
|
||||
sigc::mem_fun(
|
||||
* this,
|
||||
& Request::on_activate
|
||||
)
|
||||
[this]
|
||||
{
|
||||
activate_action(
|
||||
"data.update"
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Request::~Request() = default;
|
||||
|
||||
void Request::on_activate()
|
||||
{
|
||||
activate_action(
|
||||
"data.update"
|
||||
);
|
||||
}
|
||||
|
||||
void Request::on_change()
|
||||
{
|
||||
activate_action(
|
||||
"navbar.refresh"
|
||||
);
|
||||
}
|
||||
Request::~Request() = default;
|
@ -3,18 +3,11 @@
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gtkmm/entry.h>
|
||||
#include <sigc++/functors/mem_fun.h>
|
||||
|
||||
namespace app::browser::main::tab::data::navbar
|
||||
{
|
||||
class Request : public Gtk::Entry
|
||||
{
|
||||
private:
|
||||
|
||||
void on_activate();
|
||||
|
||||
void on_change();
|
||||
|
||||
public:
|
||||
|
||||
Request();
|
||||
|
Loading…
x
Reference in New Issue
Block a user