mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
init tab class
This commit is contained in:
parent
3e24a6fb72
commit
3bcffc4326
1
Makefile
1
Makefile
@ -8,6 +8,7 @@ TARGET = bin/Yoda
|
||||
SRCS = src/main.cpp\
|
||||
src/app/browser.cpp\
|
||||
src/app/browser/container.cpp\
|
||||
src/app/browser/container/tab.cpp\
|
||||
src/app/browser/header.cpp
|
||||
|
||||
OBJS = $(SRCS:.cpp=.o)
|
||||
|
@ -19,6 +19,20 @@ namespace app
|
||||
this->gtk
|
||||
)
|
||||
);
|
||||
|
||||
// Init tab
|
||||
this->tab = new container::Tab(
|
||||
this
|
||||
);
|
||||
|
||||
gtk_box_append(
|
||||
GTK_BOX(
|
||||
this->gtk
|
||||
),
|
||||
GTK_WIDGET(
|
||||
this->tab
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,22 +1,36 @@
|
||||
#ifndef APP_BROWSER_CONTAINER_H
|
||||
#define APP_BROWSER_CONTAINER_H
|
||||
|
||||
// Dependencies
|
||||
#include "../browser.h"
|
||||
|
||||
// Requirements
|
||||
#include "container/tab.h"
|
||||
|
||||
namespace app
|
||||
{
|
||||
class Browser;
|
||||
|
||||
namespace browser
|
||||
{
|
||||
namespace container
|
||||
{
|
||||
class Tab;
|
||||
}
|
||||
|
||||
class Container
|
||||
{
|
||||
public:
|
||||
|
||||
// GTK
|
||||
GtkWidget *gtk;
|
||||
|
||||
// Defaults
|
||||
const gint SPACING = 0;
|
||||
|
||||
// Requirements
|
||||
container::Tab *tab;
|
||||
|
||||
Container(
|
||||
Browser *browser
|
||||
);
|
||||
|
31
src/app/browser/container/tab.cpp
Normal file
31
src/app/browser/container/tab.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include "tab.h"
|
||||
|
||||
namespace app
|
||||
{
|
||||
namespace browser
|
||||
{
|
||||
namespace container
|
||||
{
|
||||
// Construct
|
||||
Tab::Tab(
|
||||
Container *container
|
||||
) {
|
||||
// Init GTK
|
||||
this->gtk = gtk_notebook_new();
|
||||
|
||||
gtk_notebook_set_scrollable(
|
||||
GTK_NOTEBOOK(
|
||||
this->gtk
|
||||
),
|
||||
Tab::SCROLLABLE
|
||||
);
|
||||
|
||||
gtk_widget_show(
|
||||
GTK_WIDGET(
|
||||
this->gtk
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
30
src/app/browser/container/tab.h
Normal file
30
src/app/browser/container/tab.h
Normal file
@ -0,0 +1,30 @@
|
||||
#ifndef APP_BROWSER_CONTAINER_TAB_H
|
||||
#define APP_BROWSER_CONTAINER_TAB_H
|
||||
|
||||
#include "../container.h"
|
||||
|
||||
namespace app
|
||||
{
|
||||
namespace browser
|
||||
{
|
||||
class Container;
|
||||
|
||||
namespace container
|
||||
{
|
||||
class Tab
|
||||
{
|
||||
public:
|
||||
|
||||
GtkWidget *gtk;
|
||||
|
||||
const gboolean SCROLLABLE = true;
|
||||
|
||||
Tab(
|
||||
Container *container
|
||||
);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user