mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Draw imbalance hatching in current cell.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3273 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
d35d53d97b
commit
a3955da98c
@ -72,6 +72,7 @@ struct _TextDrawInfo
|
|||||||
|
|
||||||
GdkRectangle bg_rect;
|
GdkRectangle bg_rect;
|
||||||
GdkRectangle text_rect;
|
GdkRectangle text_rect;
|
||||||
|
GdkRectangle hatch_rect;
|
||||||
|
|
||||||
GdkColor *fg_color;
|
GdkColor *fg_color;
|
||||||
GdkColor *bg_color;
|
GdkColor *bg_color;
|
||||||
@ -79,6 +80,8 @@ struct _TextDrawInfo
|
|||||||
GdkColor *fg_color2;
|
GdkColor *fg_color2;
|
||||||
GdkColor *bg_color2;
|
GdkColor *bg_color2;
|
||||||
|
|
||||||
|
gboolean hatching;
|
||||||
|
|
||||||
int text_x1;
|
int text_x1;
|
||||||
int text_x2;
|
int text_x2;
|
||||||
int text_x3;
|
int text_x3;
|
||||||
@ -140,6 +143,7 @@ item_edit_draw_info(ItemEdit *item_edit, int x, int y, TextDrawInfo *info)
|
|||||||
int start_pos, end_pos;
|
int start_pos, end_pos;
|
||||||
int toggle_space, cursor_pos;
|
int toggle_space, cursor_pos;
|
||||||
int xoffset;
|
int xoffset;
|
||||||
|
gboolean hatching;
|
||||||
guint32 argb;
|
guint32 argb;
|
||||||
|
|
||||||
style = item_edit->style;
|
style = item_edit->style;
|
||||||
@ -150,9 +154,10 @@ item_edit_draw_info(ItemEdit *item_edit, int x, int y, TextDrawInfo *info)
|
|||||||
block = gnucash_sheet_get_block (item_edit->sheet,
|
block = gnucash_sheet_get_block (item_edit->sheet,
|
||||||
item_edit->virt_loc.vcell_loc);
|
item_edit->virt_loc.vcell_loc);
|
||||||
|
|
||||||
argb = gnc_table_get_bg_color (table, item_edit->virt_loc, NULL);
|
argb = gnc_table_get_bg_color (table, item_edit->virt_loc, &hatching);
|
||||||
|
|
||||||
info->bg_color = gnucash_color_argb_to_gdk (argb);
|
info->bg_color = gnucash_color_argb_to_gdk (argb);
|
||||||
|
info->hatching = hatching;
|
||||||
info->fg_color = &gn_black;
|
info->fg_color = &gn_black;
|
||||||
|
|
||||||
info->bg_color2 = &gn_dark_gray;
|
info->bg_color2 = &gn_dark_gray;
|
||||||
@ -221,6 +226,14 @@ item_edit_draw_info(ItemEdit *item_edit, int x, int y, TextDrawInfo *info)
|
|||||||
info->cursor_x = info->text_x1 + pre_cursor_width;
|
info->cursor_x = info->text_x1 + pre_cursor_width;
|
||||||
info->cursor_y1 = info->text_y - info->font->ascent;
|
info->cursor_y1 = info->text_y - info->font->ascent;
|
||||||
info->cursor_y2 = info->text_y + info->font->descent;
|
info->cursor_y2 = info->text_y + info->font->descent;
|
||||||
|
|
||||||
|
if (info->hatching)
|
||||||
|
{
|
||||||
|
info->hatch_rect.x = dx;
|
||||||
|
info->hatch_rect.y = dy;
|
||||||
|
info->hatch_rect.width = wd;
|
||||||
|
info->hatch_rect.height = hd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -244,6 +257,13 @@ item_edit_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
|
|||||||
info.bg_rect.x, info.bg_rect.y,
|
info.bg_rect.x, info.bg_rect.y,
|
||||||
info.bg_rect.width, info.bg_rect.height);
|
info.bg_rect.width, info.bg_rect.height);
|
||||||
|
|
||||||
|
if (info.hatching)
|
||||||
|
gnucash_draw_hatching (drawable, item_edit->gc,
|
||||||
|
info.hatch_rect.x,
|
||||||
|
info.hatch_rect.y,
|
||||||
|
info.hatch_rect.width,
|
||||||
|
info.hatch_rect.height);
|
||||||
|
|
||||||
/* Draw the foreground text and cursor */
|
/* Draw the foreground text and cursor */
|
||||||
gdk_gc_set_clip_rectangle (item_edit->gc, &info.text_rect);
|
gdk_gc_set_clip_rectangle (item_edit->gc, &info.text_rect);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user