summaryrefslogtreecommitdiff
path: root/mate-dictionary/src
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2016-05-30 17:16:15 +0200
committerraveit65 <[email protected]>2016-05-30 17:16:15 +0200
commitb446782d0f4a7ce1c91a1092c979c5fe2fdbb9dd (patch)
tree1ba68b5ea9267737a91daee002bfa269ac0a25e9 /mate-dictionary/src
parente07af0d9049af36e1670a12deff39ea09616b6cd (diff)
downloadmate-utils-b446782d0f4a7ce1c91a1092c979c5fe2fdbb9dd.tar.bz2
mate-utils-b446782d0f4a7ce1c91a1092c979c5fe2fdbb9dd.tar.xz
GTK+3 mdict: do not use deprecated gtk_widget_size_request
Diffstat (limited to 'mate-dictionary/src')
-rw-r--r--mate-dictionary/src/gdict-applet.c6
-rw-r--r--mate-dictionary/src/gdict-sidebar.c6
-rw-r--r--mate-dictionary/src/gdict-window.c6
3 files changed, 15 insertions, 3 deletions
diff --git a/mate-dictionary/src/gdict-applet.c b/mate-dictionary/src/gdict-applet.c
index 009e1502..424a4c75 100644
--- a/mate-dictionary/src/gdict-applet.c
+++ b/mate-dictionary/src/gdict-applet.c
@@ -38,6 +38,10 @@
#include "gdict-common.h"
#include "gdict-aligned-window.h"
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
#define GDICT_APPLET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDICT_TYPE_APPLET, GdictAppletClass))
#define GDICT_APPLET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDICT_TYPE_APPLET, GdictAppletClass))
@@ -149,7 +153,7 @@ set_window_default_size (GdictApplet *applet)
height = font_size * WINDOW_NUM_ROWS;
/* Use at least the requisition size of the window... */
- gtk_widget_size_request (widget, &req);
+ gtk_widget_get_preferred_size (widget, NULL, &req);
width = MAX (width, req.width);
height = MAX (height, req.height);
diff --git a/mate-dictionary/src/gdict-sidebar.c b/mate-dictionary/src/gdict-sidebar.c
index 9709a78d..c88aebb0 100644
--- a/mate-dictionary/src/gdict-sidebar.c
+++ b/mate-dictionary/src/gdict-sidebar.c
@@ -36,6 +36,10 @@
#include "gdict-sidebar.h"
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
typedef struct
{
guint index;
@@ -176,7 +180,7 @@ gdict_sidebar_select_button_press_cb (GtkWidget *widget,
gtk_widget_get_allocation (widget, &allocation);
width = allocation.width;
gtk_widget_set_size_request (sidebar->priv->menu, -1, -1);
- gtk_widget_size_request (sidebar->priv->menu, &req);
+ gtk_widget_get_preferred_size (sidebar->priv->menu, &req, NULL);
gtk_widget_set_size_request (sidebar->priv->menu,
MAX (width, req.width), -1);
gtk_widget_grab_focus (widget);
diff --git a/mate-dictionary/src/gdict-window.c b/mate-dictionary/src/gdict-window.c
index 7c917d36..90356d46 100644
--- a/mate-dictionary/src/gdict-window.c
+++ b/mate-dictionary/src/gdict-window.c
@@ -61,6 +61,10 @@
#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
#endif
+#if !GTK_CHECK_VERSION(3,0,0)
+#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,y)
+#endif
+
enum
{
COMPLETION_TEXT_COLUMN,
@@ -1651,7 +1655,7 @@ set_window_default_size (GdictWindow *window)
height = font_size * GDICT_WINDOW_ROWS;
/* Use at least the requisition size of the window... */
- gtk_widget_size_request (widget, &req);
+ gtk_widget_get_preferred_size (widget, NULL, &req);
width = MAX (width, req.width);
height = MAX (height, req.height);