mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-11 21:20:09 +00:00
Rename GtkIconView::orientation property
Rename the ::orientation property of GtkIconView to item-orientation, which is both clearer and avoids the conflict with the orientation property of GtkOrientable implementations.
This commit is contained in:
parent
1956cf8d28
commit
e4af3782d3
@ -120,8 +120,8 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
|
||||
gtk_icon_view_set_selection_mode (GTK_ICON_VIEW (icon_view),
|
||||
GTK_SELECTION_SINGLE);
|
||||
gtk_icon_view_set_orientation (GTK_ICON_VIEW (icon_view),
|
||||
GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_icon_view_set_item_orientation (GTK_ICON_VIEW (icon_view),
|
||||
GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_icon_view_set_columns (GTK_ICON_VIEW (icon_view), 2);
|
||||
gtk_icon_view_set_reorderable (GTK_ICON_VIEW (icon_view), TRUE);
|
||||
|
||||
|
@ -1613,8 +1613,8 @@ gtk_icon_view_get_cursor
|
||||
gtk_icon_view_selected_foreach
|
||||
gtk_icon_view_set_selection_mode
|
||||
gtk_icon_view_get_selection_mode
|
||||
gtk_icon_view_set_orientation
|
||||
gtk_icon_view_get_orientation
|
||||
gtk_icon_view_set_item_orientation
|
||||
gtk_icon_view_get_item_orientation
|
||||
gtk_icon_view_set_columns
|
||||
gtk_icon_view_get_columns
|
||||
gtk_icon_view_set_item_width
|
||||
|
@ -1587,7 +1587,7 @@ gtk_icon_view_get_item_width
|
||||
gtk_icon_view_get_margin
|
||||
gtk_icon_view_get_markup_column
|
||||
gtk_icon_view_get_model
|
||||
gtk_icon_view_get_orientation
|
||||
gtk_icon_view_get_item_orientation
|
||||
gtk_icon_view_get_path_at_pos
|
||||
gtk_icon_view_get_item_at_pos
|
||||
gtk_icon_view_convert_widget_to_bin_window_coords
|
||||
@ -1615,7 +1615,7 @@ gtk_icon_view_set_item_width
|
||||
gtk_icon_view_set_margin
|
||||
gtk_icon_view_set_markup_column
|
||||
gtk_icon_view_set_model
|
||||
gtk_icon_view_set_orientation
|
||||
gtk_icon_view_set_item_orientation
|
||||
gtk_icon_view_set_pixbuf_column
|
||||
gtk_icon_view_set_row_spacing
|
||||
gtk_icon_view_set_selection_mode
|
||||
|
@ -150,7 +150,7 @@ struct _GtkIconViewPrivate
|
||||
|
||||
gint cursor_cell;
|
||||
|
||||
GtkOrientation orientation;
|
||||
GtkOrientation item_orientation;
|
||||
|
||||
gint columns;
|
||||
gint item_width;
|
||||
@ -218,9 +218,9 @@ enum
|
||||
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,
|
||||
@ -726,17 +726,17 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
|
||||
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,
|
||||
@ -1126,7 +1126,7 @@ gtk_icon_view_init (GtkIconView *icon_view)
|
||||
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;
|
||||
@ -1216,8 +1216,8 @@ gtk_icon_view_set_property (GObject *object,
|
||||
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));
|
||||
@ -1282,8 +1282,8 @@ gtk_icon_view_get_property (GObject *object,
|
||||
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);
|
||||
@ -2897,7 +2897,7 @@ gtk_icon_view_get_cell_area (GtkIconView *icon_view,
|
||||
{
|
||||
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;
|
||||
@ -2958,7 +2958,7 @@ adjust_wrap_width (GtkIconView *icon_view,
|
||||
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)
|
||||
@ -3015,7 +3015,7 @@ gtk_icon_view_calculate_item_size (GtkIconView *icon_view,
|
||||
&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);
|
||||
@ -3052,7 +3052,7 @@ gtk_icon_view_calculate_item_size2 (GtkIconView *icon_view,
|
||||
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);
|
||||
@ -3072,7 +3072,7 @@ gtk_icon_view_calculate_item_size2 (GtkIconView *icon_view,
|
||||
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
|
||||
@ -3097,7 +3097,7 @@ gtk_icon_view_calculate_item_size2 (GtkIconView *icon_view,
|
||||
|
||||
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];
|
||||
@ -3116,7 +3116,7 @@ gtk_icon_view_calculate_item_size2 (GtkIconView *icon_view,
|
||||
}
|
||||
}
|
||||
|
||||
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++)
|
||||
{
|
||||
@ -3895,7 +3895,7 @@ find_cell (GtkIconView *icon_view,
|
||||
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);
|
||||
@ -5474,7 +5474,7 @@ update_text_cell (GtkIconView *icon_view)
|
||||
"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,
|
||||
@ -5542,7 +5542,7 @@ update_pixbuf_cell (GtkIconView *icon_view)
|
||||
"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,
|
||||
@ -6011,24 +6011,24 @@ gtk_icon_view_item_activated (GtkIconView *icon_view,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
@ -6037,15 +6037,15 @@ gtk_icon_view_set_orientation (GtkIconView *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
|
||||
@ -6053,12 +6053,12 @@ gtk_icon_view_set_orientation (GtkIconView *icon_view,
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -125,9 +125,9 @@ void gtk_icon_view_set_pixbuf_column (GtkIconView *icon_view,
|
||||
gint column);
|
||||
gint gtk_icon_view_get_pixbuf_column (GtkIconView *icon_view);
|
||||
|
||||
void gtk_icon_view_set_orientation (GtkIconView *icon_view,
|
||||
GtkOrientation orientation);
|
||||
GtkOrientation gtk_icon_view_get_orientation (GtkIconView *icon_view);
|
||||
void gtk_icon_view_set_item_orientation (GtkIconView *icon_view,
|
||||
GtkOrientation orientation);
|
||||
GtkOrientation gtk_icon_view_get_item_orientation (GtkIconView *icon_view);
|
||||
void gtk_icon_view_set_columns (GtkIconView *icon_view,
|
||||
gint columns);
|
||||
gint gtk_icon_view_get_columns (GtkIconView *icon_view);
|
||||
|
Loading…
Reference in New Issue
Block a user