[Xfce4-commits] [apps/xfce4-dict] 29/43: Replace GtkWidgetClass::size_request by get_preferred_width/height

noreply at xfce.org noreply at xfce.org
Tue Nov 1 00:31:42 CET 2016


This is an automated email from the git hooks/post-receive script.

andre pushed a commit to branch master
in repository apps/xfce4-dict.

commit ec81b772df9271bab49ccc7708b98486bc28b094
Author: Andre Miranda <andre42m at gmail.com>
Date:   Sun Aug 21 18:01:26 2016 -0300

    Replace GtkWidgetClass::size_request by get_preferred_width/height
---
 lib/wraplabel.c | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/lib/wraplabel.c b/lib/wraplabel.c
index 1c454b4..b1d10cf 100644
--- a/lib/wraplabel.c
+++ b/lib/wraplabel.c
@@ -55,13 +55,16 @@ G_DEFINE_TYPE(XfdWrapLabel, xfd_wrap_label, GTK_TYPE_LABEL);
 static void xfd_wrap_label_size_request		(GtkWidget *widget, GtkRequisition *req);
 static void xfd_wrap_label_size_allocate	(GtkWidget *widget, GtkAllocation *alloc);
 static void xfd_wrap_label_set_wrap_width	(GtkWidget *widget, gsize width);
+static void xfd_wrap_label_get_preferred_width	(GtkWidget *widget, gint *minimal_width, gint *natural_width);
+static void xfd_wrap_label_get_preferred_height	(GtkWidget *widget, gint *minimal_height, gint *natural_height);
 
 
 static void xfd_wrap_label_class_init(XfdWrapLabelClass *klass)
 {
 	GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
 
-	widget_class->size_request = xfd_wrap_label_size_request;
+	widget_class->get_preferred_width = xfd_wrap_label_get_preferred_width;
+	widget_class->get_preferred_height = xfd_wrap_label_get_preferred_height;
 	widget_class->size_allocate = xfd_wrap_label_size_allocate;
 
 	g_type_class_add_private(klass, sizeof (XfdWrapLabelPrivate));
@@ -121,6 +124,25 @@ static void xfd_wrap_label_size_allocate(GtkWidget *widget, GtkAllocation *alloc
 }
 
 
+static void
+xfd_wrap_label_get_preferred_width (GtkWidget *widget, gint *minimal_width, gint *natural_width)
+{
+  GtkRequisition requisition;
+
+  xfd_wrap_label_size_request (widget, &requisition);
+  *minimal_width = *natural_width = requisition.width;
+}
+
+static void
+xfd_wrap_label_get_preferred_height (GtkWidget *widget, gint *minimal_height, gint *natural_height)
+{
+  GtkRequisition requisition;
+
+  xfd_wrap_label_size_request (widget, &requisition);
+  *minimal_height = *natural_height = requisition.height;
+}
+
+
 void xfd_wrap_label_set_text(GtkLabel *label, const gchar *text)
 {
 	XfdWrapLabelPrivate *priv = XFD_WRAP_LABEL_GET_PRIVATE(label);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list