Browse Source

init bookmark button class

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

1
Makefile

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

1
po/POTFILES.in

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

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

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
#include "navbar.hpp"
#include "navbar/base.hpp"
#include "navbar/bookmark.hpp"
#include "navbar/history.hpp"
#include "navbar/update.hpp"
@ -50,6 +51,12 @@ Navbar::Navbar() @@ -50,6 +51,12 @@ Navbar::Navbar()
append(
* update
);
bookmark = new navbar::Bookmark();
append(
* bookmark
);
}
Navbar::~Navbar() = default;

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

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

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

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
#include "bookmark.hpp"
using namespace app::browser::main::tab::data::navbar;
Bookmark::Bookmark()
{
set_action_name(
"tab.bookmark"
);
set_icon_name(
"starred-symbolic" // | non-starred-symbolic
);
set_tooltip_text(
_("Toggle bookmark")
);
}
Bookmark::~Bookmark() = default;

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

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