gint cursor_cell;
- GtkOrientation orientation;
+ GtkOrientation item_orientation;
gint columns;
gint item_width;
PROP_0,
PROP_PIXBUF_COLUMN,
PROP_TEXT_COLUMN,
- PROP_MARKUP_COLUMN,
+ PROP_MARKUP_COLUMN,
PROP_SELECTION_MODE,
- PROP_ORIENTATION,
+ PROP_ITEM_ORIENTATION,
PROP_MODEL,
PROP_COLUMNS,
PROP_ITEM_WIDTH,
GTK_PARAM_READWRITE));
/**
- * GtkIconView:orientation:
+ * GtkIconView:item-orientation:
*
- * The orientation property specifies how the cells (i.e. the icon and
+ * The item-orientation property specifies how the cells (i.e. the icon and
* the text) of the item are positioned relative to each other.
*
* Since: 2.6
*/
g_object_class_install_property (gobject_class,
- PROP_ORIENTATION,
- g_param_spec_enum ("orientation",
- P_("Orientation"),
+ PROP_ITEM_ORIENTATION,
+ g_param_spec_enum ("item-orientation",
+ P_("Item Orientation"),
P_("How the text and icon of each item are positioned relative to each other"),
GTK_TYPE_ORIENTATION,
GTK_ORIENTATION_VERTICAL,
icon_view->priv->n_cells = 0;
icon_view->priv->cursor_cell = -1;
- icon_view->priv->orientation = GTK_ORIENTATION_VERTICAL;
+ icon_view->priv->item_orientation = GTK_ORIENTATION_VERTICAL;
icon_view->priv->columns = -1;
icon_view->priv->item_width = -1;
case PROP_MODEL:
gtk_icon_view_set_model (icon_view, g_value_get_object (value));
break;
- case PROP_ORIENTATION:
- gtk_icon_view_set_orientation (icon_view, g_value_get_enum (value));
+ case PROP_ITEM_ORIENTATION:
+ gtk_icon_view_set_item_orientation (icon_view, g_value_get_enum (value));
break;
case PROP_COLUMNS:
gtk_icon_view_set_columns (icon_view, g_value_get_int (value));
case PROP_MODEL:
g_value_set_object (value, icon_view->priv->model);
break;
- case PROP_ORIENTATION:
- g_value_set_enum (value, icon_view->priv->orientation);
+ case PROP_ITEM_ORIENTATION:
+ g_value_set_enum (value, icon_view->priv->item_orientation);
break;
case PROP_COLUMNS:
g_value_set_int (value, icon_view->priv->columns);
{
g_return_if_fail (info->position < item->n_cells);
- if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (icon_view->priv->item_orientation == GTK_ORIENTATION_HORIZONTAL)
{
cell_area->x = item->box[info->position].x - item->before[info->position];
cell_area->y = item->y + icon_view->priv->item_padding;
else
item_width = item->width;
- if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ if (icon_view->priv->item_orientation == GTK_ORIENTATION_VERTICAL)
wrap_width = item_width;
else {
if (item->width == -1 && item_width <= 0)
&item->box[info->position].width,
&item->box[info->position].height);
- if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (icon_view->priv->item_orientation == GTK_ORIENTATION_HORIZONTAL)
{
item->width += item->box[info->position].width
+ (info->position > 0 ? spacing : 0);
item->height = 0;
for (i = 0; i < icon_view->priv->n_cells; i++)
{
- if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (icon_view->priv->item_orientation == GTK_ORIENTATION_HORIZONTAL)
item->height = MAX (item->height, max_height[i]);
else
item->height += max_height[i] + (i > 0 ? spacing : 0);
if (!gtk_cell_renderer_get_visible (info->cell))
continue;
- if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (icon_view->priv->item_orientation == GTK_ORIENTATION_HORIZONTAL)
{
/* We should not subtract icon_view->priv->item_padding from item->height,
* because item->height is recalculated above using
item->box[info->position].x += cell_area.x;
item->box[info->position].y += cell_area.y;
- if (icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (icon_view->priv->item_orientation == GTK_ORIENTATION_HORIZONTAL)
{
item->before[info->position] = item->box[info->position].x - cell_area.x;
item->after[info->position] = cell_area.width - item->box[info->position].width - item->before[info->position];
}
}
- if (rtl && icon_view->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+ if (rtl && icon_view->priv->item_orientation == GTK_ORIENTATION_HORIZONTAL)
{
for (i = 0; i < icon_view->priv->n_cells; i++)
{
gint i, k;
GList *l;
- if (icon_view->priv->orientation != orientation)
+ if (icon_view->priv->item_orientation != orientation)
return cell;
gtk_icon_view_set_cell_data (icon_view, item);
"text", icon_view->priv->text_column,
NULL);
- if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ if (icon_view->priv->item_orientation == GTK_ORIENTATION_VERTICAL)
g_object_set (info->cell,
"alignment", PANGO_ALIGN_CENTER,
"wrap-mode", PANGO_WRAP_WORD_CHAR,
"pixbuf", icon_view->priv->pixbuf_column,
NULL);
- if (icon_view->priv->orientation == GTK_ORIENTATION_VERTICAL)
+ if (icon_view->priv->item_orientation == GTK_ORIENTATION_VERTICAL)
g_object_set (info->cell,
"xalign", 0.5,
"yalign", 1.0,
}
/**
- * gtk_icon_view_set_orientation:
+ * gtk_icon_view_set_item_orientation:
* @icon_view: a #GtkIconView
* @orientation: the relative position of texts and icons
*
- * Sets the ::orientation property which determines whether the labels
+ * Sets the ::item-orientation property which determines whether the labels
* are drawn beside the icons instead of below.
*
* Since: 2.6
**/
void
-gtk_icon_view_set_orientation (GtkIconView *icon_view,
- GtkOrientation orientation)
+gtk_icon_view_set_item_orientation (GtkIconView *icon_view,
+ GtkOrientation orientation)
{
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
- if (icon_view->priv->orientation != orientation)
+ if (icon_view->priv->item_orientation != orientation)
{
- icon_view->priv->orientation = orientation;
+ icon_view->priv->item_orientation = orientation;
gtk_icon_view_stop_editing (icon_view, TRUE);
gtk_icon_view_invalidate_sizes (icon_view);
update_text_cell (icon_view);
update_pixbuf_cell (icon_view);
- g_object_notify (G_OBJECT (icon_view), "orientation");
+ g_object_notify (G_OBJECT (icon_view), "item-orientation");
}
}
/**
- * gtk_icon_view_get_orientation:
+ * gtk_icon_view_get_item_orientation:
* @icon_view: a #GtkIconView
*
- * Returns the value of the ::orientation property which determines
+ * Returns the value of the ::item-orientation property which determines
* whether the labels are drawn beside the icons instead of below.
*
* Return value: the relative position of texts and icons
* Since: 2.6
**/
GtkOrientation
-gtk_icon_view_get_orientation (GtkIconView *icon_view)
+gtk_icon_view_get_item_orientation (GtkIconView *icon_view)
{
g_return_val_if_fail (GTK_IS_ICON_VIEW (icon_view),
GTK_ORIENTATION_VERTICAL);
- return icon_view->priv->orientation;
+ return icon_view->priv->item_orientation;
}
/**