return GTK_VISIBILITY_FULL;
}
+gboolean
+gtk_cmclist_row_is_above_viewport (GtkCMCList *clist,
+ gint row)
+{
+ cm_return_val_if_fail(GTK_IS_CMCLIST (clist), 0);
+
+ if (row < 0 || row >= clist->rows)
+ return FALSE;
+
+ if (clist->row_height == 0)
+ return FALSE;
+
+ if (row < ROW_FROM_YPIXEL (clist, 0))
+ return TRUE;
+
+ return FALSE;
+}
+
+gboolean
+gtk_cmclist_row_is_below_viewport (GtkCMCList *clist,
+ gint row)
+{
+ cm_return_val_if_fail(GTK_IS_CMCLIST (clist), 0);
+
+ if (row < 0 || row >= clist->rows)
+ return FALSE;
+
+ if (clist->row_height == 0)
+ return FALSE;
+
+ if (row > ROW_FROM_YPIXEL (clist, clist->clist_window_height))
+ return TRUE;
+
+ return FALSE;
+}
+
void
gtk_cmclist_set_foreground (GtkCMCList *clist,
gint row,
GtkVisibility gtk_cmclist_row_is_visible (GtkCMCList *clist,
gint row);
+/* returns whether the row is above or below current viewport */
+gboolean gtk_cmclist_row_is_above_viewport (GtkCMCList *clist,
+ gint row);
+gboolean gtk_cmclist_row_is_below_viewport (GtkCMCList *clist,
+ gint row);
+
/* returns the cell type */
GtkCMCellType gtk_cmclist_get_cell_type (GtkCMCList *clist,
gint row,
GtkCMCList *clist = GTK_CMCLIST(ctree);
gint row;
GtkVisibility row_visibility, prev_row_visibility, next_row_visibility;
+ gfloat row_align;
cm_return_if_fail(ctree != NULL);
cm_return_if_fail(node != NULL);
next_row_visibility = gtk_cmclist_row_is_visible(clist, row + 1);
if (row_visibility == GTK_VISIBILITY_NONE) {
- gtk_cmclist_moveto(clist, row, -1, 0.5, 0);
+ row_align = 0.5;
+ if (gtk_cmclist_row_is_above_viewport(clist, row))
+ row_align = 0.2;
+ else if (gtk_cmclist_row_is_below_viewport(clist, row))
+ row_align = 0.8;
+ gtk_cmclist_moveto(clist, row, -1, row_align, 0);
return;
}
if (row_visibility == GTK_VISIBILITY_FULL &&