#include <config.h>
#include <glib/gi18n-lib.h>
-#include <gtk/gtkwidget.h>
+#include <gtk/gtk.h>
#include <modest-text-utils.h>
#include <modest-hbox-cell-renderer.h>
{
gint calc_width, calc_height;
gint full_width, full_height;
+ guint xpad, ypad;
+ gfloat xalign, yalign;
GList *node;
ModestHBoxCellRendererPrivate *priv = MODEST_HBOX_CELL_RENDERER_GET_PRIVATE (cell);
}
}
- full_width = (gint) cell->xpad * 2 + calc_width;
- full_height = (gint) cell->ypad * 2 + calc_height;
+ g_object_get (cell,
+ "xpad", &xpad,
+ "ypad", &ypad,
+ "xalign", &xalign,
+ "yalign", &yalign,
+ NULL);
+
+ full_width = (gint) xpad * 2 + calc_width;
+ full_height = (gint) ypad * 2 + calc_height;
if (rectangle && calc_width > 0 && calc_height > 0) {
if (x_offset) {
*x_offset = (((gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) ?
- (1.0 - cell->xalign) : cell->xalign) *
+ (1.0 - xalign) : xalign) *
(rectangle->width - full_width));
*x_offset = MAX (*x_offset, 0);
}
if (y_offset) {
- *y_offset = ((cell->yalign) *
+ *y_offset = ((yalign) *
(rectangle->height - full_height));
*y_offset = MAX (*y_offset, 0);
}
GList *node = NULL;
GtkCellRenderer *child;
gint width, extra;
- GtkRequisition req;
direction = gtk_widget_get_direction (widget);
nvis_children = 0;
nexpand_children = 0;
- /* first, retrieve the requisition of the children cell renderers */
- modest_hbox_cell_renderer_get_size (cell, widget, NULL, NULL, NULL, &(req.width), &(req.height));
-
/* Counts visible and expandable children cell renderers */
for (node = priv->renderers_list; node != NULL; node = g_list_next (node)) {
gboolean visible, expand;
GdkRectangle child_alloc;
if (nexpand_children > 0) {
+ GtkRequisition req;
+
+ /* retrieve the requisition of the children cell renderers */
+ modest_hbox_cell_renderer_get_size (cell, widget, NULL, NULL, NULL, &(req.width), &(req.height));
width = cell_area->width - req.width;
extra = width / nexpand_children;
} else {
GtkRequisition child_req;
gint child_xpad, child_ypad;
GdkRectangle child_expose_area;
-
gtk_cell_renderer_get_size (child, widget, NULL, NULL, NULL, &(child_req.width), &(child_req.height));
g_object_get (child, "xpad", &child_xpad, "ypad", &child_ypad, NULL);