mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement main menu popover (container)
This commit is contained in:
parent
7b8b3b860c
commit
5075798b0e
5 changed files with 90 additions and 1 deletions
|
|
@ -6,9 +6,28 @@ namespace app::browser::header::bar
|
|||
Menu::Menu(
|
||||
Bar *bar
|
||||
) {
|
||||
// Init dependencies
|
||||
this->bar = bar;
|
||||
|
||||
// Init GTK
|
||||
this->gtk = gtk_menu_button_new();
|
||||
|
||||
// Init requirements
|
||||
this->main = new menu::Main(
|
||||
this
|
||||
);
|
||||
|
||||
// Init main popover
|
||||
gtk_menu_button_set_popover(
|
||||
GTK_MENU_BUTTON(
|
||||
this->gtk
|
||||
),
|
||||
GTK_WIDGET(
|
||||
this->main->gtk
|
||||
)
|
||||
);
|
||||
|
||||
// Render
|
||||
gtk_widget_show(
|
||||
GTK_WIDGET(
|
||||
this->gtk
|
||||
|
|
|
|||
|
|
@ -1,20 +1,37 @@
|
|||
#ifndef APP_BROWSER_HEADER_BAR_MENU_H
|
||||
#define APP_BROWSER_HEADER_BAR_MENU_H
|
||||
|
||||
// Dependencies
|
||||
#include "../bar.h"
|
||||
|
||||
// Requirements
|
||||
#include "menu/main.h"
|
||||
|
||||
namespace app::browser::header
|
||||
{
|
||||
class Bar;
|
||||
|
||||
namespace bar
|
||||
{
|
||||
namespace menu
|
||||
{
|
||||
class Main;
|
||||
};
|
||||
|
||||
class Menu
|
||||
{
|
||||
public:
|
||||
|
||||
// GTK
|
||||
GtkWidget *gtk;
|
||||
|
||||
// Dependencies
|
||||
Bar *bar;
|
||||
|
||||
// Requirements
|
||||
menu::Main *main;
|
||||
|
||||
// Constructor
|
||||
Menu(
|
||||
Bar *bar
|
||||
);
|
||||
|
|
|
|||
15
src/app/browser/header/bar/menu/main.cpp
Normal file
15
src/app/browser/header/bar/menu/main.cpp
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#include "main.h"
|
||||
|
||||
namespace app::browser::header::bar::menu
|
||||
{
|
||||
// Construct
|
||||
Main::Main(
|
||||
Menu *menu
|
||||
) {
|
||||
// Init dependencies
|
||||
this->menu = menu;
|
||||
|
||||
// Init GTK
|
||||
this->gtk = gtk_popover_new();
|
||||
}
|
||||
}
|
||||
37
src/app/browser/header/bar/menu/main.h
Normal file
37
src/app/browser/header/bar/menu/main.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef APP_BROWSER_HEADER_BAR_MENU_MAIN_H
|
||||
#define APP_BROWSER_HEADER_BAR_MENU_MAIN_H
|
||||
|
||||
// Dependencies
|
||||
#include "../menu.h"
|
||||
|
||||
// Requirements
|
||||
// ..
|
||||
|
||||
namespace app::browser::header::bar
|
||||
{
|
||||
class Menu;
|
||||
|
||||
namespace menu
|
||||
{
|
||||
class Main
|
||||
{
|
||||
public:
|
||||
|
||||
// GTK
|
||||
GtkWidget *gtk;
|
||||
|
||||
// Dependencies
|
||||
Menu *menu;
|
||||
|
||||
// Requirements
|
||||
// ..
|
||||
|
||||
// Constructor
|
||||
Main(
|
||||
Menu *menu
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue