Browse Source

update header bar menu namespace

CPP-GTK4
yggverse 4 months ago
parent
commit
7b8b3b860c
  1. 2
      Makefile
  2. 4
      src/app/browser/header/bar.cpp
  3. 13
      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\
src/app/browser/header.cpp\ src/app/browser/header.cpp\
src/app/browser/header/bar.cpp\ src/app/browser/header/bar.cpp\
src/app/browser/header/bar/title.cpp\ src/app/browser/header/bar/title.cpp\
src/app/browser/menu.cpp src/app/browser/header/bar/menu.cpp
OBJS = $(SRCS:.cpp=.o) OBJS = $(SRCS:.cpp=.o)

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

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

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

@ -5,21 +5,19 @@
#include "../header.h" #include "../header.h"
// Requirements // Requirements
#include "../menu.h" #include "bar/menu.h"
#include "bar/title.h" #include "bar/title.h"
namespace app namespace app::browser
{
namespace browser
{ {
class Header; class Header;
class Menu;
namespace header namespace header
{ {
namespace bar namespace bar
{ {
class Menu;
class Title; class Title;
}; };
@ -37,7 +35,7 @@ namespace app
Header *header; Header *header;
// Requirements // Requirements
Menu *menu; bar::Menu *menu;
bar::Title *title; bar::Title *title;
Bar( Bar(
@ -46,6 +44,5 @@ namespace app
}; };
}; };
}; };
};
#endif #endif

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

@ -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 @@
#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 @@
#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 @@
#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