pull in libhandy optionally

This commit is contained in:
ouwou
2022-04-08 14:50:11 -04:00
parent c22a49f64e
commit 5a13c7fef7
3 changed files with 102 additions and 39 deletions

View File

@@ -17,6 +17,10 @@
#include "windows/pinnedwindow.hpp"
#include "windows/threadswindow.hpp"
#ifdef WITH_LIBHANDY
#include <handy.h>
#endif
#ifdef _WIN32
#pragma comment(lib, "crypt32.lib")
#endif
@@ -62,6 +66,12 @@ Abaddon &Abaddon::Get() {
int Abaddon::StartGTK() {
m_gtk_app = Gtk::Application::create("com.github.uowuo.abaddon");
#ifdef WITH_LIBHANDY
m_gtk_app->signal_activate().connect([] {
hdy_init();
});
#endif
m_css_provider = Gtk::CssProvider::create();
m_css_provider->signal_parsing_error().connect([](const Glib::RefPtr<const Gtk::CssSection> &section, const Glib::Error &error) {
Gtk::MessageDialog dlg("css failed parsing (" + error.what() + ")", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);