Browse Source

draft history buttons group

CPP-GTK4
yggverse 3 months ago
parent
commit
17224ebaaa
  1. 3
      Makefile
  2. 3
      po/POTFILES.in
  3. 7
      src/app/browser/main/tab/data/navbar.cpp
  4. 2
      src/app/browser/main/tab/data/navbar.hpp
  5. 22
      src/app/browser/main/tab/data/navbar/history.cpp
  6. 30
      src/app/browser/main/tab/data/navbar/history.hpp
  7. 20
      src/app/browser/main/tab/data/navbar/history/back.cpp
  8. 19
      src/app/browser/main/tab/data/navbar/history/back.hpp
  9. 20
      src/app/browser/main/tab/data/navbar/history/forward.cpp
  10. 19
      src/app/browser/main/tab/data/navbar/history/forward.hpp

3
Makefile

@ -15,6 +15,9 @@ SRCS = src/main.cpp\
src/app/browser/main/tab/data.cpp\ src/app/browser/main/tab/data.cpp\
src/app/browser/main/tab/data/navbar.cpp\ src/app/browser/main/tab/data/navbar.cpp\
src/app/browser/main/tab/data/navbar/base.cpp\ src/app/browser/main/tab/data/navbar/base.cpp\
src/app/browser/main/tab/data/navbar/history.cpp\
src/app/browser/main/tab/data/navbar/history/back.cpp\
src/app/browser/main/tab/data/navbar/history/forward.cpp\
src/app/browser/main/tab/data/navbar/update.cpp\ src/app/browser/main/tab/data/navbar/update.cpp\
src/app/browser/main/tab/label.cpp\ src/app/browser/main/tab/label.cpp\
src/lib/database.cpp\ src/lib/database.cpp\

3
po/POTFILES.in

@ -7,6 +7,9 @@ src/app/browser/main/tab.cpp
src/app/browser/main/tab/data.cpp src/app/browser/main/tab/data.cpp
src/app/browser/main/tab/data/navbar.cpp src/app/browser/main/tab/data/navbar.cpp
src/app/browser/main/tab/data/navbar/base.cpp src/app/browser/main/tab/data/navbar/base.cpp
src/app/browser/main/tab/data/navbar/history.cpp
src/app/browser/main/tab/data/navbar/history/back.cpp
src/app/browser/main/tab/data/navbar/history/forward.cpp
src/app/browser/main/tab/data/navbar/update.cpp src/app/browser/main/tab/data/navbar/update.cpp
src/app/browser/main/tab/label.cpp src/app/browser/main/tab/label.cpp
src/lib/database.cpp src/lib/database.cpp

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

@ -1,5 +1,6 @@
#include "navbar.hpp" #include "navbar.hpp"
#include "navbar/base.hpp" #include "navbar/base.hpp"
#include "navbar/history.hpp"
#include "navbar/update.hpp" #include "navbar/update.hpp"
using namespace app::browser::main::tab::data; using namespace app::browser::main::tab::data;
@ -38,6 +39,12 @@ Navbar::Navbar()
* base * base
); );
history = new navbar::History();
append(
* history
);
update = new navbar::Update(); update = new navbar::Update();
append( append(

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

@ -8,6 +8,7 @@ namespace app::browser::main::tab::data
namespace navbar namespace navbar
{ {
class Base; class Base;
class History;
class Update; class Update;
} }
@ -21,6 +22,7 @@ namespace app::browser::main::tab::data
// Components // Components
navbar::Base * base; navbar::Base * base;
navbar::History * history;
navbar::Update * update; navbar::Update * update;
public: public:

22
src/app/browser/main/tab/data/navbar/history.cpp

@ -0,0 +1,22 @@
#include "history.hpp"
#include "history/back.hpp"
#include "history/forward.hpp"
using namespace app::browser::main::tab::data::navbar;
History::History()
{
back = new history::Back();
append(
* back
);
forward = new history::Forward();
append(
* forward
);
}
History::~History() = default;

30
src/app/browser/main/tab/data/navbar/history.hpp

@ -0,0 +1,30 @@
#ifndef APP_BROWSER_MAIN_TAB_DATA_NAVBAR_HISTORY_HPP
#define APP_BROWSER_MAIN_TAB_DATA_NAVBAR_HISTORY_HPP
#include <glibmm/i18n.h>
#include <gtkmm/box.h>
namespace app::browser::main::tab::data::navbar
{
namespace history
{
class Back;
class Forward;
}
class History : public Gtk::Box
{
private:
history::Back * back;
history::Forward * forward;
public:
History();
~History();
};
}
#endif // APP_BROWSER_MAIN_TAB_DATA_NAVBAR_HISTORY_HPP

20
src/app/browser/main/tab/data/navbar/history/back.cpp

@ -0,0 +1,20 @@
#include "back.hpp"
using namespace app::browser::main::tab::data::navbar::history;
Back::Back()
{
set_action_name(
"tab.back"
);
set_icon_name(
"go-previous-symbolic"
);
set_tooltip_text(
_("Back")
);
}
Back::~Back() = default;

19
src/app/browser/main/tab/data/navbar/history/back.hpp

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

20
src/app/browser/main/tab/data/navbar/history/forward.cpp

@ -0,0 +1,20 @@
#include "forward.hpp"
using namespace app::browser::main::tab::data::navbar::history;
Forward::Forward()
{
set_action_name(
"tab.forward"
);
set_icon_name(
"go-next-symbolic"
);
set_tooltip_text(
_("Forward")
);
}
Forward::~Forward() = default;

19
src/app/browser/main/tab/data/navbar/history/forward.hpp

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