| 5128 if (val && G_VALUE_HOLDS_BOOLEAN(val)) |
5128 if (val && G_VALUE_HOLDS_BOOLEAN(val)) |
| 5129 /* this does not work :( */ |
5129 /* this does not work :( */ |
| 5130 webkit_web_view_set_transparent(webview, g_value_get_boolean(val)); |
5130 webkit_web_view_set_transparent(webview, g_value_get_boolean(val)); |
| 5131 } |
5131 } |
| 5132 |
5132 |
| |
5133 static void |
| |
5134 conv_variant_changed_cb(GObject *gobject, GParamSpec *pspec, gpointer user_data) |
| |
5135 { |
| |
5136 PidginConversation *gtkconv = user_data; |
| |
5137 const char *path; |
| |
5138 char *js; |
| |
5139 |
| |
5140 path = pidgin_conversation_theme_get_css_path(PIDGIN_CONV_THEME(gobject)); |
| |
5141 js = g_strdup_printf("setStylesheet(\"mainStyle\", \"file://%s\");", path); |
| |
5142 gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), js); |
| |
5143 g_free(js); |
| |
5144 } |
| |
5145 |
| 5133 static GtkWidget * |
5146 static GtkWidget * |
| 5134 setup_common_pane(PidginConversation *gtkconv) |
5147 setup_common_pane(PidginConversation *gtkconv) |
| 5135 { |
5148 { |
| 5136 GtkWidget *vbox, *frame, *webview_sw, *event_box; |
5149 GtkWidget *vbox, *frame, *webview_sw, *event_box; |
| 5137 GtkCellRenderer *rend; |
5150 GtkCellRenderer *rend; |
| 5255 baseuri = g_strdup_printf("file://%s", basedir); |
5268 baseuri = g_strdup_printf("file://%s", basedir); |
| 5256 webkit_web_view_load_string(WEBKIT_WEB_VIEW(gtkconv->webview), template, "text/html", "UTF-8", baseuri); |
5269 webkit_web_view_load_string(WEBKIT_WEB_VIEW(gtkconv->webview), template, "text/html", "UTF-8", baseuri); |
| 5257 |
5270 |
| 5258 if (chat) |
5271 if (chat) |
| 5259 gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), "document.getElementById('Chat').className = 'groupchat'"); |
5272 gtk_webview_safe_execute_script(GTK_WEBVIEW(gtkconv->webview), "document.getElementById('Chat').className = 'groupchat'"); |
| |
5273 |
| |
5274 g_signal_connect(G_OBJECT(gtkconv->theme), "notify::variant", |
| |
5275 G_CALLBACK(conv_variant_changed_cb), gtkconv); |
| 5260 |
5276 |
| 5261 g_free(basedir); |
5277 g_free(basedir); |
| 5262 g_free(baseuri); |
5278 g_free(baseuri); |
| 5263 g_free(template); |
5279 g_free(template); |
| 5264 } |
5280 } |