Commit 68ac911f authored by Colomban Wendling's avatar Colomban Wendling

Fix crash in custom cell renderer size methods

parent f15a4c40
......@@ -193,9 +193,17 @@ ovccgtk_cell_renderer_color_get_preferred_width (GtkCellRenderer *cell,
{
OVCCGtkCellRendererColor *self = OVCCGTK_CELL_RENDERER_COLOR (cell);
gint xpad;
gint width;
gtk_cell_renderer_get_padding (cell, &xpad, NULL);
*minimum_width = *natural_width = xpad * 2 + self->priv->size;
width = xpad * 2 + self->priv->size;
if (minimum_width) {
*minimum_width = width;
}
if (natural_width) {
*natural_width = width;
}
}
static void
......@@ -206,9 +214,17 @@ ovccgtk_cell_renderer_color_get_preferred_height (GtkCellRenderer *cell,
{
OVCCGtkCellRendererColor *self = OVCCGTK_CELL_RENDERER_COLOR (cell);
gint ypad;
gint height;
gtk_cell_renderer_get_padding (cell, NULL, &ypad);
*minimum_height = *natural_height = ypad * 2 + self->priv->size;
height = ypad * 2 + self->priv->size;
if (minimum_height) {
*minimum_height = height;
}
if (natural_height) {
*natural_height = height;
}
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment