summaryrefslogtreecommitdiff
path: root/pluma/pluma-window.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-10-30 00:56:56 +0100
committerStefano Karapetsas <[email protected]>2013-10-30 00:56:56 +0100
commit7f0ccea48196a0da9523db3d566ee8020cd742a1 (patch)
tree4a66f87edcc70ca3949c750148df218c9a41ba28 /pluma/pluma-window.c
parent5f87f646777bf5b09610bbc6eed8fafd007f34c6 (diff)
downloadpluma-7f0ccea48196a0da9523db3d566ee8020cd742a1.tar.bz2
pluma-7f0ccea48196a0da9523db3d566ee8020cd742a1.tar.xz
pluma: Add GTK3 support
Diffstat (limited to 'pluma/pluma-window.c')
-rw-r--r--pluma/pluma-window.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c
index e4f6a541..b783d62c 100644
--- a/pluma/pluma-window.c
+++ b/pluma/pluma-window.c
@@ -38,6 +38,7 @@
#include <glib/gi18n.h>
#include <gio/gio.h>
+#include <gtksourceview/gtksource.h>
#include "pluma-ui.h"
#include "pluma-window.h"
@@ -61,6 +62,10 @@
#include "osx/pluma-osx.h"
#endif
+#if GTK_CHECK_VERSION (3, 0, 0)
+#define GTK_WIDGET_VISIBLE gtk_widget_get_visible
+#endif
+
#define LANGUAGE_NONE (const gchar *)"LangNone"
#define PLUMA_UIFILE "pluma-ui.xml"
#define TAB_WIDTH_DATA "PlumaWindowTabWidthData"
@@ -2434,8 +2439,12 @@ language_changed (GObject *object,
}
static void
-notebook_switch_page (GtkNotebook *book,
+notebook_switch_page (GtkNotebook *book,
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkWidget *pg,
+#else
GtkNotebookPage *pg,
+#endif
gint page_num,
PlumaWindow *window)
{
@@ -3597,13 +3606,20 @@ static void
vpaned_restore_position (GtkWidget *widget,
PlumaWindow *window)
{
+ GtkAllocation allocation;
gint pos;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_get_allocation (widget, &allocation);
+#else
+ allocation = widget->allocation;
+#endif
+
pluma_debug_message (DEBUG_WINDOW,
"Restoring vpaned position: bottom panel size %d",
window->priv->bottom_panel_size);
- pos = widget->allocation.height -
+ pos = allocation.height -
MAX (50, window->priv->bottom_panel_size);
gtk_paned_set_position (GTK_PANED (window->priv->vpaned), pos);