mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
When a resister is read only make whole sheet insensitive.
This commit is contained in:
parent
f3eae750ed
commit
dced40cf6a
@ -408,6 +408,17 @@ draw_cell (GnucashSheet *sheet, SheetBlock *block,
|
||||
color_type = gnc_table_get_color (table, virt_loc, &hatching);
|
||||
gnucash_get_style_classes (sheet, stylectxt, color_type, use_neg_class);
|
||||
|
||||
if (sheet->read_only)
|
||||
{
|
||||
if (!gtk_style_context_has_class (stylectxt, GTK_STYLE_CLASS_BACKGROUND))
|
||||
gtk_style_context_set_state (stylectxt, GTK_STATE_FLAG_INSENSITIVE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gtk_style_context_has_class (stylectxt, GTK_STYLE_CLASS_BACKGROUND))
|
||||
gtk_style_context_set_state (stylectxt, GTK_STATE_FLAG_NORMAL);
|
||||
}
|
||||
|
||||
// Are we in a read-only row? Then make the background color somewhat more grey.
|
||||
if ((virt_loc.phys_row_offset < block->style->nrows)
|
||||
&& (table->model->dividing_row_upper >= 0)
|
||||
@ -627,6 +638,8 @@ gnucash_sheet_draw_internal (GnucashSheet* sheet, cairo_t* cr,
|
||||
if (!sheet_block || !sheet_block->style)
|
||||
return FALSE;
|
||||
|
||||
sheet->read_only = gnc_table_model_read_only (sheet->table->model);
|
||||
|
||||
for ( ; virt_loc.vcell_loc.virt_row < sheet->num_virt_rows;
|
||||
virt_loc.vcell_loc.virt_row++ )
|
||||
{
|
||||
|
@ -44,6 +44,7 @@ struct _GnucashSheet
|
||||
gpointer popup_data;
|
||||
|
||||
Table *table;
|
||||
gboolean read_only;
|
||||
|
||||
GtkWidget *reg;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user