mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-30 13:04:13 +00:00
make children widgets managed
This commit is contained in:
parent
75aaa6e717
commit
02b0b42b6b
@ -19,14 +19,14 @@ Browser::Browser(
|
||||
);
|
||||
|
||||
// Init header widget
|
||||
browserHeader = new browser::Header();
|
||||
browserHeader = Gtk::make_managed<browser::Header>();
|
||||
|
||||
set_titlebar(
|
||||
* browserHeader
|
||||
);
|
||||
|
||||
// Init main widget
|
||||
browserMain = new browser::Main();
|
||||
browserMain = Gtk::make_managed<browser::Main>();
|
||||
|
||||
set_child(
|
||||
* browserMain
|
||||
@ -127,10 +127,4 @@ Browser::Browser(
|
||||
browserMain->tab_history_forward();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Browser::~Browser()
|
||||
{
|
||||
delete browserHeader;
|
||||
delete browserMain;
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <glibmm/i18n.h>
|
||||
#include <gtkmm/applicationwindow.h>
|
||||
#include <gtkmm/object.h>
|
||||
|
||||
namespace lib
|
||||
{
|
||||
@ -31,8 +32,6 @@ namespace app
|
||||
//const Glib::RefPtr<Gtk::Application> & app,
|
||||
//const std::shared_ptr<lib::Database> & db
|
||||
);
|
||||
|
||||
~Browser();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -13,34 +13,27 @@ Header::Header()
|
||||
);
|
||||
|
||||
// Init menu
|
||||
headerMenu = new header::Menu();
|
||||
headerMenu = Gtk::make_managed<header::Menu>();
|
||||
|
||||
pack_start(
|
||||
* headerMenu
|
||||
);
|
||||
|
||||
// Init tab
|
||||
headerTab = new header::Tab();
|
||||
headerTab = Gtk::make_managed<header::Tab>();
|
||||
|
||||
pack_start(
|
||||
* headerTab
|
||||
);
|
||||
|
||||
// Init main widget
|
||||
headerMain = new header::Main();
|
||||
headerMain = Gtk::make_managed<header::Main>();
|
||||
|
||||
set_title_widget(
|
||||
* headerMain
|
||||
);
|
||||
}
|
||||
|
||||
Header::~Header()
|
||||
{
|
||||
delete headerMain;
|
||||
delete headerMenu;
|
||||
delete headerTab;
|
||||
}
|
||||
|
||||
void Header::set_title(
|
||||
const Glib::ustring & VALUE
|
||||
) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/headerbar.h>
|
||||
#include <gtkmm/object.h>
|
||||
|
||||
namespace app::browser
|
||||
{
|
||||
@ -27,8 +28,6 @@ namespace app::browser
|
||||
|
||||
Header();
|
||||
|
||||
~Header();
|
||||
|
||||
void set_title(
|
||||
const Glib::ustring & VALUE
|
||||
);
|
||||
|
@ -16,25 +16,19 @@ Main::Main()
|
||||
);
|
||||
|
||||
// Init title
|
||||
mainTitle = new main::Title();
|
||||
mainTitle = Gtk::make_managed<main::Title>();
|
||||
|
||||
append(
|
||||
* mainTitle
|
||||
);
|
||||
|
||||
mainSubtitle = new main::Subtitle();
|
||||
mainSubtitle = Gtk::make_managed<main::Subtitle>();
|
||||
|
||||
append(
|
||||
* mainSubtitle
|
||||
);
|
||||
}
|
||||
|
||||
Main::~Main()
|
||||
{
|
||||
delete mainTitle;
|
||||
delete mainSubtitle;
|
||||
}
|
||||
|
||||
void Main::set_title(
|
||||
const Glib::ustring & VALUE
|
||||
) {
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/object.h>
|
||||
|
||||
namespace app::browser::header
|
||||
{
|
||||
@ -23,8 +24,6 @@ namespace app::browser::header
|
||||
|
||||
Main();
|
||||
|
||||
~Main();
|
||||
|
||||
void set_title(
|
||||
const Glib::ustring & VALUE
|
||||
);
|
||||
|
@ -15,18 +15,13 @@ Main::Main()
|
||||
);
|
||||
|
||||
// Init tabs
|
||||
mainTab = new main::Tab();
|
||||
mainTab = Gtk::make_managed<main::Tab>();
|
||||
|
||||
append(
|
||||
* mainTab
|
||||
);
|
||||
}
|
||||
|
||||
Main::~Main()
|
||||
{
|
||||
delete mainTab;
|
||||
}
|
||||
|
||||
// Getters
|
||||
Glib::ustring Main::get_current_tab_page_title()
|
||||
{
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <glibmm/i18n.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/object.h>
|
||||
|
||||
namespace app::browser
|
||||
{
|
||||
@ -23,7 +24,6 @@ namespace app::browser
|
||||
public:
|
||||
|
||||
Main();
|
||||
~Main();
|
||||
|
||||
// Getters
|
||||
Glib::ustring get_current_tab_page_title();
|
||||
|
@ -33,7 +33,7 @@ Page::Page(
|
||||
);
|
||||
|
||||
// Init components
|
||||
pageNavbar = new page::Navbar(
|
||||
pageNavbar = Gtk::make_managed<page::Navbar>(
|
||||
REQUEST
|
||||
);
|
||||
|
||||
@ -41,13 +41,13 @@ Page::Page(
|
||||
* pageNavbar
|
||||
);
|
||||
|
||||
pageProgressbar = new page::Progressbar();
|
||||
pageProgressbar = Gtk::make_managed<page::Progressbar>();
|
||||
|
||||
append(
|
||||
* pageProgressbar
|
||||
);
|
||||
|
||||
pageContent = new page::Content();
|
||||
pageContent = Gtk::make_managed<page::Content>();
|
||||
|
||||
append(
|
||||
* pageContent
|
||||
@ -61,13 +61,6 @@ Page::Page(
|
||||
);
|
||||
}
|
||||
|
||||
Page::~Page()
|
||||
{
|
||||
delete pageNavbar;
|
||||
delete pageContent;
|
||||
delete pageProgressbar;
|
||||
}
|
||||
|
||||
// Getters
|
||||
Glib::ustring Page::get_title()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <glibmm/stringutils.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/object.h>
|
||||
|
||||
namespace app::browser::main::tab
|
||||
{
|
||||
@ -55,8 +56,6 @@ namespace app::browser::main::tab
|
||||
const Glib::ustring & REQUEST = ""
|
||||
);
|
||||
|
||||
~Page();
|
||||
|
||||
// Getters
|
||||
Glib::ustring get_title();
|
||||
Glib::ustring get_subtitle();
|
||||
|
@ -36,25 +36,25 @@ Navbar::Navbar(
|
||||
);
|
||||
|
||||
// Init components
|
||||
navbarBase = new navbar::Base();
|
||||
navbarBase = Gtk::make_managed<navbar::Base>();
|
||||
|
||||
append(
|
||||
* navbarBase
|
||||
);
|
||||
|
||||
navbarHistory = new navbar::History();
|
||||
navbarHistory = Gtk::make_managed<navbar::History>();
|
||||
|
||||
append(
|
||||
* navbarHistory
|
||||
);
|
||||
|
||||
navbarUpdate = new navbar::Update();
|
||||
navbarUpdate = Gtk::make_managed<navbar::Update>();
|
||||
|
||||
append(
|
||||
* navbarUpdate
|
||||
);
|
||||
|
||||
navbarRequest = new navbar::Request(
|
||||
navbarRequest = Gtk::make_managed<navbar::Request>(
|
||||
REQUEST
|
||||
);
|
||||
|
||||
@ -62,7 +62,7 @@ Navbar::Navbar(
|
||||
* navbarRequest
|
||||
);
|
||||
|
||||
navbarBookmark = new navbar::Bookmark();
|
||||
navbarBookmark = Gtk::make_managed<navbar::Bookmark>();
|
||||
|
||||
append(
|
||||
* navbarBookmark
|
||||
@ -86,15 +86,6 @@ Navbar::Navbar(
|
||||
);
|
||||
}
|
||||
|
||||
Navbar::~Navbar()
|
||||
{
|
||||
delete navbarBase;
|
||||
delete navbarBookmark;
|
||||
delete navbarHistory;
|
||||
delete navbarRequest;
|
||||
delete navbarUpdate;
|
||||
};
|
||||
|
||||
// Actions
|
||||
void Navbar::back()
|
||||
{
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <giomm/simpleactiongroup.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/object.h>
|
||||
|
||||
namespace app::browser::main::tab::page
|
||||
{
|
||||
@ -35,8 +36,6 @@ namespace app::browser::main::tab::page
|
||||
const Glib::ustring & REQUEST
|
||||
);
|
||||
|
||||
~Navbar();
|
||||
|
||||
// Actions
|
||||
void back();
|
||||
|
||||
|
@ -10,25 +10,19 @@ History::History()
|
||||
"linked" // merge children elements
|
||||
);
|
||||
|
||||
historyBack = new history::Back();
|
||||
historyBack = Gtk::make_managed<history::Back>();
|
||||
|
||||
append(
|
||||
* historyBack
|
||||
);
|
||||
|
||||
historyForward = new history::Forward();
|
||||
historyForward = Gtk::make_managed<history::Forward>();
|
||||
|
||||
append(
|
||||
* historyForward
|
||||
);
|
||||
}
|
||||
|
||||
History::~History()
|
||||
{
|
||||
delete historyBack;
|
||||
delete historyForward;
|
||||
};
|
||||
|
||||
// Actions
|
||||
void History::back()
|
||||
{
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <glibmm/i18n.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/object.h>
|
||||
#include <vector>
|
||||
|
||||
namespace app::browser::main::tab::page::navbar
|
||||
@ -36,8 +37,6 @@ namespace app::browser::main::tab::page::navbar
|
||||
|
||||
History();
|
||||
|
||||
~History();
|
||||
|
||||
void back();
|
||||
void forward();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user