-
- GTK_WIDGET (sheet_entry)->style = style;
- gtk_widget_size_request (sheet->entry_widget, NULL);
- GTK_WIDGET (sheet_entry)->style = previous_style;
-
- if (style != previous_style)
- {
- if (!GTK_IS_ITEM_ENTRY (sheet->entry_widget))
- {
- style->bg[GTK_STATE_NORMAL] = previous_style->bg[GTK_STATE_NORMAL];
- style->fg[GTK_STATE_NORMAL] = previous_style->fg[GTK_STATE_NORMAL];
- style->bg[GTK_STATE_ACTIVE] = previous_style->bg[GTK_STATE_ACTIVE];
- style->fg[GTK_STATE_ACTIVE] = previous_style->fg[GTK_STATE_ACTIVE];
- }
- gtk_widget_set_style (GTK_WIDGET (sheet_entry), style);
- g_object_unref (style);
- }
- }
-
- if (GTK_IS_ITEM_ENTRY (sheet_entry))
- max_size = GTK_ITEM_ENTRY (sheet_entry)->text_max_size;
- else
- max_size = 0;
-
- text_size = 0;
- text = gtk_entry_get_text (GTK_ENTRY (sheet_entry));
- if (text && strlen (text) > 0)
- text_size = STRING_WIDTH (GTK_WIDGET (sheet), attributes.font_desc, text);
-
- column_width = g_sheet_column_get_width (sheet->column_geometry, sheet->active_cell.col);
-
- size = MIN (text_size, max_size);
- size = MAX (size, column_width - 2 * COLUMN_TITLES_HEIGHT);
-
- row = sheet->active_cell.row;
- col = sheet->active_cell.col;
-
- shentry_allocation.x = column_left_xpixel (sheet, sheet->active_cell.col);
- shentry_allocation.y = g_sheet_row_start_pixel (sheet->row_geometry, sheet->active_cell.row);
- if ( sheet->column_titles_visible)
- shentry_allocation.y += sheet->column_title_area.height;
-
- shentry_allocation.y -= sheet->vadjustment->value;
-
- if ( sheet->row_titles_visible)
- shentry_allocation.x += sheet->row_title_area.width;
-
- shentry_allocation.x -= sheet->hadjustment->value;
-
- shentry_allocation.width = column_width;
- shentry_allocation.height = g_sheet_row_get_height (sheet->row_geometry, sheet->active_cell.row);
-
- if (GTK_IS_ITEM_ENTRY (sheet->entry_widget))
- {
- shentry_allocation.height -= 2 * COLUMN_TITLES_HEIGHT;
- shentry_allocation.y += COLUMN_TITLES_HEIGHT;
- shentry_allocation.width = size;
-
- switch (GTK_ITEM_ENTRY (sheet_entry)->justification)
- {
- case GTK_JUSTIFY_CENTER:
- shentry_allocation.x += column_width / 2 - size / 2;
- break;
- case GTK_JUSTIFY_RIGHT:
- shentry_allocation.x += column_width - size - COLUMN_TITLES_HEIGHT;
- break;
- case GTK_JUSTIFY_LEFT:
- case GTK_JUSTIFY_FILL:
- shentry_allocation.x += COLUMN_TITLES_HEIGHT;
- break;
- }