mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
init bar title
This commit is contained in:
parent
18c3b8b72c
commit
a830082b6b
5 changed files with 94 additions and 0 deletions
1
Makefile
1
Makefile
|
|
@ -12,6 +12,7 @@ SRCS = src/main.cpp\
|
||||||
src/app/browser/container/tab.cpp\
|
src/app/browser/container/tab.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/menu.cpp
|
src/app/browser/menu.cpp
|
||||||
|
|
||||||
OBJS = $(SRCS:.cpp=.o)
|
OBJS = $(SRCS:.cpp=.o)
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,20 @@ namespace app
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Init title
|
||||||
|
this->title = new bar::Title(
|
||||||
|
this
|
||||||
|
);
|
||||||
|
|
||||||
|
gtk_box_append(
|
||||||
|
GTK_BOX(
|
||||||
|
this->gtk
|
||||||
|
),
|
||||||
|
GTK_WIDGET(
|
||||||
|
this->title->gtk
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// Render
|
// Render
|
||||||
gtk_widget_show(
|
gtk_widget_show(
|
||||||
GTK_WIDGET(
|
GTK_WIDGET(
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
// Requirements
|
// Requirements
|
||||||
#include "../menu.h"
|
#include "../menu.h"
|
||||||
|
#include "bar/title.h"
|
||||||
|
|
||||||
namespace app
|
namespace app
|
||||||
{
|
{
|
||||||
|
|
@ -17,6 +18,11 @@ namespace app
|
||||||
|
|
||||||
namespace header
|
namespace header
|
||||||
{
|
{
|
||||||
|
namespace bar
|
||||||
|
{
|
||||||
|
class Title;
|
||||||
|
};
|
||||||
|
|
||||||
class Bar
|
class Bar
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -32,6 +38,7 @@ namespace app
|
||||||
|
|
||||||
// Requirements
|
// Requirements
|
||||||
Menu *menu;
|
Menu *menu;
|
||||||
|
bar::Title *title;
|
||||||
|
|
||||||
Bar(
|
Bar(
|
||||||
Header *header
|
Header *header
|
||||||
|
|
|
||||||
33
src/app/browser/header/bar/title.cpp
Normal file
33
src/app/browser/header/bar/title.cpp
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#include "title.h"
|
||||||
|
|
||||||
|
namespace app
|
||||||
|
{
|
||||||
|
namespace browser
|
||||||
|
{
|
||||||
|
namespace header
|
||||||
|
{
|
||||||
|
namespace 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
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
39
src/app/browser/header/bar/title.h
Normal file
39
src/app/browser/header/bar/title.h
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
#ifndef APP_BROWSER_HEADER_BAR_TITLE_H
|
||||||
|
#define APP_BROWSER_HEADER_BAR_TITLE_H
|
||||||
|
|
||||||
|
// Dependencies
|
||||||
|
#include "../bar.h"
|
||||||
|
|
||||||
|
namespace app
|
||||||
|
{
|
||||||
|
namespace browser
|
||||||
|
{
|
||||||
|
namespace header
|
||||||
|
{
|
||||||
|
class Bar;
|
||||||
|
|
||||||
|
namespace bar
|
||||||
|
{
|
||||||
|
class Title
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// GTK
|
||||||
|
GtkWidget *gtk;
|
||||||
|
|
||||||
|
// Defaults
|
||||||
|
const char* LABEL = "Yoda";
|
||||||
|
|
||||||
|
// Dependencies
|
||||||
|
Bar *bar;
|
||||||
|
|
||||||
|
Title(
|
||||||
|
Bar *bar
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Add table
Add a link
Reference in a new issue