|
@@ -46,12 +46,11 @@ struct _IridiumWindow
|
|
|
GtkToggleButton *toggle_html_view;
|
|
GtkToggleButton *toggle_html_view;
|
|
|
GtkRevealer *notification_revealer;
|
|
GtkRevealer *notification_revealer;
|
|
|
WebKitWebView *html_view;
|
|
WebKitWebView *html_view;
|
|
|
-
|
|
|
|
|
GBinding *title_binding;
|
|
GBinding *title_binding;
|
|
|
GBinding *content_binding;
|
|
GBinding *content_binding;
|
|
|
|
|
|
|
|
- IridiumMarkdown *markdown;
|
|
|
|
|
- IridiumStandardFile *client;
|
|
|
|
|
|
|
+ IridiumMarkdown *markdown;
|
|
|
|
|
+ IridiumStandardFile *client;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
G_DEFINE_TYPE (IridiumWindow, iridium_window, GTK_TYPE_APPLICATION_WINDOW)
|
|
G_DEFINE_TYPE (IridiumWindow, iridium_window, GTK_TYPE_APPLICATION_WINDOW)
|
|
@@ -328,6 +327,10 @@ iridium_window_init (IridiumWindow *self)
|
|
|
GtkStyleProvider *provider;
|
|
GtkStyleProvider *provider;
|
|
|
GtkSourceBuffer *buffer;
|
|
GtkSourceBuffer *buffer;
|
|
|
GSimpleAction *action;
|
|
GSimpleAction *action;
|
|
|
|
|
+ GBytes *style_data;
|
|
|
|
|
+ WebKitUserContentManager *content_manager;
|
|
|
|
|
+ WebKitUserStyleSheet *stylesheet;
|
|
|
|
|
+ GError *error = NULL;
|
|
|
|
|
|
|
|
gtk_widget_init_template (GTK_WIDGET (self));
|
|
gtk_widget_init_template (GTK_WIDGET (self));
|
|
|
|
|
|
|
@@ -337,6 +340,14 @@ iridium_window_init (IridiumWindow *self)
|
|
|
self->markdown = iridium_markdown_new ();
|
|
self->markdown = iridium_markdown_new ();
|
|
|
self->client = iridium_standard_file_new ();
|
|
self->client = iridium_standard_file_new ();
|
|
|
|
|
|
|
|
|
|
+ style_data = g_resources_lookup_data ("/net/bloerg/Iridium/iridium-theme.css",
|
|
|
|
|
+ G_RESOURCE_LOOKUP_FLAGS_NONE, &error);
|
|
|
|
|
+ content_manager = webkit_web_view_get_user_content_manager (self->html_view);
|
|
|
|
|
+ stylesheet = webkit_user_style_sheet_new ((const gchar *) g_bytes_get_data (style_data, NULL),
|
|
|
|
|
+ WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_STYLE_LEVEL_AUTHOR, NULL, NULL);
|
|
|
|
|
+ webkit_user_content_manager_add_style_sheet (content_manager, stylesheet);
|
|
|
|
|
+ g_bytes_unref (style_data);
|
|
|
|
|
+
|
|
|
action = g_simple_action_new ("search", NULL);
|
|
action = g_simple_action_new ("search", NULL);
|
|
|
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (action));
|
|
g_action_map_add_action (G_ACTION_MAP (self), G_ACTION (action));
|
|
|
g_signal_connect (action, "activate", G_CALLBACK (search_activated), self);
|
|
g_signal_connect (action, "activate", G_CALLBACK (search_activated), self);
|