[Xfce4-commits] [panel-plugins/xfce4-weather-plugin] 20/25: Fix positioning of scrollbox in horizontal and vertical panel modes

noreply at xfce.org noreply at xfce.org
Mon Sep 17 00:14:17 CEST 2018


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

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-weather-plugin.

commit 893f4f17ce64f60ba12fc0e0454febfd97e01db5
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sat Sep 15 10:17:41 2018 -0400

    Fix positioning of scrollbox in horizontal and vertical panel modes
---
 panel-plugin/weather-scrollbox.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/panel-plugin/weather-scrollbox.c b/panel-plugin/weather-scrollbox.c
index 9b018d9..25e79dd 100644
--- a/panel-plugin/weather-scrollbox.c
+++ b/panel-plugin/weather-scrollbox.c
@@ -208,7 +208,7 @@ gtk_scrollbox_draw_event(GtkWidget *widget,
 {
     GtkScrollbox *self = GTK_SCROLLBOX(widget);
     PangoLayout *layout;
-    gint height;
+    gint height, width;
     PangoRectangle logical_rect;
     gboolean result = FALSE;
     PangoMatrix matrix = PANGO_MATRIX_INIT;
@@ -229,21 +229,21 @@ gtk_scrollbox_draw_event(GtkWidget *widget,
         gtk_widget_get_allocation (GTK_WIDGET (widget), &allocation);
 
         if (self->orientation == GTK_ORIENTATION_HORIZONTAL) {
-            height = allocation.y
-                + (allocation.height
-                   - PANGO_PIXELS(logical_rect.height)) / 2
+            width = 0;
+            height = (allocation.height - PANGO_PIXELS(logical_rect.height)) / 2
                 + (self->fade == FADE_IN || self->fade == FADE_OUT
                    ? self->offset : 0);
         } else {
-            height = allocation.y
-                + (allocation.height
-                   - PANGO_PIXELS(logical_rect.width)) / 2;
+            height = 0;
+            width = (allocation.width + PANGO_PIXELS(logical_rect.height)) / 2
+                + (self->fade == FADE_IN || self->fade == FADE_OUT
+                   ? self->offset : 0);
         }
 
         gtk_render_layout (gtk_widget_get_style_context (GTK_WIDGET (widget)),
                            cr,
-                           6, 
-                           height - 2, 
+                           width,
+                           height,
                            layout);
     }
     return result;

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


More information about the Xfce4-commits mailing list