[gnome-calendar] Revert "event-widget: hardcode padding-top/bottom at 4px"



commit 16d77a67182f65dbb52bed9119f04b5635e3c3aa
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Fri Feb 6 15:02:36 2015 -0500

    Revert "event-widget: hardcode padding-top/bottom at 4px"
    
    This reverts commit 554ef1d80bc27cb5ab00415defa196fbbd71dbfd.

 src/gcal-event-widget.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index c74b80e..08d0531 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -389,6 +389,7 @@ gcal_event_widget_get_preferred_height (GtkWidget *widget,
                                         gint      *natural)
 {
   GtkBorder margin;
+  GtkBorder padding;
   PangoLayout *layout;
   gint height;
 
@@ -399,9 +400,12 @@ gcal_event_widget_get_preferred_height (GtkWidget *widget,
   gtk_style_context_get_margin (gtk_widget_get_style_context (widget),
                                 gtk_widget_get_state_flags (widget),
                                 &margin);
+  gtk_style_context_get_padding (gtk_widget_get_style_context (widget),
+                                 gtk_widget_get_state_flags (widget),
+                                 &padding);
 
   *minimum = *natural =
-    height + 4 + 4 + margin.top + margin.bottom;
+    height + padding.top + padding.bottom + margin.top + margin.bottom;
 
   g_object_unref (layout);
 }
@@ -586,7 +590,7 @@ gcal_event_widget_draw (GtkWidget *widget,
 
   gtk_render_layout (context, cr,
                      x + padding.left + left_gap,
-                     y + 4,
+                     y + padding.top,
                      layout);
 
   /* render reminder icon */
@@ -612,7 +616,7 @@ gcal_event_widget_draw (GtkWidget *widget,
       gdk_cairo_set_source_pixbuf (cr,
                                    pixbuf,
                                    x + padding.left,
-                                   y + 4 + ((icon_size - (16 * multiplier)) / 2));
+                                   y + padding.top + ((icon_size - (16 * multiplier)) / 2));
       g_object_unref (pixbuf);
       cairo_paint (cr);
     }
@@ -640,7 +644,7 @@ gcal_event_widget_draw (GtkWidget *widget,
       gdk_cairo_set_source_pixbuf (cr,
                                    pixbuf,
                                    width - right_gap,
-                                   y + 4 + ((icon_size - (16 * multiplier)) / 2));
+                                   y + padding.top + ((icon_size - (16 * multiplier)) / 2));
       g_object_unref (pixbuf);
       cairo_paint (cr);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]