mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
add update action support, remove request value from construction
This commit is contained in:
parent
fac8c14cbd
commit
55f1680f8b
9 changed files with 14 additions and 26 deletions
|
|
@ -4,9 +4,12 @@ using namespace app::browser::main::tab::page::navigation;
|
|||
|
||||
// Construct
|
||||
Request::Request(
|
||||
const Glib::ustring & TEXT
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE
|
||||
) {
|
||||
// Init entry
|
||||
// Init actions
|
||||
action__update = ACTION__UPDATE;
|
||||
|
||||
// Init widget
|
||||
set_placeholder_text(
|
||||
_("URL or search term...")
|
||||
);
|
||||
|
|
@ -19,15 +22,6 @@ Request::Request(
|
|||
PROGRESS_PULSE_STEP
|
||||
);
|
||||
|
||||
if (!TEXT.empty())
|
||||
{
|
||||
set_text(
|
||||
TEXT
|
||||
);
|
||||
|
||||
parse();
|
||||
}
|
||||
|
||||
// Connect events
|
||||
signal_changed().connect(
|
||||
[this]
|
||||
|
|
@ -35,7 +29,7 @@ Request::Request(
|
|||
parse();
|
||||
|
||||
activate_action(
|
||||
"navigation.refresh"
|
||||
"navigation.refresh" // @TODO
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
@ -45,9 +39,7 @@ Request::Request(
|
|||
{
|
||||
parse();
|
||||
|
||||
activate_action(
|
||||
"win.main_tab_page_navigation_update"
|
||||
);
|
||||
action__update->activate();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
#ifndef APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP
|
||||
#define APP_BROWSER_MAIN_TAB_PAGE_NAVIGATION_REQUEST_HPP
|
||||
|
||||
#include <giomm/simpleaction.h>
|
||||
#include <glibmm/i18n.h>
|
||||
#include <glibmm/main.h>
|
||||
#include <glibmm/refptr.h>
|
||||
#include <glibmm/regex.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/entry.h>
|
||||
|
|
@ -11,6 +13,9 @@ namespace app::browser::main::tab::page::navigation
|
|||
{
|
||||
class Request : public Gtk::Entry
|
||||
{
|
||||
// Actions
|
||||
Glib::RefPtr<Gio::SimpleAction> action__update;
|
||||
|
||||
// Extras
|
||||
double progress_fraction;
|
||||
|
||||
|
|
@ -31,7 +36,7 @@ namespace app::browser::main::tab::page::navigation
|
|||
public:
|
||||
|
||||
Request(
|
||||
const Glib::ustring & VALUE = "" // @TODO remove default value
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE
|
||||
);
|
||||
|
||||
// Actions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue