Browse Source

init update navigation button

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

1
Makefile

@ -15,6 +15,7 @@ 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/update.cpp\
src/app/browser/main/tab/label.cpp\ src/app/browser/main/tab/label.cpp\
src/lib/database.cpp\ src/lib/database.cpp\
src/lib/database/session.cpp src/lib/database/session.cpp

1
po/POTFILES.in

@ -7,6 +7,7 @@ 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/update.cpp
src/app/browser/main/tab/label.cpp src/app/browser/main/tab/label.cpp
src/lib/database.cpp src/lib/database.cpp
src/lib/database/session.cpp src/lib/database/session.cpp

4
src/app/browser/main/tab/data.cpp

@ -10,10 +10,6 @@ Data::Data()
Gtk::Orientation::VERTICAL Gtk::Orientation::VERTICAL
); );
set_homogeneous(
true
);
// Init elements // Init elements
navbar = new data::Navbar(); navbar = new data::Navbar();

33
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/update.hpp"
using namespace app::browser::main::tab::data; using namespace app::browser::main::tab::data;
@ -10,16 +11,38 @@ Navbar::Navbar()
Gtk::Orientation::HORIZONTAL Gtk::Orientation::HORIZONTAL
); );
set_homogeneous( set_spacing(
true SPACING
);
set_margin_top(
MARGIN
);
set_margin_start(
MARGIN
);
set_margin_end(
MARGIN
);
set_margin_bottom(
MARGIN
); );
// Init elements // Init elements
base = new navbar::Base(); base = new navbar::Base();
append( append(
* base * base
); );
update = new navbar::Update();
append(
* update
);
} }
Navbar::~Navbar() = default; Navbar::~Navbar() = default;

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

@ -8,13 +8,20 @@ namespace app::browser::main::tab::data
namespace navbar namespace navbar
{ {
class Base; class Base;
class Update;
} }
class Navbar : public Gtk::Box class Navbar : public Gtk::Box
{ {
private: private:
// Defaults
const int SPACING = 8;
const int MARGIN = 8;
// Components
navbar::Base * base; navbar::Base * base;
navbar::Update * update;
public: public:

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

@ -0,0 +1,20 @@
#include "update.hpp"
using namespace app::browser::main::tab::data::navbar;
Update::Update()
{
set_action_name(
"tab.update"
);
set_icon_name(
"view-refresh-symbolic"
);
set_tooltip_text(
_("Update")
);
}
Update::~Update() = default;

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

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