mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
init header menu
This commit is contained in:
parent
d6fc439908
commit
f6e855e4b2
5 changed files with 74 additions and 1 deletions
|
|
@ -8,6 +8,9 @@ namespace app
|
|||
Header::Header(
|
||||
Browser *browser
|
||||
) {
|
||||
// Init dependencies
|
||||
this->browser = browser;
|
||||
|
||||
// Init GTK
|
||||
this->gtk = gtk_header_bar_new();
|
||||
|
||||
|
|
@ -18,6 +21,15 @@ namespace app
|
|||
Header::SHOW_TITLE_BUTTONS
|
||||
);
|
||||
|
||||
// Init title widget
|
||||
gtk_header_bar_set_title_widget(
|
||||
GTK_HEADER_BAR(
|
||||
this->gtk
|
||||
),
|
||||
(new Menu(this->browser))->gtk // @TODO
|
||||
);
|
||||
|
||||
// Render
|
||||
gtk_widget_show(
|
||||
GTK_WIDGET(
|
||||
this->gtk
|
||||
|
|
|
|||
|
|
@ -1,22 +1,36 @@
|
|||
#ifndef APP_BROWSER_HEADER_H
|
||||
#define APP_BROWSER_HEADER_H
|
||||
|
||||
// Dependencies
|
||||
#include "../browser.h"
|
||||
|
||||
// Requirements
|
||||
#include "menu.h"
|
||||
|
||||
namespace app
|
||||
{
|
||||
class Browser;
|
||||
|
||||
namespace browser
|
||||
{
|
||||
class Menu;
|
||||
|
||||
class Header
|
||||
{
|
||||
public:
|
||||
|
||||
// GTK
|
||||
GtkWidget *gtk;
|
||||
|
||||
// Defaults
|
||||
const gboolean SHOW_TITLE_BUTTONS = true;
|
||||
|
||||
// Dependencies
|
||||
Browser *browser;
|
||||
|
||||
// Requirements
|
||||
Menu *menu;
|
||||
|
||||
Header(
|
||||
Browser *browser
|
||||
);
|
||||
|
|
|
|||
21
src/app/browser/menu.cpp
Normal file
21
src/app/browser/menu.cpp
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include "header.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
Normal file
25
src/app/browser/menu.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef APP_BROWSER_MENU_H
|
||||
#define APP_BROWSER_MENU_H
|
||||
|
||||
#include "../menu.h"
|
||||
|
||||
namespace app
|
||||
{
|
||||
class Browser;
|
||||
|
||||
namespace browser
|
||||
{
|
||||
class Menu
|
||||
{
|
||||
public:
|
||||
|
||||
GtkWidget *gtk;
|
||||
|
||||
Menu(
|
||||
Browser *browser
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue