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

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

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

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

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

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

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

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