mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
update page constructor api
This commit is contained in:
parent
b522e6b2a0
commit
f1515f8e99
6 changed files with 18 additions and 27 deletions
|
|
@ -110,7 +110,6 @@ void Main::save(
|
|||
void Main::tab_append()
|
||||
{
|
||||
mainTab->append(
|
||||
_("New tab"),
|
||||
true
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ int Tab::restore(
|
|||
while (sqlite3_step(statement) == SQLITE_ROW)
|
||||
{
|
||||
const int PAGE_NUMBER = append(
|
||||
_("Restore"),
|
||||
sqlite3_column_int(
|
||||
statement,
|
||||
DB::SESSION::IS_CURRENT
|
||||
|
|
@ -167,15 +166,10 @@ void Tab::update(
|
|||
}
|
||||
|
||||
int Tab::append(
|
||||
const Glib::ustring & LABEL_TEXT,
|
||||
const bool & IS_CURRENT
|
||||
) {
|
||||
const auto TAB_PAGE = new tab::Page( // @TODO manage
|
||||
db,
|
||||
tab::Page::MIME::UNDEFINED,
|
||||
LABEL_TEXT,
|
||||
"", // @TODO restore feature
|
||||
|
||||
action__update,
|
||||
action__tab_page_navigation_history_back,
|
||||
action__tab_page_navigation_history_forward,
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@ namespace app::browser::main
|
|||
|
||||
// Actions
|
||||
int append(
|
||||
const Glib::ustring & LABEL_TEXT,
|
||||
const bool & IS_CURRENT
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ Label::Label(
|
|||
action__tab_close = ACTION__TAB_CLOSE;
|
||||
|
||||
// Setup label controller
|
||||
auto GtkGestureClick = Gtk::GestureClick::create();
|
||||
auto const EVENT__GESTURE_CLICK = Gtk::GestureClick::create();
|
||||
|
||||
/* @TODO remove as default
|
||||
controller->set_button(
|
||||
GDK_BUTTON_PRIMARY
|
||||
);*/
|
||||
|
||||
GtkGestureClick->signal_pressed().connect(
|
||||
EVENT__GESTURE_CLICK->signal_pressed().connect(
|
||||
[this](int n, double x, double y)
|
||||
{
|
||||
if (n == 2) // double click
|
||||
|
|
@ -33,8 +33,14 @@ Label::Label(
|
|||
);
|
||||
|
||||
add_controller(
|
||||
GtkGestureClick
|
||||
EVENT__GESTURE_CLICK
|
||||
);
|
||||
|
||||
// Init widget
|
||||
/* not in use, overwritten by page init @TODO
|
||||
set_text(
|
||||
_("New page")
|
||||
);*/
|
||||
}
|
||||
|
||||
// Actions
|
||||
|
|
|
|||
|
|
@ -6,28 +6,24 @@ using namespace app::browser::main::tab;
|
|||
|
||||
Page::Page(
|
||||
sqlite3 * db,
|
||||
const MIME & MIME,
|
||||
const Glib::ustring & TITLE,
|
||||
const Glib::ustring & DESCRIPTION,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_RELOAD
|
||||
) {
|
||||
// Init meta
|
||||
mime = MIME;
|
||||
title = TITLE;
|
||||
description = DESCRIPTION;
|
||||
mime = MIME::UNDEFINED;
|
||||
title = _("New page");
|
||||
progress_fraction = 0;
|
||||
|
||||
// Init actions
|
||||
action__update = ACTION__UPDATE;
|
||||
|
||||
// Init database
|
||||
DB::SESSION::init(
|
||||
this->db = db
|
||||
);
|
||||
|
||||
// Init actions
|
||||
action__update = ACTION__UPDATE;
|
||||
|
||||
// Init widget
|
||||
set_orientation(
|
||||
Gtk::Orientation::VERTICAL
|
||||
|
|
|
|||
|
|
@ -83,14 +83,14 @@ namespace app::browser::main::tab
|
|||
|
||||
// Meta
|
||||
MIME mime;
|
||||
Glib::ustring title;
|
||||
Glib::ustring description;
|
||||
|
||||
// Tools
|
||||
double progress_fraction; // async load indication (progress bar)
|
||||
double progress_fraction;
|
||||
|
||||
GUri * uri;
|
||||
|
||||
Glib::ustring title;
|
||||
Glib::ustring description;
|
||||
|
||||
// Actions
|
||||
Glib::RefPtr<Gio::SimpleAction> action__update;
|
||||
|
||||
|
|
@ -114,9 +114,6 @@ namespace app::browser::main::tab
|
|||
|
||||
Page(
|
||||
sqlite3 * db,
|
||||
const MIME & MIME,
|
||||
const Glib::ustring & TITLE,
|
||||
const Glib::ustring & DESCRIPTION,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_BACK,
|
||||
const Glib::RefPtr<Gio::SimpleAction> & ACTION__TAB_PAGE_NAVIGATION_HISTORY_FORWARD,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue