From 3918ab9993ae48b36028182d7006ea9a679a542b Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 13 Aug 2024 08:07:56 +0300 Subject: [PATCH] init tab data container --- Makefile | 1 + po/POTFILES.in | 1 + src/app/browser/main/tab.cpp | 5 ++--- src/app/browser/main/tab.hpp | 2 ++ src/app/browser/main/tab/data.cpp | 16 ++++++++++++++++ src/app/browser/main/tab/data.hpp | 19 +++++++++++++++++++ 6 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 src/app/browser/main/tab/data.cpp create mode 100644 src/app/browser/main/tab/data.hpp diff --git a/Makefile b/Makefile index 4b930483..018bd270 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ SRCS = src/main.cpp\ src/app/browser/header/tab.cpp\ src/app/browser/main.cpp\ src/app/browser/main/tab.cpp\ + src/app/browser/main/tab/data.cpp\ src/app/browser/main/tab/label.cpp\ src/lib/database.cpp\ src/lib/database/session.cpp diff --git a/po/POTFILES.in b/po/POTFILES.in index ce03c3cc..af887aca 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -4,6 +4,7 @@ src/app/browser/header/menu.cpp src/app/browser/header/tab.cpp src/app/browser/main.cpp src/app/browser/main/tab.cpp +src/app/browser/main/tab/data.cpp src/app/browser/main/tab/label.cpp src/lib/database.cpp src/lib/database/session.cpp diff --git a/src/app/browser/main/tab.cpp b/src/app/browser/main/tab.cpp index 564e84ed..c335b2a7 100644 --- a/src/app/browser/main/tab.cpp +++ b/src/app/browser/main/tab.cpp @@ -1,4 +1,5 @@ #include "tab.hpp" +#include "tab/data.hpp" #include "tab/label.hpp" using namespace app::browser::main; @@ -17,11 +18,9 @@ void Tab::append( bool open, bool focus ) { - // Init new tab label label = new tab::Label(); - // Init tab data container @TODO - Gtk::Label * data = new Gtk::Label("data"); + data = new tab::Data(); append_page( * data, diff --git a/src/app/browser/main/tab.hpp b/src/app/browser/main/tab.hpp index caa60022..ae40d03c 100644 --- a/src/app/browser/main/tab.hpp +++ b/src/app/browser/main/tab.hpp @@ -8,6 +8,7 @@ namespace app::browser::main { namespace tab { + class Data; class Label; } @@ -15,6 +16,7 @@ namespace app::browser::main { public: + tab::Data * data; tab::Label * label; Tab(); diff --git a/src/app/browser/main/tab/data.cpp b/src/app/browser/main/tab/data.cpp new file mode 100644 index 00000000..4d004b4c --- /dev/null +++ b/src/app/browser/main/tab/data.cpp @@ -0,0 +1,16 @@ +#include "data.hpp" + +using namespace app::browser::main::tab; + +Data::Data() +{ + set_orientation( + Gtk::Orientation::VERTICAL + ); + + set_homogeneous( + true + ); +} + +Data::~Data() = default; diff --git a/src/app/browser/main/tab/data.hpp b/src/app/browser/main/tab/data.hpp new file mode 100644 index 00000000..3aca06fb --- /dev/null +++ b/src/app/browser/main/tab/data.hpp @@ -0,0 +1,19 @@ +#ifndef APP_BROWSER_MAIN_TAB_DATA_HPP +#define APP_BROWSER_MAIN_TAB_DATA_HPP + +#include +#include + +namespace app::browser::main::tab +{ + class Data : public Gtk::Box + { + public: + + Data(); + + ~Data(); + }; +} + +#endif // APP_BROWSER_MAIN_TAB_DATA_HPP \ No newline at end of file