init tab class

This commit is contained in:
yggverse 2024-08-05 03:52:02 +03:00
parent 3e24a6fb72
commit 3bcffc4326
5 changed files with 90 additions and 0 deletions

View File

@ -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)

View File

@ -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
)
);
}
}
}

View File

@ -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
);

View 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
)
);
}
}
}
}

View 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