tree_column->use_resized_width = FALSE;
tree_column->title = g_strdup ("");
tree_column->quick_edit = TRUE;
- tree_column->need_button = FALSE;
}
static void
g_return_if_fail (PSPP_IS_SHEET_VIEW (tree_view));
g_return_if_fail (tree_column->button == NULL);
- gtk_widget_push_composite_child ();
tree_column->button = gtk_button_new ();
gtk_widget_add_events (tree_column->button, GDK_POINTER_MOTION_MASK);
- gtk_widget_pop_composite_child ();
/* make sure we own a reference to it as well. */
if (tree_view->priv->header_window)
model = NULL;
/* Create a button if necessary */
- if (tree_column->need_button &&
- tree_column->visible &&
+ if (tree_column->visible &&
tree_column->button == NULL &&
tree_column->tree_view &&
gtk_widget_get_realized (tree_column->tree_view))
{
if (tree_column->visible)
{
- gtk_widget_show_now (tree_column->button);
+ gtk_widget_show (tree_column->button);
if (tree_column->window)
{
if (tree_column->resizable)
g_return_if_fail (PSPP_IS_SHEET_VIEW (tree_view));
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (tree_view)));
g_return_if_fail (tree_view->priv->header_window != NULL);
- if (!column->need_button || !column->button)
+ if (!column->button)
return;
g_return_if_fail (column->button != NULL);
g_assert (column->tree_view == NULL);
column->tree_view = GTK_WIDGET (tree_view);
- if (column->need_button)
- pspp_sheet_view_column_create_button (column);
+ pspp_sheet_view_column_create_button (column);
column->property_changed_signal =
g_signal_connect_swapped (tree_view,
{
return tree_column->reorderable || tree_column->clickable;
}
-
-void
-pspp_sheet_view_column_set_need_button (PsppSheetViewColumn *tree_column,
- gboolean need_button)
-{
- if (tree_column->need_button != need_button)
- {
- tree_column->need_button = need_button;
- pspp_sheet_view_column_update_button (tree_column);
- _pspp_sheet_view_column_realize_button (tree_column);
- }
-}
guint PSEAL (selectable) : 1;
guint PSEAL (row_head) : 1;
guint PSEAL (tabbable) : 1;
- guint PSEAL (need_button) : 1;
};
struct _PsppSheetViewColumnClass
void pspp_sheet_view_column_size_allocate (PsppSheetViewColumn *tree_column,
GtkAllocation *allocation);
gboolean pspp_sheet_view_column_can_focus (PsppSheetViewColumn *tree_column);
-void pspp_sheet_view_column_set_need_button (PsppSheetViewColumn *tree_column,
- gboolean need_button);
G_END_DECLS
pspp_sheet_view_column_size_allocate (column, &col_allocation);
- if (span_intersects (col_allocation.x, col_allocation.width,
- gtk_adjustment_get_value (tree_view->priv->hadjustment),
- allocation.width)
- && gtk_widget_get_realized (widget))
- pspp_sheet_view_column_set_need_button (column, TRUE);
-
if (column->window)
gdk_window_move_resize (column->window,
col_allocation.x + (rtl ? 0 : col_allocation.width) - TREE_VIEW_DRAG_WIDTH/2,
g_return_if_fail (focus_column != NULL);
tree_view->priv->focus_column = focus_column;
- if (!focus_column->button)
- {
- pspp_sheet_view_column_set_need_button (focus_column, TRUE);
- // g_return_if_fail (focus_column->button != NULL);
- if (focus_column->button == NULL)
- return;
- }
if (gtk_container_get_focus_child (GTK_CONTAINER (tree_view)) != focus_column->button)
gtk_widget_grab_focus (focus_column->button);
if (column->visible &&
pspp_sheet_view_column_can_focus (column))
{
- pspp_sheet_view_column_set_need_button (column, TRUE);
if (column->button)
{
pspp_sheet_view_focus_column (tree_view, column,
if (!tree_view->priv->in_top_row_to_dy)
pspp_sheet_view_dy_to_top_row (tree_view);
}
-
- for (list = tree_view->priv->columns; list; list = list->next)
- {
- PsppSheetViewColumn *column = list->data;
- GtkAllocation *col_allocation = &column->allocation;
- GtkAllocation widget_allocation;
- gtk_widget_get_allocation (GTK_WIDGET (tree_view), &widget_allocation);
-
- if (span_intersects (col_allocation->x, col_allocation->width,
- gtk_adjustment_get_value (tree_view->priv->hadjustment),
- widget_allocation.width))
- {
- pspp_sheet_view_column_set_need_button (column, TRUE);
- if (!column->button)
- pspp_sheet_view_column_update_button (column);
- }
- }
}
}