event-widget: hardcode padding-top/bottom at 4px

This is necessary in order to properly style slanted edges on widgets
who need it on both start and end.
This commit is contained in:
Erick Pérez Castellanos
2015-01-22 13:31:08 -05:00
parent 50702a9f53
commit 554ef1d80b
+4 -8
View File
@@ -389,7 +389,6 @@ gcal_event_widget_get_preferred_height (GtkWidget *widget,
gint *natural) gint *natural)
{ {
GtkBorder margin; GtkBorder margin;
GtkBorder padding;
PangoLayout *layout; PangoLayout *layout;
gint height; gint height;
@@ -400,12 +399,9 @@ gcal_event_widget_get_preferred_height (GtkWidget *widget,
gtk_style_context_get_margin (gtk_widget_get_style_context (widget), gtk_style_context_get_margin (gtk_widget_get_style_context (widget),
gtk_widget_get_state_flags (widget), gtk_widget_get_state_flags (widget),
&margin); &margin);
gtk_style_context_get_padding (gtk_widget_get_style_context (widget),
gtk_widget_get_state_flags (widget),
&padding);
*minimum = *natural = *minimum = *natural =
height + padding.top + padding.bottom + margin.top + margin.bottom; height + 4 + 4 + margin.top + margin.bottom;
g_object_unref (layout); g_object_unref (layout);
} }
@@ -590,7 +586,7 @@ gcal_event_widget_draw (GtkWidget *widget,
gtk_render_layout (context, cr, gtk_render_layout (context, cr,
x + padding.left + left_gap, x + padding.left + left_gap,
y + padding.top, y + 4,
layout); layout);
/* render reminder icon */ /* render reminder icon */
@@ -616,7 +612,7 @@ gcal_event_widget_draw (GtkWidget *widget,
gdk_cairo_set_source_pixbuf (cr, gdk_cairo_set_source_pixbuf (cr,
pixbuf, pixbuf,
x + padding.left, x + padding.left,
y + padding.top + ((icon_size - (16 * multiplier)) / 2)); y + 4 + ((icon_size - (16 * multiplier)) / 2));
g_object_unref (pixbuf); g_object_unref (pixbuf);
cairo_paint (cr); cairo_paint (cr);
} }
@@ -644,7 +640,7 @@ gcal_event_widget_draw (GtkWidget *widget,
gdk_cairo_set_source_pixbuf (cr, gdk_cairo_set_source_pixbuf (cr,
pixbuf, pixbuf,
width - right_gap, width - right_gap,
y + padding.top + ((icon_size - (16 * multiplier)) / 2)); y + 4 + ((icon_size - (16 * multiplier)) / 2));
g_object_unref (pixbuf); g_object_unref (pixbuf);
cairo_paint (cr); cairo_paint (cr);
} }