Browse Source

update header bar menu namespace

CPP-GTK4
yggverse 5 months ago
parent
commit
7b8b3b860c
  1. 2
      Makefile
  2. 4
      src/app/browser/header/bar.cpp
  3. 51
      src/app/browser/header/bar.h
  4. 18
      src/app/browser/header/bar/menu.cpp
  5. 25
      src/app/browser/header/bar/menu.h
  6. 21
      src/app/browser/menu.cpp
  7. 25
      src/app/browser/menu.h

2
Makefile

@ -13,7 +13,7 @@ SRCS = src/main.cpp\ @@ -13,7 +13,7 @@ SRCS = src/main.cpp\
src/app/browser/header.cpp\
src/app/browser/header/bar.cpp\
src/app/browser/header/bar/title.cpp\
src/app/browser/menu.cpp
src/app/browser/header/bar/menu.cpp
OBJS = $(SRCS:.cpp=.o)

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

@ -20,8 +20,8 @@ namespace app @@ -20,8 +20,8 @@ namespace app
);
// Init menu
this->menu = new Menu(
this->header->browser
this->menu = new bar::Menu(
this
);
gtk_box_append(

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

@ -5,45 +5,42 @@ @@ -5,45 +5,42 @@
#include "../header.h"
// Requirements
#include "../menu.h"
#include "bar/menu.h"
#include "bar/title.h"
namespace app
namespace app::browser
{
namespace browser
class Header;
namespace header
{
class Header;
namespace bar
{
class Menu;
class Menu;
class Title;
};
namespace header
class Bar
{
namespace bar
{
class Title;
};
class Bar
{
public:
public:
// GTK
GtkWidget *gtk;
// GTK
GtkWidget *gtk;
// Defaults
const gint SPACING = 0;
// Defaults
const gint SPACING = 0;
// Dependencies
Header *header;
// Dependencies
Header *header;
// Requirements
Menu *menu;
bar::Title *title;
// Requirements
bar::Menu *menu;
bar::Title *title;
Bar(
Header *header
);
};
Bar(
Header *header
);
};
};
};

18
src/app/browser/header/bar/menu.cpp

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
#include "menu.h"
namespace app::browser::header::bar
{
// Construct
Menu::Menu(
Bar *bar
) {
// Init GTK
this->gtk = gtk_menu_button_new();
gtk_widget_show(
GTK_WIDGET(
this->gtk
)
);
}
}

25
src/app/browser/header/bar/menu.h

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
#ifndef APP_BROWSER_HEADER_BAR_MENU_H
#define APP_BROWSER_HEADER_BAR_MENU_H
#include "../bar.h"
namespace app::browser::header
{
class Bar;
namespace bar
{
class Menu
{
public:
GtkWidget *gtk;
Menu(
Bar *bar
);
};
};
};
#endif

21
src/app/browser/menu.cpp

@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
#include "menu.h"
namespace app
{
namespace browser
{
// Construct
Menu::Menu(
Browser *browser
) {
// Init GTK
this->gtk = gtk_menu_button_new();
gtk_widget_show(
GTK_WIDGET(
this->gtk
)
);
}
}
}

25
src/app/browser/menu.h

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
#ifndef APP_BROWSER_MENU_H
#define APP_BROWSER_MENU_H
#include "../browser.h"
namespace app
{
class Browser;
namespace browser
{
class Menu
{
public:
GtkWidget *gtk;
Menu(
Browser *browser
);
};
};
};
#endif
Loading…
Cancel
Save