mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
switch to gtkmm
This commit is contained in:
parent
058aabce26
commit
d3e894e0ac
28 changed files with 50 additions and 1413 deletions
|
|
@ -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
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue