Browse Source

update header bar structure

CPP-GTK4
yggverse 5 months ago
parent
commit
00920d39a9
  1. 1
      Makefile
  2. 2
      src/app/browser/header.cpp
  3. 14
      src/app/browser/header/bar.cpp
  4. 4
      src/app/browser/header/bar.h
  5. 24
      src/app/browser/header/bar/title.cpp
  6. 33
      src/app/browser/header/bar/title.h

1
Makefile

@ -12,7 +12,6 @@ SRCS = src/main.cpp\ @@ -12,7 +12,6 @@ SRCS = src/main.cpp\
src/app/browser/container/tab.cpp\
src/app/browser/header.cpp\
src/app/browser/header/bar.cpp\
src/app/browser/header/bar/title.cpp\
src/app/browser/header/bar/menu.cpp\
src/app/browser/header/bar/menu/main.cpp\
src/app/browser/header/bar/menu/main/debug.cpp\

2
src/app/browser/header.cpp

@ -22,7 +22,7 @@ namespace app @@ -22,7 +22,7 @@ namespace app
);
// Init title widget
gtk_header_bar_set_title_widget(
gtk_header_bar_pack_start(
GTK_HEADER_BAR(
this->gtk
),

14
src/app/browser/header/bar.cpp

@ -33,20 +33,6 @@ namespace app @@ -33,20 +33,6 @@ namespace app
)
);
// Init title
this->title = new bar::Title(
this
);
gtk_box_append(
GTK_BOX(
this->gtk
),
GTK_WIDGET(
this->title->gtk
)
);
// Render
gtk_widget_show(
GTK_WIDGET(

4
src/app/browser/header/bar.h

@ -6,7 +6,6 @@ @@ -6,7 +6,6 @@
// Requirements
#include "bar/menu.h"
#include "bar/title.h"
namespace app::browser
{
@ -17,8 +16,6 @@ namespace app::browser @@ -17,8 +16,6 @@ namespace app::browser
namespace bar
{
class Menu;
class Title;
};
class Bar
@ -36,7 +33,6 @@ namespace app::browser @@ -36,7 +33,6 @@ namespace app::browser
// Requirements
bar::Menu *menu;
bar::Title *title;
Bar(
Header *header

24
src/app/browser/header/bar/title.cpp

@ -1,24 +0,0 @@ @@ -1,24 +0,0 @@
#include "title.h"
namespace app::browser::header::bar
{
// Construct
Title::Title(
Bar *bar
) {
// Init dependencies
this->bar = bar;
// Init GTK
this->gtk = gtk_label_new(
Title::LABEL
);
// Render
gtk_widget_show(
GTK_WIDGET(
this->gtk
)
);
}
}

33
src/app/browser/header/bar/title.h

@ -1,33 +0,0 @@ @@ -1,33 +0,0 @@
#ifndef APP_BROWSER_HEADER_BAR_TITLE_H
#define APP_BROWSER_HEADER_BAR_TITLE_H
// Dependencies
#include "../bar.h"
namespace app::browser::header
{
class Bar;
namespace bar
{
class Title
{
public:
// GTK
GtkWidget *gtk;
// Defaults
const char* LABEL = "Yoda";
// Dependencies
Bar *bar;
Title(
Bar *bar
);
};
};
};
#endif
Loading…
Cancel
Save