[Xfce4-commits] [panel-plugins/xfce4-netload-plugin] 01/01: Replace _size_request with _get_preferred_size

noreply at xfce.org noreply at xfce.org
Sat May 14 23:08:55 CEST 2016


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

landry pushed a commit to branch master
in repository panel-plugins/xfce4-netload-plugin.

commit 658f7b47470a723327a458b704052189537dada5
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Sat May 14 22:52:01 2016 +0200

    Replace _size_request with _get_preferred_size
---
 panel-plugin/monitor-label.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/panel-plugin/monitor-label.c b/panel-plugin/monitor-label.c
index 99c4d23..bcdda15 100644
--- a/panel-plugin/monitor-label.c
+++ b/panel-plugin/monitor-label.c
@@ -69,44 +69,45 @@ cb_label_changed (GObject *object, GParamSpec *pspec, gpointer user_data)
 {
         XnlpMonitorLabel *label = XNLP_MONITOR_LABEL (object);
         GtkWidget *widget = GTK_WIDGET (object);
-        GtkRequisition req;
+        GtkRequisition minimum_size;
+        GtkRequisition natural_size;
 
         gtk_widget_set_size_request (widget, -1, -1);
-        gtk_widget_size_request (widget, &req);
+        gtk_widget_get_preferred_size (widget, &minimum_size, &natural_size);
 
-        if (req.width >= label->width)
+        if (minimum_size.width >= label->width)
         {
-                label->width = req.width;
+                label->width = minimum_size.width;
                 label->count_width = 0;
         }
         else if (label->count_width > 10)
         {
-                label->width = req.width;
+                label->width = minimum_size.width;
                 label->count_width = 0;
         }
         else
         {
-                req.width = label->width;
+                minimum_size.width = label->width;
                 label->count_width++;
         }
 
-        if (req.height >= label->height)
+        if (minimum_size.height >= label->height)
         {
-                label->height = req.height;
+                label->height = minimum_size.height;
                 label->count_height = 0;
         }
         else if (label->count_height > 10)
         {
-                label->height = req.height;
+                label->height = minimum_size.height;
                 label->count_height = 0;
         }
         else
         {
-                req.height = label->height;
+                minimum_size.height = label->height;
                 label->count_height++;
         }
 
-        gtk_widget_set_size_request (widget, req.width, req.height);
+        gtk_widget_set_size_request (widget, minimum_size.width, minimum_size.height);
 }
 
 

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


More information about the Xfce4-commits mailing list