#include "widgets/webWidget.hpp" #include #include #include "components/button/iconButton.hpp" WebWidget::WebWidget(Icon::Type icon, std::string name, std::string url) : Popover(icon, name) { auto webview = webkit_web_view_new(); gtk_widget_set_hexpand(webview, true); gtk_widget_set_vexpand(webview, true); gtk_widget_set_size_request(webview, 1024, 768); auto settings = webkit_web_view_get_settings(WEBKIT_WEB_VIEW(webview)); webkit_settings_set_hardware_acceleration_policy( settings, WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER); webkit_web_view_load_uri(WEBKIT_WEB_VIEW(webview), url.c_str()); this->set_popover_child(*Glib::wrap(webview)); }