[geany/geany-plugins] f32def: Merge pull request #862 from LarsGit223/gnb-gtk3

Frank Lanitz git-noreply at xxxxx
Mon May 20 08:36:04 UTC 2019


Branch:      refs/heads/master
Author:      Frank Lanitz <frank at frank.uvena.de>
Committer:   GitHub <noreply at github.com>
Date:        Mon, 20 May 2019 08:36:04 UTC
Commit:      f32def6396f4be3cdb2c5d556afe065312599b6d
             https://github.com/geany/geany-plugins/commit/f32def6396f4be3cdb2c5d556afe065312599b6d

Log Message:
-----------
Merge pull request #862 from LarsGit223/gnb-gtk3

geanynumberedbookmarks: fixed deprecated gtk calls for gtk3


Modified Paths:
--------------
    build/geanynumberedbookmarks.m4
    geanynumberedbookmarks/src/Makefile.am
    geanynumberedbookmarks/src/geanynumberedbookmarks.c
    utils/src/gp_gtkcompat.h

Modified: build/geanynumberedbookmarks.m4
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -1,6 +1,8 @@
 AC_DEFUN([GP_CHECK_GEANYNUMBEREDBOOKMARKS],
 [
     GP_ARG_DISABLE([GeanyNumberedBookmarks], [auto])
+    GP_CHECK_UTILSLIB([GeanyNumberedBookmarks])
+
     GP_COMMIT_PLUGIN_STATUS([GeanyNumberedBookmarks])
     AC_CONFIG_FILES([
         geanynumberedbookmarks/Makefile


Modified: geanynumberedbookmarks/src/Makefile.am
5 lines changed, 4 insertions(+), 1 deletions(-)
===================================================================
@@ -5,4 +5,7 @@ geanyplugins_LTLIBRARIES = geanynumberedbookmarks.la
 
 geanynumberedbookmarks_la_SOURCES = geanynumberedbookmarks.c
 geanynumberedbookmarks_la_CPPFLAGS = $(AM_CPPFLAGS) -DG_LOG_DOMAIN=\"GeanyNumberedBookmarks\"
-geanynumberedbookmarks_la_LIBADD = $(COMMONLIBS)
+geanynumberedbookmarks_la_CFLAGS = $(AM_CFLAGS) \
+	-I$(top_srcdir)/utils/src
+geanynumberedbookmarks_la_LIBADD = $(COMMONLIBS) \
+	$(top_builddir)/utils/src/libgeanypluginutils.la


Modified: geanynumberedbookmarks/src/geanynumberedbookmarks.c
16 lines changed, 15 insertions(+), 1 deletions(-)
===================================================================
@@ -20,6 +20,7 @@
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 #include <glib/gstdio.h>
+#include <gp_gtkcompat.h>
 
 static const gint base64_char_to_int[]=
 {
@@ -1289,10 +1290,19 @@ will move the bookmark there if it was set on a different line, or create it if
 	scroll=gtk_scrolled_window_new(NULL,NULL);
 	gtk_scrolled_window_set_policy((GtkScrolledWindow*)scroll,GTK_POLICY_NEVER,
 	                               GTK_POLICY_AUTOMATIC);
+#if GTK_CHECK_VERSION(3, 8, 0)
+	gtk_widget_set_size_request(label, 600, -1);
+	gtk_widget_set_halign(label, GTK_ALIGN_CENTER);
+	gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
+	gtk_widget_set_vexpand(label, TRUE);
+	gtk_container_add(GTK_CONTAINER(scroll),label);
+	gtk_scrolled_window_set_shadow_type((GtkScrolledWindow*)scroll, GTK_SHADOW_IN);
+#else
 	gtk_scrolled_window_add_with_viewport((GtkScrolledWindow*)scroll,label);
+#endif
 
 	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),scroll);
-	gtk_widget_show(scroll);
+	gtk_widget_show_all(dialog);
 
 	/* set dialog size (leave width default) */
 	gtk_widget_set_size_request(dialog,-1,300);
@@ -1475,7 +1485,11 @@ void plugin_init(GeanyData *data)
 {
 	gint i,k,iResults=0;
 	GdkKeymapKey *gdkkmkResults;
+#if GTK_CHECK_VERSION(3, 22, 0)
+	GdkKeymap *gdkKeyMap=gdk_keymap_get_for_display(gdk_display_get_default());
+#else
 	GdkKeymap *gdkKeyMap=gdk_keymap_get_default();
+#endif
 
 	/* Load settings */
 	LoadSettings();


Modified: utils/src/gp_gtkcompat.h
2 lines changed, 2 insertions(+), 0 deletions(-)
===================================================================
@@ -48,8 +48,10 @@ G_BEGIN_DECLS
 #if GTK_CHECK_VERSION(3, 10, 0)
 #undef GTK_STOCK_OPEN
 #undef GTK_STOCK_CANCEL
+#undef GTK_STOCK_OK
 #define GTK_STOCK_OPEN   _("_Open")
 #define GTK_STOCK_CANCEL _("_Cancel")
+#define GTK_STOCK_OK _("_OK")
 #endif
 
 /* Replace calls to gtk_icon_info_free() with call to



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list