switch to gtkmm

This commit is contained in:
yggverse 2024-08-08 12:44:27 +03:00
parent 058aabce26
commit d3e894e0ac
28 changed files with 50 additions and 1413 deletions

View file

@ -1,82 +1,15 @@
#include "browser.h"
namespace app
using namespace app;
Browser::Browser()
{
// Construct
Browser::Browser(
GtkApplication *application
) {
// Init dependencies
this->app = application;
set_title(
TITLE
);
// Init GTK
this->gtk = gtk_application_window_new(
GTK_APPLICATION(
this->app
)
);
gtk_window_set_default_size(
GTK_WINDOW(
this->gtk
),
Browser::WIDTH,
Browser::HEIGHT
);
// Init header
this->header = new browser::Header(
this
);
gtk_window_set_titlebar(
GTK_WINDOW(
this->gtk
),
GTK_WIDGET(
this->header->gtk
)
);
// Init container
this->container = new browser::Container(
this
);
gtk_window_set_child(
GTK_WINDOW(
this->gtk
),
GTK_WIDGET(
this->container->gtk
)
);
// Render
gtk_widget_show(
GTK_WIDGET(
this->gtk
)
);
// Connect signals
g_signal_connect(
G_APPLICATION(
this->app
),
"shutdown",
G_CALLBACK(
_shutdown
),
NULL
);
}
// Events
void Browser::_shutdown(
GtkApplication *application
) {
// @TODO save session, clean cache, etc
g_print("Shutdown..\n");
}
}
set_default_size(
WIDTH,
HEIGHT
);
}