mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
init tab class
This commit is contained in:
parent
3e24a6fb72
commit
3bcffc4326
5 changed files with 90 additions and 0 deletions
1
Makefile
1
Makefile
|
|
@ -8,6 +8,7 @@ TARGET = bin/Yoda
|
||||||
SRCS = src/main.cpp\
|
SRCS = src/main.cpp\
|
||||||
src/app/browser.cpp\
|
src/app/browser.cpp\
|
||||||
src/app/browser/container.cpp\
|
src/app/browser/container.cpp\
|
||||||
|
src/app/browser/container/tab.cpp\
|
||||||
src/app/browser/header.cpp
|
src/app/browser/header.cpp
|
||||||
|
|
||||||
OBJS = $(SRCS:.cpp=.o)
|
OBJS = $(SRCS:.cpp=.o)
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,20 @@ namespace app
|
||||||
this->gtk
|
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
|
#ifndef APP_BROWSER_CONTAINER_H
|
||||||
#define APP_BROWSER_CONTAINER_H
|
#define APP_BROWSER_CONTAINER_H
|
||||||
|
|
||||||
|
// Dependencies
|
||||||
#include "../browser.h"
|
#include "../browser.h"
|
||||||
|
|
||||||
|
// Requirements
|
||||||
|
#include "container/tab.h"
|
||||||
|
|
||||||
namespace app
|
namespace app
|
||||||
{
|
{
|
||||||
class Browser;
|
class Browser;
|
||||||
|
|
||||||
namespace browser
|
namespace browser
|
||||||
{
|
{
|
||||||
|
namespace container
|
||||||
|
{
|
||||||
|
class Tab;
|
||||||
|
}
|
||||||
|
|
||||||
class Container
|
class Container
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
// GTK
|
||||||
GtkWidget *gtk;
|
GtkWidget *gtk;
|
||||||
|
|
||||||
|
// Defaults
|
||||||
const gint SPACING = 0;
|
const gint SPACING = 0;
|
||||||
|
|
||||||
|
// Requirements
|
||||||
|
container::Tab *tab;
|
||||||
|
|
||||||
Container(
|
Container(
|
||||||
Browser *browser
|
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…
Add table
Add a link
Reference in a new issue