summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/compat.c21
-rw-r--r--gtk/compat.h4
-rw-r--r--gtk/scaffolding.c4
3 files changed, 27 insertions, 2 deletions
diff --git a/gtk/compat.c b/gtk/compat.c
index 0ae98e120..f65f3acc7 100644
--- a/gtk/compat.c
+++ b/gtk/compat.c
@@ -493,3 +493,24 @@ gboolean nsgtk_stock_lookup(const gchar *stock_id, GtkStockItem *item)
return gtk_stock_lookup(stock_id, item);
#endif
}
+
+/* exported interface documented in gtk/compat.h */
+void nsgtk_window_set_opacity(GtkWindow *window, gdouble opacity)
+{
+#if GTK_CHECK_VERSION(3,8,0)
+ gtk_widget_set_opacity(GTK_WIDGET(window), opacity);
+#else
+ gtk_window_set_opacity(window, opacity);
+#endif
+}
+
+/* exported interface documented in gtk/compat.h */
+void nsgtk_scrolled_window_add_with_viewport(GtkScrolledWindow *window,
+ GtkWidget *child)
+{
+#if GTK_CHECK_VERSION(3,8,0)
+ gtk_container_add(GTK_CONTAINER(window), child);
+#else
+ gtk_scrolled_window_add_with_viewport(window, child);
+#endif
+}
diff --git a/gtk/compat.h b/gtk/compat.h
index 0b5e02e66..eeeeac4c0 100644
--- a/gtk/compat.h
+++ b/gtk/compat.h
@@ -159,6 +159,10 @@ GtkWidget *nsgtk_button_new_from_stock(const gchar *stock_id);
*/
gboolean nsgtk_stock_lookup(const gchar *stock_id, GtkStockItem *item);
+void nsgtk_window_set_opacity(GtkWindow *window, gdouble opacity);
+
+void nsgtk_scrolled_window_add_with_viewport(GtkScrolledWindow *window, GtkWidget *child);
+
GtkWidget *nsgtk_entry_new(void);
void nsgtk_entry_set_icon_from_pixbuf(GtkWidget *entry, GtkEntryIconPosition icon_pos, GdkPixbuf *pixbuf);
diff --git a/gtk/scaffolding.c b/gtk/scaffolding.c
index a5f8c5772..2e51799fc 100644
--- a/gtk/scaffolding.c
+++ b/gtk/scaffolding.c
@@ -1456,7 +1456,7 @@ MULTIHANDLER(localhistory)
-1, -1);
gtk_window_resize(g->history_window->window, width, height);
gtk_window_set_transient_for(g->history_window->window, g->window);
- gtk_window_set_opacity(g->history_window->window, 0.9);
+ nsgtk_window_set_opacity(g->history_window->window, 0.9);
gtk_widget_show(GTK_WIDGET(g->history_window->window));
gtk_window_move(g->history_window->window, x + g->historybase, y +
g->toolbarbase);
@@ -2160,7 +2160,7 @@ struct nsgtk_scaffolding *nsgtk_new_scaffolding(struct gui_window *toplevel)
nsgtk_widget_override_background_color(GTK_WIDGET(g->history_window->drawing_area),
GTK_STATE_NORMAL,
0, 0xffff, 0xffff, 0xffff);
- gtk_scrolled_window_add_with_viewport(g->history_window->scrolled,
+ nsgtk_scrolled_window_add_with_viewport(g->history_window->scrolled,
GTK_WIDGET(g->history_window->drawing_area));
gtk_widget_show(GTK_WIDGET(g->history_window->drawing_area));