update header init

This commit is contained in:
yggverse 2024-08-05 01:12:28 +03:00
parent 7c5c72a43f
commit 5d042b84b0
4 changed files with 7 additions and 30 deletions

View File

@ -9,13 +9,6 @@ Yoda::Browser::Browser(
)
);
gtk_window_set_title(
GTK_WINDOW(
this->gtk
),
Browser::TITLE
);
gtk_window_set_default_size(
GTK_WINDOW(
this->gtk
@ -24,15 +17,11 @@ Yoda::Browser::Browser(
Browser::HEIGHT
);
GtkWidget *label = gtk_label_new(
"Hello, World!"
);
gtk_window_set_child(
gtk_window_set_titlebar(
GTK_WINDOW(
this->gtk
),
label
(new YodaBrowser::Header())->gtk
);
gtk_widget_show(
@ -40,6 +29,4 @@ Yoda::Browser::Browser(
this->gtk
)
);
// @TODO signals
}

View File

@ -3,6 +3,8 @@
#include "../main.h"
#include "Browser/Header.h"
namespace Yoda
{
class Browser
@ -13,7 +15,6 @@ namespace Yoda
const guint WIDTH = 640;
const guint HEIGHT = 480;
const gchar* TITLE = "Yoda";
Browser(
GtkApplication *application

View File

@ -1,8 +1,7 @@
#include "Header.h"
YodaBrowser::Header::Header(
Yoda::Browser *browser
) {
YodaBrowser::Header::Header()
{
// Init GTK
this->gtk = gtk_header_bar_new();

View File

@ -3,27 +3,17 @@
#include "../../main.h"
#include "../Browser.h"
namespace YodaBrowser
{
class Header
{
public:
// GTK
GtkWidget *gtk;
// Dependencies
Yoda::Browser *browser;
// Defaults
const gboolean SHOW_TITLE_BUTTONS = true;
// Construct
Header(
Yoda::Browser *browser
);
Header();
};
};