Browse Source

init base button class

CPP-GTK4
yggverse 3 months ago
parent
commit
940c98f3c6
  1. 1
      Makefile
  2. 1
      po/POTFILES.in
  3. 9
      src/app/browser/main/tab/data/navbar.cpp
  4. 9
      src/app/browser/main/tab/data/navbar.hpp
  5. 20
      src/app/browser/main/tab/data/navbar/base.cpp
  6. 19
      src/app/browser/main/tab/data/navbar/base.hpp

1
Makefile

@ -14,6 +14,7 @@ SRCS = src/main.cpp\ @@ -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

1
po/POTFILES.in

@ -6,6 +6,7 @@ src/app/browser/main.cpp @@ -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

9
src/app/browser/main/tab/data/navbar.cpp

@ -1,9 +1,11 @@ @@ -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() @@ -11,6 +13,13 @@ Navbar::Navbar()
set_homogeneous(
true
);
// Init elements
base = new navbar::Base();
append(
* base
);
}
Navbar::~Navbar() = default;

9
src/app/browser/main/tab/data/navbar.hpp

@ -5,8 +5,17 @@ @@ -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();

20
src/app/browser/main/tab/data/navbar/base.cpp

@ -0,0 +1,20 @@ @@ -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;

19
src/app/browser/main/tab/data/navbar/base.hpp

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
#ifndef APP_BROWSER_MAIN_TAB_DATA_NAVBAR_BASE_HPP
#define APP_BROWSER_MAIN_TAB_DATA_NAVBAR_BASE_HPP
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
namespace app::browser::main::tab::data::navbar
{
class Base : public Gtk::Button
{
public:
Base();
~Base();
};
}
#endif // APP_BROWSER_MAIN_TAB_DATA_NAVBAR_BASE_HPP
Loading…
Cancel
Save