The child is now aware of both the combobox and frame (if has-frame is
2008-16-03 Alberto Ruiz <aruiz@gnome.org> * gtl/gtkcombobox.c: (gtk_combo_box_size_allocate) The child is now aware of both the combobox and frame (if has-frame is set) thickness and border. (bug #521442) svn path=/trunk/; revision=19886
This commit is contained in:

committed by
Alberto Ruiz

parent
2b85ba9f64
commit
ca5c68f160
@ -1,3 +1,8 @@
|
|||||||
|
2008-16-03 Alberto Ruiz <aruiz@gnome.org>
|
||||||
|
|
||||||
|
* gtl/gtkcombobox.c: (gtk_combo_box_size_allocate) The child is now aware of
|
||||||
|
both the combobox and frame (if has-frame is set) thickness and border. (bug #521442)
|
||||||
|
|
||||||
2008-03-15 Andre Klapper <a9016009@gmx.de>
|
2008-03-15 Andre Klapper <a9016009@gmx.de>
|
||||||
|
|
||||||
* configure.in: Added "si" to ALL_LINGUAS.
|
* configure.in: Added "si" to ALL_LINGUAS.
|
||||||
|
@ -2284,6 +2284,10 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
/* list mode */
|
/* list mode */
|
||||||
|
|
||||||
|
/* Combobox thickness + border-width */
|
||||||
|
int delta_x = shadow_width + GTK_CONTAINER (widget)->border_width;
|
||||||
|
int delta_y = shadow_height + GTK_CONTAINER (widget)->border_width;
|
||||||
|
|
||||||
/* button */
|
/* button */
|
||||||
GTK_COMBO_BOX_SIZE_ALLOCATE_BUTTON
|
GTK_COMBO_BOX_SIZE_ALLOCATE_BUTTON
|
||||||
|
|
||||||
@ -2292,38 +2296,40 @@ gtk_combo_box_size_allocate (GtkWidget *widget,
|
|||||||
child.x = allocation->x + req.width;
|
child.x = allocation->x + req.width;
|
||||||
else
|
else
|
||||||
child.x = allocation->x;
|
child.x = allocation->x;
|
||||||
|
|
||||||
child.y = allocation->y;
|
child.y = allocation->y;
|
||||||
child.width = allocation->width - req.width;
|
child.width = allocation->width - req.width;
|
||||||
child.height = allocation->height;
|
child.height = allocation->height;
|
||||||
|
|
||||||
if (priv->cell_view_frame)
|
if (priv->cell_view_frame)
|
||||||
{
|
{
|
||||||
child.width = MAX (1, child.width);
|
child.x += delta_x;
|
||||||
child.height = MAX (1, child.height);
|
child.y += delta_y;
|
||||||
|
child.width = MAX (1, child.width - delta_x * 2);
|
||||||
|
child.height = MAX (1, child.height - delta_y * 2);
|
||||||
gtk_widget_size_allocate (priv->cell_view_frame, &child);
|
gtk_widget_size_allocate (priv->cell_view_frame, &child);
|
||||||
|
|
||||||
/* the sample */
|
/* the sample */
|
||||||
if (priv->has_frame)
|
if (priv->has_frame)
|
||||||
{
|
{
|
||||||
child.x +=
|
delta_x = GTK_CONTAINER (priv->cell_view_frame)->border_width +
|
||||||
GTK_CONTAINER (priv->cell_view_frame)->border_width +
|
|
||||||
GTK_WIDGET (priv->cell_view_frame)->style->xthickness;
|
GTK_WIDGET (priv->cell_view_frame)->style->xthickness;
|
||||||
child.y +=
|
delta_y = GTK_CONTAINER (priv->cell_view_frame)->border_width +
|
||||||
GTK_CONTAINER (priv->cell_view_frame)->border_width +
|
|
||||||
GTK_WIDGET (priv->cell_view_frame)->style->ythickness;
|
GTK_WIDGET (priv->cell_view_frame)->style->ythickness;
|
||||||
child.width -= 2 * (
|
|
||||||
GTK_CONTAINER (priv->cell_view_frame)->border_width +
|
|
||||||
GTK_WIDGET (priv->cell_view_frame)->style->xthickness);
|
|
||||||
child.height -= 2 * (
|
|
||||||
GTK_CONTAINER (priv->cell_view_frame)->border_width +
|
|
||||||
GTK_WIDGET (priv->cell_view_frame)->style->ythickness);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
child.x += shadow_width;
|
child.x += delta_x;
|
||||||
child.y += shadow_height;
|
child.y += delta_y;
|
||||||
child.width -= shadow_width * 2;
|
child.width -= delta_x * 2;
|
||||||
child.height -= shadow_height * 2;
|
child.height -= delta_y * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
child.x += delta_x;
|
||||||
|
child.y += delta_y;
|
||||||
|
child.width -= delta_x * 2;
|
||||||
|
child.height -= delta_y * 2;
|
||||||
|
}
|
||||||
|
|
||||||
child.width = MAX (1, child.width);
|
child.width = MAX (1, child.width);
|
||||||
child.height = MAX (1, child.height);
|
child.height = MAX (1, child.height);
|
||||||
|
Reference in New Issue
Block a user