From 940c98f3c6f0ba95f1c4bc9ebaa069923b3592fb Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 13 Aug 2024 08:40:17 +0300 Subject: [PATCH] init base button class --- Makefile | 1 + po/POTFILES.in | 1 + src/app/browser/main/tab/data/navbar.cpp | 9 +++++++++ src/app/browser/main/tab/data/navbar.hpp | 9 +++++++++ src/app/browser/main/tab/data/navbar/base.cpp | 20 +++++++++++++++++++ src/app/browser/main/tab/data/navbar/base.hpp | 19 ++++++++++++++++++ 6 files changed, 59 insertions(+) create mode 100644 src/app/browser/main/tab/data/navbar/base.cpp create mode 100644 src/app/browser/main/tab/data/navbar/base.hpp diff --git a/Makefile b/Makefile index 7fef3c7d..32a4456a 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ SRCS = src/main.cpp\ src/app/browser/main/tab.cpp\ src/app/browser/main/tab/data.cpp\ src/app/browser/main/tab/data/navbar.cpp\ + src/app/browser/main/tab/data/navbar/base.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 8ac9285d..2ca258e4 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -6,6 +6,7 @@ src/app/browser/main.cpp src/app/browser/main/tab.cpp src/app/browser/main/tab/data.cpp src/app/browser/main/tab/data/navbar.cpp +src/app/browser/main/tab/data/navbar/base.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/data/navbar.cpp b/src/app/browser/main/tab/data/navbar.cpp index 6c2ae0f3..d57cf51e 100644 --- a/src/app/browser/main/tab/data/navbar.cpp +++ b/src/app/browser/main/tab/data/navbar.cpp @@ -1,9 +1,11 @@ #include "navbar.hpp" +#include "navbar/base.hpp" using namespace app::browser::main::tab::data; Navbar::Navbar() { + // Init container set_orientation( Gtk::Orientation::HORIZONTAL ); @@ -11,6 +13,13 @@ Navbar::Navbar() set_homogeneous( true ); + + // Init elements + base = new navbar::Base(); + + append( + * base + ); } Navbar::~Navbar() = default; diff --git a/src/app/browser/main/tab/data/navbar.hpp b/src/app/browser/main/tab/data/navbar.hpp index 4acd90a9..009bbb94 100644 --- a/src/app/browser/main/tab/data/navbar.hpp +++ b/src/app/browser/main/tab/data/navbar.hpp @@ -5,8 +5,17 @@ namespace app::browser::main::tab::data { + namespace navbar + { + class Base; + } + class Navbar : public Gtk::Box { + private: + + navbar::Base * base; + public: Navbar(); diff --git a/src/app/browser/main/tab/data/navbar/base.cpp b/src/app/browser/main/tab/data/navbar/base.cpp new file mode 100644 index 00000000..81b4074e --- /dev/null +++ b/src/app/browser/main/tab/data/navbar/base.cpp @@ -0,0 +1,20 @@ +#include "base.hpp" + +using namespace app::browser::main::tab::data::navbar; + +Base::Base() +{ + set_action_name( + "tab.base" + ); + + set_icon_name( + "go-home-symbolic" + ); + + set_tooltip_text( + _("Base") + ); +} + +Base::~Base() = default; diff --git a/src/app/browser/main/tab/data/navbar/base.hpp b/src/app/browser/main/tab/data/navbar/base.hpp new file mode 100644 index 00000000..8e0f570d --- /dev/null +++ b/src/app/browser/main/tab/data/navbar/base.hpp @@ -0,0 +1,19 @@ +#ifndef APP_BROWSER_MAIN_TAB_DATA_NAVBAR_BASE_HPP +#define APP_BROWSER_MAIN_TAB_DATA_NAVBAR_BASE_HPP + +#include +#include + +namespace app::browser::main::tab::data::navbar +{ + class Base : public Gtk::Button + { + public: + + Base(); + + ~Base(); + }; +} + +#endif // APP_BROWSER_MAIN_TAB_DATA_NAVBAR_BASE_HPP \ No newline at end of file