gnucash master: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Fri Aug 4 03:01:00 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/88e365d2 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/86613ace (commit)
	 via  https://github.com/Gnucash/gnucash/commit/386309d8 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/64d4ec3f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/efe2aef6 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8ebdc7b1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e0e1ccc1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/66aa691a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/64b9872e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/54677d37 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a2fa9eef (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4bef3a59 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/64639a57 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9318ed9f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ea24c7b8 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/22d1d488 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8468783a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/60ff8804 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9b582c38 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/25cf1d91 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0456b8ae (commit)
	from  https://github.com/Gnucash/gnucash/commit/16b98cc5 (commit)



commit 88e365d2d11749ead281f4c45866725590f084b2
Merge: 16b98cc 86613ac
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Aug 4 08:26:36 2017 +0200

    Merge branch 'gtk3-update4' of https://github.com/Bob-IT/gnucash


commit 86613ace5fbcbda89ab3ae86beb964f82d916f48
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 18:02:59 2017 +0100

    Missed changing the GncItemEdit alignment for the first row

diff --git a/src/register/register-gnome/gnucash-item-edit.c b/src/register/register-gnome/gnucash-item-edit.c
index f002518..ac08ed3 100644
--- a/src/register/register-gnome/gnucash-item-edit.c
+++ b/src/register/register-gnome/gnucash-item-edit.c
@@ -90,14 +90,6 @@ gnc_item_edit_get_pixel_coords (GncItemEdit *item_edit,
         *x = *x + 1;
         *w = *w - 1;
     }
-
-    // alter cell size of first row
-    if (yd == 0)
-    {
-        *y = *y + 1;
-        *h = *h - 1;
-    }
-
     *x += xd;
     *y += yd;
 }

commit 386309d8c821ab78bab61b6afcf331a4fa7b1379
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 16:45:11 2017 +0100

    Change how the widgets are named for CSS
    
    Changed the names of the register parts and added to the class_init
    function gtk_widget_class_set_css_name for use with Gtk+ 3.20 and also
    a procedure to use gtk_style_context_add_class for earlier versions of
    Gtk+

diff --git a/src/register/register-gnome/gnucash-header.c b/src/register/register-gnome/gnucash-header.c
index 6635797..8e37749 100644
--- a/src/register/register-gnome/gnucash-header.c
+++ b/src/register/register-gnome/gnucash-header.c
@@ -601,8 +601,8 @@ gnc_header_init (GncHeader *header)
     header->width = 400;
     header->style = NULL;
 
-    // Set the style context for this widget so it can be easily manipulated with css
-    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET(header)), "GncRegisterHeader");
+    // This sets a style class for when Gtk+ version is less than 3.20
+    gnc_widget_set_css_name (GTK_WIDGET(header), "header");
 
     gtk_widget_add_events(GTK_WIDGET(header), (GDK_EXPOSURE_MASK
                           | GDK_BUTTON_PRESS_MASK
@@ -622,6 +622,10 @@ gnc_header_class_init (GncHeaderClass *header_class)
     GObjectClass  *object_class = G_OBJECT_CLASS (header_class);
     GtkWidgetClass *item_class = GTK_WIDGET_CLASS (header_class);
 
+#if GTK_CHECK_VERSION(3,20,0)
+    gtk_widget_class_set_css_name (GTK_WIDGET_CLASS(header_class), "header");
+#endif
+
     parent_class = g_type_class_peek_parent (header_class);
 
     object_class->finalize = gnc_header_finalize;
diff --git a/src/register/register-gnome/gnucash-item-edit.c b/src/register/register-gnome/gnucash-item-edit.c
index fdbeabe..f002518 100644
--- a/src/register/register-gnome/gnucash-item-edit.c
+++ b/src/register/register-gnome/gnucash-item-edit.c
@@ -454,6 +454,10 @@ gnc_item_edit_class_init (GncItemEditClass *gnc_item_edit_class)
     GObjectClass  *object_class;
     GtkWidgetClass *widget_class;
 
+#if GTK_CHECK_VERSION(3,20,0)
+    gtk_widget_class_set_css_name (GTK_WIDGET_CLASS(gnc_item_edit_class), "cursor");
+#endif
+
     gnc_item_edit_parent_class = g_type_class_peek_parent (gnc_item_edit_class);
 
     object_class = G_OBJECT_CLASS (gnc_item_edit_class);
@@ -522,8 +526,8 @@ gnc_item_edit_new (GnucashSheet *sheet)
                            NULL);
     gtk_layout_put (GTK_LAYOUT(sheet), GTK_WIDGET(item_edit), 0, 0);
 
-    // Set the style context for this widget so it can be easily manipulated with css
-    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET(item_edit)), "GncRegisterItemEdit");
+    // This sets a style class for when Gtk+ version is less than 3.20
+    gnc_widget_set_css_name (GTK_WIDGET(item_edit), "cursor");
 
     /* Create the text entry */
     item_edit->editor = gtk_entry_new();
diff --git a/src/register/register-gnome/gnucash-register.c b/src/register/register-gnome/gnucash-register.c
index a9842a5..932f3d1 100644
--- a/src/register/register-gnome/gnucash-register.c
+++ b/src/register/register-gnome/gnucash-register.c
@@ -300,6 +300,10 @@ gnucash_register_class_init (GnucashRegisterClass *klass)
 
     gobject_class = G_OBJECT_CLASS (klass);
 
+#if GTK_CHECK_VERSION(3,20,0)
+    gtk_widget_class_set_css_name (GTK_WIDGET_CLASS(klass), "register");
+#endif
+
     register_parent_class = g_type_class_peek_parent (klass);
 
     register_signals[ACTIVATE_CURSOR] =
@@ -346,8 +350,8 @@ gnucash_register_init (GnucashRegister *g_reg)
     gtk_widget_set_can_focus (GTK_WIDGET(table), FALSE);
     gtk_widget_set_can_default (GTK_WIDGET(table), FALSE);
 
-    // Set the style context for this widget so it can be easily manipulated with css
-    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET(g_reg)), "GncRegister");
+    // This sets a style class for when Gtk+ version is less than 3.20
+    gnc_widget_set_css_name (GTK_WIDGET(g_reg), "register");
 
     gtk_grid_set_row_homogeneous (GTK_GRID(table), FALSE);
     gtk_grid_set_column_homogeneous (GTK_GRID(table), FALSE);
diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index 75c7cfe..6f20514 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -722,3 +722,12 @@ gnucash_sheet_draw_cursor (GnucashCursor *cursor, cairo_t *cr)
     cairo_set_line_width (cr, 1.0);
     cairo_stroke (cr);
 }
+
+void
+gnc_widget_set_css_name (GtkWidget *widget, const char *name)
+{
+#if !GTK_CHECK_VERSION(3,20,0)
+    GtkStyleContext *context = gtk_widget_get_style_context (widget);
+    gtk_style_context_add_class (context, name);
+#endif
+}
diff --git a/src/register/register-gnome/gnucash-sheet.c b/src/register/register-gnome/gnucash-sheet.c
index 83b2771..d0cdb46 100644
--- a/src/register/register-gnome/gnucash-sheet.c
+++ b/src/register/register-gnome/gnucash-sheet.c
@@ -2477,6 +2477,10 @@ gnucash_sheet_class_init (GnucashSheetClass *klass)
     gobject_class = G_OBJECT_CLASS (klass);
     widget_class = GTK_WIDGET_CLASS (klass);
 
+#if GTK_CHECK_VERSION(3,20,0)
+    gtk_widget_class_set_css_name (GTK_WIDGET_CLASS(klass), "sheet");
+#endif
+
     sheet_parent_class = g_type_class_peek_parent (klass);
 
     /* Method override */
@@ -2503,8 +2507,8 @@ gnucash_sheet_init (GnucashSheet *sheet)
     gtk_widget_set_can_focus (GTK_WIDGET(sheet), TRUE);
     gtk_widget_set_can_default (GTK_WIDGET(sheet), TRUE);
 
-    // Set the style context for this widget so it can be easily manipulated with css
-    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET(sheet)), "GncRegisterSheet");
+    // This sets a style class for when Gtk+ version is less than 3.20
+    gnc_widget_set_css_name (GTK_WIDGET(sheet), "sheet");
 
     sheet->num_visible_blocks = 1;
     sheet->num_visible_phys_rows = 1;
diff --git a/src/register/register-gnome/gnucash-sheetP.h b/src/register/register-gnome/gnucash-sheetP.h
index 38fed6a..408b0da 100644
--- a/src/register/register-gnome/gnucash-sheetP.h
+++ b/src/register/register-gnome/gnucash-sheetP.h
@@ -138,6 +138,7 @@ gboolean gnucash_sheet_draw_internal (GnucashSheet *sheet, cairo_t *cr,
                                       GtkAllocation *alloc);
 void gnucash_sheet_draw_cursor (GnucashCursor *cursor, cairo_t *cr);
 
+void gnc_widget_set_css_name (GtkWidget *widget, const char *name);
 
 /** @} */
 #endif

commit 64d4ec3fd1bd6b37728f93f650efa266e36ee9bd
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 16:43:50 2017 +0100

    Replace the thicker lower line for the cursor, removed by mistake

diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index aa2b198..75c7cfe 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -707,6 +707,11 @@ gnucash_sheet_draw_cursor (GnucashCursor *cursor, cairo_t *cr)
     cairo_set_line_width (cr, 1.0);
     cairo_stroke (cr);
 
+    // make the bottom line thicker
+    cairo_move_to (cr, cursor->x - x + 0.5, cursor->y - y + cursor->h - 1.5);
+    cairo_rel_line_to (cr, cursor->w, 0);
+    cairo_stroke (cr);
+
     /* draw rectangle around the active cell */
     cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
     if (cc->x != 0)

commit efe2aef6f48f857b062665c8c2ea01e5778bfdb9
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 16:42:29 2017 +0100

    When drawing the cursor, remove the requirement to test for first row

diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index aefe319..aa2b198 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -697,23 +697,18 @@ gnucash_sheet_draw_cursor (GnucashCursor *cursor, cairo_t *cr)
 
     fg_color = &gn_black;
 
+   /* draw the rectangle around the entire active virtual row - transaction rows only - double line  */
     cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
-    /* draw the rectangle around the entire active virtual row - transaction rows only - double line  */
-
-    if (cursor->y == 0)
-        cairo_rectangle (cr, cursor->x - x + 0.5, cursor->y - y + 0.5, cursor->w - 1.0, cursor->h - 3.0);
+    if (cursor->x == 0)
+        cairo_rectangle (cr, cursor->x - x + 0.5, cursor->y - y - 0.5, cursor->w - 1.0, cursor->h - 2.0);
     else
-    {
-        if (cursor->x == 0)
-            cairo_rectangle (cr, cursor->x - x + 0.5, cursor->y - y - 0.5, cursor->w - 1.0, cursor->h - 2.0);
-        else
-            cairo_rectangle (cr, cursor->x - x - 0.5, cursor->y - y - 0.5, cursor->w, cursor->h - 2.0);
-    }
+        cairo_rectangle (cr, cursor->x - x - 0.5, cursor->y - y - 0.5, cursor->w, cursor->h - 2.0);
+
     cairo_set_line_width (cr, 1.0);
     cairo_stroke (cr);
 
-    cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
     /* draw rectangle around the active cell */
+    cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
     if (cc->x != 0)
         cairo_rectangle (cr, cc->x - x - 0.5, cursor->y + cc->y - y - 0.5, cc->w, cc->h);
     else

commit 8ebdc7b1d299c8f6bd8ea00d9195b1004e5fc619
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 16:39:07 2017 +0100

    Change the divider line back to 3px
    
    Make divider line 3px but make it straddle two rows centrally.

diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index db3c8d5..aefe319 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -367,8 +367,8 @@ draw_divider_line (cairo_t *cr, VirtualLocation virt_loc,
 
     cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
 
-    cairo_set_line_width (cr, 2.0);
-    cairo_move_to (cr, x, y + 0.5 + offset);
+    cairo_set_line_width (cr, 3.0);
+    cairo_move_to (cr, x, y - 0.5 + offset);
     cairo_rel_line_to (cr, width, 0);
     cairo_stroke (cr);
 }

commit e0e1ccc1c447258eb34a297fde2dab784b93903c
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 16:38:11 2017 +0100

    Revert change to text vertical offset

diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index acbf7a1..db3c8d5 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -558,7 +558,7 @@ draw_cell (GnucashSheet *sheet,
 
 
 
-    cairo_move_to (cr, rect.x + x_offset, rect.y - 1); //FIXME Not sure about this change from + 1
+    cairo_move_to (cr, rect.x + x_offset, rect.y + 1);
     pango_cairo_show_layout (cr, layout);
 
     cairo_restore (cr);

commit 66aa691a98f00d0019fb6f7cb1452c0e1807ce62
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 16:34:38 2017 +0100

    Do not make the first row height smaller
    
    Change the first row to be like all others, top and bottom borders to
    be offset by - 0.5 and so use the header border as the top border of
    first row.

diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index 59f6332..acbf7a1 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -421,10 +421,10 @@ draw_cell (GnucashSheet *sheet,
     /* top */
     draw_cell_line (cr, bg_color,
                     (borders.top >= borders.left ? x : x + 1.0),
-                    (y == 0 ? y + 0.5 : y - 0.5),
+                    y - 0.5,
                     (borders.top >= borders.right ?
                      x + width : x + width - 1),
-                    (y == 0 ? y + 0.5 : y - 0.5),
+                    y - 0.5,
                     borders.top);
 
     /* bottom */

commit 64b9872e363cf093dd79dd17e8d44def6167ecd8
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 15:34:46 2017 +0100

    Return the vertical split borders to light

diff --git a/src/register/ledger-core/split-register-model.c b/src/register/ledger-core/split-register-model.c
index c5389a8..e299fca 100644
--- a/src/register/ledger-core/split-register-model.c
+++ b/src/register/ledger-core/split-register-model.c
@@ -746,8 +746,13 @@ gnc_split_register_get_border (VirtualLocation virt_loc,
     {
         borders->top    = CELL_BORDER_LINE_LIGHT;
         borders->bottom = CELL_BORDER_LINE_LIGHT;
-        borders->left   = MIN (borders->left,   CELL_BORDER_LINE_NORMAL);
-        borders->right  = MIN (borders->right,  CELL_BORDER_LINE_NORMAL);
+        borders->left   = MIN (borders->left,   CELL_BORDER_LINE_LIGHT);
+        borders->right  = MIN (borders->right,  CELL_BORDER_LINE_LIGHT);
+
+        if (virt_loc.phys_col_offset == vcell->cellblock->start_col)
+            borders->left = CELL_BORDER_LINE_NORMAL;
+        if (virt_loc.phys_col_offset == vcell->cellblock->stop_col)
+            borders->right = CELL_BORDER_LINE_NORMAL;
     }
 }
 

commit 54677d37c427200b72163bc4a8795ee0ba1a7222
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Aug 3 08:22:12 2017 +0100

    Change the hatching draw fix to use a relative move

diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index e8728f2..59f6332 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -338,11 +338,9 @@ draw_hatching (cairo_t *cr,
     cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
 
     cairo_rectangle (cr, h_x, h_y, h_size, h_size);
-
     cairo_move_to (cr, h_x, h_y);
     cairo_rel_line_to (cr, h_size, h_size);
-
-    cairo_move_to (cr, h_x , h_y + h_size);
+    cairo_rel_move_to (cr, -h_size, 0);
     cairo_rel_line_to (cr, h_size, -h_size);
     cairo_stroke (cr);
 }

commit a2fa9eeff33919bd7ca56fc642473ca5b7109e22
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 10:38:21 2017 +0100

    Fix a problem with the arrows when register first loads
    
    After the register is loaded, when you first click on a arrow button
    the popup appears but the arrow disappears, subsequent pressing and the
    arrow toggles as expected. To fix this pack both arrows on the button
    and hide the one not active.

diff --git a/src/register/register-gnome/gnucash-item-edit.c b/src/register/register-gnome/gnucash-item-edit.c
index fbab6ce..fdbeabe 100644
--- a/src/register/register-gnome/gnucash-item-edit.c
+++ b/src/register/register-gnome/gnucash-item-edit.c
@@ -175,7 +175,8 @@ gnc_item_edit_init (GncItemEdit *item_edit)
 
     item_edit->popup_toggle.ebox = NULL;
     item_edit->popup_toggle.tbutton = NULL;
-    item_edit->popup_toggle.arrow = NULL;
+    item_edit->popup_toggle.arrow_up = NULL;
+    item_edit->popup_toggle.arrow_down = NULL;
     item_edit->popup_toggle.signals_connected = FALSE;
 
     item_edit->popup_item = NULL;
@@ -510,6 +511,7 @@ GtkWidget *
 gnc_item_edit_new (GnucashSheet *sheet)
 {
     char *hpad_str, *vpad_str, *entry_css;
+    GtkWidget *box;
     GtkStyleContext *stylecontext;
     GtkCssProvider *provider;
     GncItemEdit *item_edit =
@@ -545,13 +547,17 @@ gnc_item_edit_new (GnucashSheet *sheet)
     /* Create the popup button
        It will only be displayed when the cell being edited provides
        a popup item (like a calendar or account list) */
-    item_edit->popup_toggle.arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
+    item_edit->popup_toggle.arrow_down = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
+    item_edit->popup_toggle.arrow_up = gtk_image_new_from_icon_name ("go-up", GTK_ICON_SIZE_BUTTON);
+
+    box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+    gtk_box_pack_start (GTK_BOX(box), GTK_WIDGET(item_edit->popup_toggle.arrow_down), FALSE, FALSE, 0);
+    gtk_box_pack_start (GTK_BOX(box), GTK_WIDGET(item_edit->popup_toggle.arrow_up),FALSE, FALSE, 0);
 
     item_edit->popup_toggle.tbutton = gtk_toggle_button_new();
     gtk_toggle_button_set_mode (
         GTK_TOGGLE_BUTTON (item_edit->popup_toggle.tbutton), FALSE);
-    gtk_container_add(GTK_CONTAINER(item_edit->popup_toggle.tbutton),
-                      GTK_WIDGET(item_edit->popup_toggle.arrow));
+    gtk_container_add(GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(box));
 
     /* Force padding on the button to
        1. keep it small
@@ -574,6 +580,8 @@ gnc_item_edit_new (GnucashSheet *sheet)
                         FALSE, TRUE, 0);
     gtk_widget_show_all(GTK_WIDGET(item_edit));
 
+    gtk_widget_hide (GTK_WIDGET(item_edit->popup_toggle.arrow_up));
+
     return GTK_WIDGET(item_edit);
 }
 
@@ -663,10 +671,8 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
         unblock_toggle_signals (item_edit);
     }
 
-    gtk_container_remove (GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(item_edit->popup_toggle.arrow));
-    item_edit->popup_toggle.arrow = gtk_image_new_from_icon_name ("go-up", GTK_ICON_SIZE_BUTTON);
-    gtk_container_add (GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(item_edit->popup_toggle.arrow));
-    gtk_widget_show (item_edit->popup_toggle.arrow);
+    gtk_widget_hide (item_edit->popup_toggle.arrow_down);
+    gtk_widget_show (item_edit->popup_toggle.arrow_up);
 
     if (item_edit->popup_set_focus)
         item_edit->popup_set_focus (item_edit->popup_item,
@@ -711,10 +717,8 @@ gnc_item_edit_hide_popup (GncItemEdit *item_edit)
 
     gtk_container_remove (GTK_CONTAINER(item_edit->sheet), item_edit->popup_item);
 
-    gtk_container_remove (GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(item_edit->popup_toggle.arrow));
-    item_edit->popup_toggle.arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
-    gtk_container_add (GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(item_edit->popup_toggle.arrow));
-    gtk_widget_show (item_edit->popup_toggle.arrow);
+    gtk_widget_hide (item_edit->popup_toggle.arrow_up);
+    gtk_widget_show (item_edit->popup_toggle.arrow_down);
 
     gtk_toggle_button_set_active
     (GTK_TOGGLE_BUTTON(item_edit->popup_toggle.tbutton), FALSE);
diff --git a/src/register/register-gnome/gnucash-item-edit.h b/src/register/register-gnome/gnucash-item-edit.h
index 1a6e595..07ded69 100644
--- a/src/register/register-gnome/gnucash-item-edit.h
+++ b/src/register/register-gnome/gnucash-item-edit.h
@@ -61,7 +61,8 @@ struct _PopupToggle
 {
     GtkWidget *ebox;
     GtkWidget *tbutton;
-    GtkWidget *arrow;
+    GtkWidget *arrow_up;
+    GtkWidget *arrow_down;
     gboolean signals_connected;
 };
 

commit 4bef3a59e0f4489c8c3f26d114da26ebe5f3a3f7
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 09:17:34 2017 +0100

    Fix the place the popup appears when above the row
    
    There may be more to do here after more testing.

diff --git a/src/register/register-gnome/gnucash-item-edit.c b/src/register/register-gnome/gnucash-item-edit.c
index 19222e9..fbab6ce 100644
--- a/src/register/register-gnome/gnucash-item-edit.c
+++ b/src/register/register-gnome/gnucash-item-edit.c
@@ -582,11 +582,11 @@ void
 gnc_item_edit_show_popup (GncItemEdit *item_edit)
 {
     GtkToggleButton *toggle;
-    GtkAdjustment *vadj;
+    GtkAdjustment *vadj, *hadj;
     GtkAllocation alloc;
     GnucashSheet *sheet;
     gint x, y, w, h;
-    gint y_offset;
+    gint y_offset, x_offset;
     gint popup_x, popup_y;
     gint popup_w;
     gint popup_h;
@@ -609,8 +609,10 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
     view_width  = alloc.width;
 
     vadj = gtk_scrollable_get_vadjustment(GTK_SCROLLABLE(sheet));
+    hadj = gtk_scrollable_get_hadjustment(GTK_SCROLLABLE(sheet));
 
     y_offset = gtk_adjustment_get_value(vadj);
+    x_offset = gtk_adjustment_get_value(hadj);
     gnc_item_edit_get_pixel_coords (item_edit, &x, &y, &w, &h);
 
     popup_x = x;
@@ -620,7 +622,7 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
 
     if (up_height > down_height)
     {
-        popup_y = y_offset;
+        popup_y = y + y_offset;
         popup_h = up_height;
     }
     else
@@ -629,7 +631,7 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
         popup_h = down_height;
     }
 
-    popup_max_width = view_width - popup_x;
+    popup_max_width = view_width - popup_x + x_offset;
 
     if (item_edit->get_popup_height)
         popup_h = item_edit->get_popup_height
@@ -644,11 +646,13 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
     else
         popup_w = -1;
 
+    if (up_height > down_height)
+        popup_y = y - popup_h;
+
     if (!gtk_widget_get_parent (item_edit->popup_item))
         gtk_layout_put (GTK_LAYOUT(sheet), item_edit->popup_item,
                         popup_x, popup_y);
     gtk_widget_set_size_request(item_edit->popup_item, popup_w, popup_h);
-    // FIXME what about the GtkAnchorType that the GNOME_CANVAS_ITEM used ?
 
     toggle = GTK_TOGGLE_BUTTON(item_edit->popup_toggle.tbutton);
 
@@ -684,9 +688,11 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
         {
             popup_x -= popup_width - popup_max_width;
             popup_x = MAX (0, popup_x);
-            gtk_layout_move (GTK_LAYOUT(sheet), item_edit->popup_item,
-                             popup_x, popup_y);
         }
+        else
+            popup_x = x;
+
+        gtk_layout_move (GTK_LAYOUT(sheet), item_edit->popup_item, popup_x, popup_y);
     }
 }
 

commit 64639a57ad23b9ab336d9261fbcd3c3e3f712432
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 09:16:20 2017 +0100

    To update the toggle arrow it needs to be removed from the container

diff --git a/src/register/register-gnome/gnucash-item-edit.c b/src/register/register-gnome/gnucash-item-edit.c
index 420ef90..19222e9 100644
--- a/src/register/register-gnome/gnucash-item-edit.c
+++ b/src/register/register-gnome/gnucash-item-edit.c
@@ -659,7 +659,10 @@ gnc_item_edit_show_popup (GncItemEdit *item_edit)
         unblock_toggle_signals (item_edit);
     }
 
+    gtk_container_remove (GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(item_edit->popup_toggle.arrow));
     item_edit->popup_toggle.arrow = gtk_image_new_from_icon_name ("go-up", GTK_ICON_SIZE_BUTTON);
+    gtk_container_add (GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(item_edit->popup_toggle.arrow));
+    gtk_widget_show (item_edit->popup_toggle.arrow);
 
     if (item_edit->popup_set_focus)
         item_edit->popup_set_focus (item_edit->popup_item,
@@ -702,7 +705,10 @@ gnc_item_edit_hide_popup (GncItemEdit *item_edit)
 
     gtk_container_remove (GTK_CONTAINER(item_edit->sheet), item_edit->popup_item);
 
+    gtk_container_remove (GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(item_edit->popup_toggle.arrow));
     item_edit->popup_toggle.arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
+    gtk_container_add (GTK_CONTAINER(item_edit->popup_toggle.tbutton), GTK_WIDGET(item_edit->popup_toggle.arrow));
+    gtk_widget_show (item_edit->popup_toggle.arrow);
 
     gtk_toggle_button_set_active
     (GTK_TOGGLE_BUTTON(item_edit->popup_toggle.tbutton), FALSE);

commit 9318ed9f30369658fd06bba8be77bc948b5f0bc9
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 09:13:34 2017 +0100

    Change the cursor grid coordinates to reflect the other changes

diff --git a/src/register/register-gnome/gnucash-item-edit.c b/src/register/register-gnome/gnucash-item-edit.c
index 4ad4b68..420ef90 100644
--- a/src/register/register-gnome/gnucash-item-edit.c
+++ b/src/register/register-gnome/gnucash-item-edit.c
@@ -84,6 +84,20 @@ gnc_item_edit_get_pixel_coords (GncItemEdit *item_edit,
      item_edit->virt_loc.phys_col_offset,
      x, y, w, h);
 
+    // alter cell size of first column
+    if (item_edit->virt_loc.phys_col_offset == 0)
+    {
+        *x = *x + 1;
+        *w = *w - 1;
+    }
+
+    // alter cell size of first row
+    if (yd == 0)
+    {
+        *y = *y + 1;
+        *h = *h - 1;
+    }
+
     *x += xd;
     *y += yd;
 }
@@ -101,6 +115,7 @@ gnc_item_edit_update (GncItemEdit *item_edit)
 {
     gint x, y, w, h;
 
+//FIXME this does not appear to be realiable, widget does not always move to correct place
     gnc_item_edit_get_pixel_coords (item_edit, &x, &y, &w, &h);
     gtk_layout_move (GTK_LAYOUT(item_edit->sheet),
                      GTK_WIDGET(item_edit), x, y);
@@ -415,7 +430,7 @@ gnc_item_edit_get_preferred_width (GtkWidget *widget,
 {
     gint x, y, w, h;
     gnc_item_edit_get_pixel_coords (GNC_ITEM_EDIT (widget), &x, &y, &w, &h);
-    *minimal_width = *natural_width = w + 1;
+    *minimal_width = *natural_width = w - 1;
 }
 
 
@@ -426,7 +441,7 @@ gnc_item_edit_get_preferred_height (GtkWidget *widget,
 {
     gint x, y, w, h;
     gnc_item_edit_get_pixel_coords (GNC_ITEM_EDIT (widget), &x, &y, &w, &h);
-    *minimal_width = *natural_width = h + 1;
+    *minimal_width = *natural_width = h - 1;
 }
 
 /*

commit ea24c7b87cfede7fe52db8cc2c36d2c156945258
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 09:11:48 2017 +0100

    Change the cursor grid coordinates to reflect the other changes

diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index a5833f7..e8728f2 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -699,19 +699,28 @@ gnucash_sheet_draw_cursor (GnucashCursor *cursor, cairo_t *cr)
 
     fg_color = &gn_black;
 
-    /* draw the rectangle around the entire active
-     *    virtual *row */
-    cairo_rectangle (cr, cursor->x - x + 0.5, cursor->y - y + 0.5,
-                     cursor->w - 1.0, cursor->h - 1.0);
-    cairo_move_to (cr, cursor->x - x, cursor->y - y + cursor->h - 1.5);
-    cairo_rel_line_to (cr, cursor->w, 0);
     cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
+    /* draw the rectangle around the entire active virtual row - transaction rows only - double line  */
+
+    if (cursor->y == 0)
+        cairo_rectangle (cr, cursor->x - x + 0.5, cursor->y - y + 0.5, cursor->w - 1.0, cursor->h - 3.0);
+    else
+    {
+        if (cursor->x == 0)
+            cairo_rectangle (cr, cursor->x - x + 0.5, cursor->y - y - 0.5, cursor->w - 1.0, cursor->h - 2.0);
+        else
+            cairo_rectangle (cr, cursor->x - x - 0.5, cursor->y - y - 0.5, cursor->w, cursor->h - 2.0);
+    }
     cairo_set_line_width (cr, 1.0);
     cairo_stroke (cr);
 
-    cairo_rectangle (cr, cc->x - x + 0.5, cursor->y + cc->y - y + 0.5,
-                     cc->w - 1.0, cc->h - 1.0);
     cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
+    /* draw rectangle around the active cell */
+    if (cc->x != 0)
+        cairo_rectangle (cr, cc->x - x - 0.5, cursor->y + cc->y - y - 0.5, cc->w, cc->h);
+    else
+        cairo_rectangle (cr, cc->x - x + 0.5, cursor->y + cc->y - y - 0.5, cc->w - 1.0, cc->h);
+
     cairo_set_line_width (cr, 1.0);
     cairo_stroke (cr);
 }

commit 22d1d488b51c8b4140f921a43a67b02f935be5fa
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 09:06:33 2017 +0100

    Remove some blank lines from the header source file

diff --git a/src/register/register-gnome/gnucash-header.c b/src/register/register-gnome/gnucash-header.c
index 590599d..6635797 100644
--- a/src/register/register-gnome/gnucash-header.c
+++ b/src/register/register-gnome/gnucash-header.c
@@ -464,7 +464,6 @@ gnc_header_event (GtkWidget *widget, GdkEvent *event)
             header->resize_col_width = cd->pixel_width;
             header->resize_x = x;
         }
-
         break;
     }
     case GDK_BUTTON_RELEASE:
@@ -485,7 +484,6 @@ gnc_header_event (GtkWidget *widget, GdkEvent *event)
             header->resize_col = -1;
             gnc_header_request_redraw (header);
         }
-
         break;
     }
 
@@ -516,14 +514,12 @@ gnc_header_event (GtkWidget *widget, GdkEvent *event)
             header->resize_col = -1;
             gnc_header_auto_resize_column (header, resize_col);
         }
-
     }
     break;
 
     default:
         break;
     }
-
     return FALSE;
 }
 
@@ -572,7 +568,6 @@ gnc_header_set_property (GObject *object,
     case PROP_SHEET:
         header->sheet = GNUCASH_SHEET (g_value_get_object (value));
         gtk_scrollable_set_hadjustment (GTK_SCROLLABLE(layout), header->sheet->hadj);
-
         needs_update = TRUE;
         break;
     case PROP_CURSOR_NAME:

commit 8468783ad8b5328f96efc073d1423ebab2043f73
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 09:05:30 2017 +0100

    Add css style classes to parts of the register

diff --git a/src/register/register-gnome/gnucash-header.c b/src/register/register-gnome/gnucash-header.c
index 7678bb2..590599d 100644
--- a/src/register/register-gnome/gnucash-header.c
+++ b/src/register/register-gnome/gnucash-header.c
@@ -606,6 +606,9 @@ gnc_header_init (GncHeader *header)
     header->width = 400;
     header->style = NULL;
 
+    // Set the style context for this widget so it can be easily manipulated with css
+    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET(header)), "GncRegisterHeader");
+
     gtk_widget_add_events(GTK_WIDGET(header), (GDK_EXPOSURE_MASK
                           | GDK_BUTTON_PRESS_MASK
                           | GDK_BUTTON_RELEASE_MASK
diff --git a/src/register/register-gnome/gnucash-item-edit.c b/src/register/register-gnome/gnucash-item-edit.c
index dc0e88d..4ad4b68 100644
--- a/src/register/register-gnome/gnucash-item-edit.c
+++ b/src/register/register-gnome/gnucash-item-edit.c
@@ -505,6 +505,9 @@ gnc_item_edit_new (GnucashSheet *sheet)
                            NULL);
     gtk_layout_put (GTK_LAYOUT(sheet), GTK_WIDGET(item_edit), 0, 0);
 
+    // Set the style context for this widget so it can be easily manipulated with css
+    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET(item_edit)), "GncRegisterItemEdit");
+
     /* Create the text entry */
     item_edit->editor = gtk_entry_new();
     sheet->entry = item_edit->editor;
diff --git a/src/register/register-gnome/gnucash-register.c b/src/register/register-gnome/gnucash-register.c
index 269c611..a9842a5 100644
--- a/src/register/register-gnome/gnucash-register.c
+++ b/src/register/register-gnome/gnucash-register.c
@@ -346,6 +346,9 @@ gnucash_register_init (GnucashRegister *g_reg)
     gtk_widget_set_can_focus (GTK_WIDGET(table), FALSE);
     gtk_widget_set_can_default (GTK_WIDGET(table), FALSE);
 
+    // Set the style context for this widget so it can be easily manipulated with css
+    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET(g_reg)), "GncRegister");
+
     gtk_grid_set_row_homogeneous (GTK_GRID(table), FALSE);
     gtk_grid_set_column_homogeneous (GTK_GRID(table), FALSE);
 }
diff --git a/src/register/register-gnome/gnucash-sheet.c b/src/register/register-gnome/gnucash-sheet.c
index 10f8e04..83b2771 100644
--- a/src/register/register-gnome/gnucash-sheet.c
+++ b/src/register/register-gnome/gnucash-sheet.c
@@ -2503,6 +2503,9 @@ gnucash_sheet_init (GnucashSheet *sheet)
     gtk_widget_set_can_focus (GTK_WIDGET(sheet), TRUE);
     gtk_widget_set_can_default (GTK_WIDGET(sheet), TRUE);
 
+    // Set the style context for this widget so it can be easily manipulated with css
+    gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET(sheet)), "GncRegisterSheet");
+
     sheet->num_visible_blocks = 1;
     sheet->num_visible_phys_rows = 1;
 

commit 60ff88041d46bdfc270e42790a1ed6ea15795f63
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 09:00:41 2017 +0100

    Change the cell grid lines slightly
    
    Grid lines will be generally be drawn by subtracting 0.5 from the x and
    y values apart from the left border of the first column cell has 0.5
    added to the x value and the first row cell has 0.5 added to the top
    border y value. By doing this the overall dimensions does not change
    and all borders are visible.

diff --git a/src/register/register-gnome/gnucash-header.c b/src/register/register-gnome/gnucash-header.c
index 6d031c2..7678bb2 100644
--- a/src/register/register-gnome/gnucash-header.c
+++ b/src/register/register-gnome/gnucash-header.c
@@ -106,13 +106,18 @@ gnc_header_draw_offscreen (GncHeader *header)
                                                 header->height);
 
     cr = cairo_create (header->surface);
+    // Fill background color of header
     cairo_rectangle (cr, 0.5, 0.5, header->width - 1.0, header->height - 1.0);
     cairo_set_source_rgb (cr, bg_color->red, bg_color->green, bg_color->blue);
     cairo_fill_preserve (cr);
+
+    // Draw bottom horizontal line, makes bottom line thicker
     cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
+    cairo_move_to (cr, 0.5, header->height - 1.5);
+    cairo_line_to (cr, header->width - 1.0, header->height - 1.5);
+    cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
     cairo_set_line_width (cr, 1.0);
     cairo_stroke (cr);
-//    cairo_set_line_width (cr, 1.0);
 
     /*font = gnucash_register_font;*/
 
@@ -157,7 +162,8 @@ gnc_header_draw_offscreen (GncHeader *header)
                 continue;
             }
 
-            cairo_rectangle (cr, col_offset + 0.5, row_offset + 0.5, w, h);
+            cairo_rectangle (cr, col_offset - 0.5, row_offset + 0.5, w, h);
+            cairo_set_line_width (cr, 1.0);
             cairo_stroke (cr);
 
             virt_loc.vcell_loc =
@@ -189,6 +195,7 @@ gnc_header_draw_offscreen (GncHeader *header)
             text_h = h - 2;
             cairo_save (cr);
             cairo_rectangle (cr, text_x, text_y, text_w, text_h);
+            cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
             cairo_clip (cr);
             cairo_move_to (cr, text_x, text_y);
             pango_cairo_show_layout (cr, layout);
@@ -374,10 +381,12 @@ gnc_header_resize_column (GncHeader *header, gint col, gint width)
     gnucash_cursor_configure (GNUCASH_CURSOR(sheet->cursor));
     gnc_item_edit_configure (gnucash_sheet_get_item_edit (sheet));
 
+    gnc_header_reconfigure (header);
+
     gnucash_sheet_set_scroll_region (sheet);
     gnucash_sheet_update_adjustments (sheet);
 
-    gnc_header_reconfigure (header);
+//FIXME Not required?    gnc_header_request_redraw (header);
     gnucash_sheet_redraw_all (sheet);
 }
 
@@ -474,6 +483,7 @@ gnc_header_event (GtkWidget *widget, GdkEvent *event)
                  header->resize_col_width);
             header->in_resize = FALSE;
             header->resize_col = -1;
+            gnc_header_request_redraw (header);
         }
 
         break;
diff --git a/src/register/register-gnome/gnucash-sheet-private.c b/src/register/register-gnome/gnucash-sheet-private.c
index f36af59..a5833f7 100644
--- a/src/register/register-gnome/gnucash-sheet-private.c
+++ b/src/register/register-gnome/gnucash-sheet-private.c
@@ -342,7 +342,7 @@ draw_hatching (cairo_t *cr,
     cairo_move_to (cr, h_x, h_y);
     cairo_rel_line_to (cr, h_size, h_size);
 
-    cairo_rel_move_to (cr, -h_x, 0);
+    cairo_move_to (cr, h_x , h_y + h_size);
     cairo_rel_line_to (cr, h_size, -h_size);
     cairo_stroke (cr);
 }
@@ -369,7 +369,7 @@ draw_divider_line (cairo_t *cr, VirtualLocation virt_loc,
 
     cairo_set_source_rgb (cr, fg_color->red, fg_color->green, fg_color->blue);
 
-    cairo_set_line_width (cr, 3.0);
+    cairo_set_line_width (cr, 2.0);
     cairo_move_to (cr, x, y + 0.5 + offset);
     cairo_rel_line_to (cr, width, 0);
     cairo_stroke (cr);
@@ -423,42 +423,41 @@ draw_cell (GnucashSheet *sheet,
     /* top */
     draw_cell_line (cr, bg_color,
                     (borders.top >= borders.left ? x : x + 1.0),
-                    y + 0.5,
+                    (y == 0 ? y + 0.5 : y - 0.5),
                     (borders.top >= borders.right ?
                      x + width : x + width - 1),
-                    y + 0.5,
+                    (y == 0 ? y + 0.5 : y - 0.5),
                     borders.top);
 
     /* bottom */
     draw_cell_line (cr, bg_color,
-                    (borders.bottom >= borders.left ? x : x + 1),
-                    y + height + 0.5,
+                    (borders.bottom >= borders.left ? x : x + 1.0),
+                    y + height - 0.5,
                     (borders.bottom >= borders.right ?
                      x + width : x + width - 1),
-                    y + height + 0.5,
+                    y + height - 0.5,
                     borders.bottom);
 
     /* left */
     draw_cell_line (cr, bg_color,
-                    x + 0.5,
-                    (borders.left > borders.top ? y : y + 1),
-                    x + 0.5,
+                    (x == 0 ? x + 0.5 : x - 0.5),
+                    (borders.left > borders.top ? y : y),
+                    (x == 0 ? x + 0.5 : x - 0.5),
                     (borders.left > borders.bottom ?
-                     y + height : y + height - 1),
+                     y + height : y + height),
                     borders.left);
 
     /* right */
     draw_cell_line (cr, bg_color,
-                    x + width + 0.5,
-                    (borders.right > borders.top ? y : y + 1),
-                    x + width + 0.5,
+                    x + width - 0.5,
+                    (borders.right > borders.top ? y : y),
+                    x + width - 0.5,
                     (borders.right > borders.bottom ?
-                     y + height : y + height - 1),
+                     y + height : y + height),
                     borders.right);
 
     if (hatching)
-        draw_hatching (cr,
-                               x, y, width, height);
+        draw_hatching (cr, x, y, width, height);
 
     /* dividing line upper (red) */
     fg_color = &gn_red;
@@ -561,7 +560,7 @@ draw_cell (GnucashSheet *sheet,
 
 
 
-    cairo_move_to (cr, rect.x + x_offset, rect.y + 1);
+    cairo_move_to (cr, rect.x + x_offset, rect.y - 1); //FIXME Not sure about this change from + 1
     pango_cairo_show_layout (cr, layout);
 
     cairo_restore (cr);

commit 9b582c386af7a92c79e564f30cbe3d5be89e1282
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 08:28:49 2017 +0100

    Make the header align with the sheet when scrolled horizontally

diff --git a/src/register/register-gnome/gnucash-header.c b/src/register/register-gnome/gnucash-header.c
index 06b9fca..6d031c2 100644
--- a/src/register/register-gnome/gnucash-header.c
+++ b/src/register/register-gnome/gnucash-header.c
@@ -51,10 +51,15 @@ enum
 static gboolean
 gnc_header_draw (GtkWidget *header, cairo_t *cr)
 {
-    cairo_save (cr);
-    cairo_set_source_surface (cr, GNC_HEADER(header)->surface, 0, 0);
+    GnucashSheet *sheet = GNC_HEADER(header)->sheet;
+    GdkWindow *sheet_layout_win = gtk_layout_get_bin_window (GTK_LAYOUT(sheet));
+    gint x, y;
+
+    // use this to get the scroll x value to align the header
+    gdk_window_get_position (sheet_layout_win, &x, &y);
+
+    cairo_set_source_surface (cr, GNC_HEADER(header)->surface, x, 0);
     cairo_paint (cr);
-    cairo_restore (cr);
 
     return TRUE;
 }

commit 25cf1d91c0bd09a2ec92843916b4e6bef2409144
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 08:27:45 2017 +0100

    Change the layout to show left border of first cell

diff --git a/src/register/ledger-core/split-register-model.c b/src/register/ledger-core/split-register-model.c
index 0073898..c5389a8 100644
--- a/src/register/ledger-core/split-register-model.c
+++ b/src/register/ledger-core/split-register-model.c
@@ -742,25 +742,12 @@ gnc_split_register_get_border (VirtualLocation virt_loc,
     cursor_class =
         gnc_split_register_cursor_name_to_class (vcell->cellblock->cursor_name);
 
-    if (cursor_class == CURSOR_CLASS_TRANS &&
-            virt_loc.phys_col_offset == vcell->cellblock->start_col)
-        borders->left   = CELL_BORDER_LINE_NONE;
-
-    if (cursor_class == CURSOR_CLASS_TRANS &&
-            virt_loc.phys_col_offset == vcell->cellblock->stop_col)
-        borders->right  = CELL_BORDER_LINE_NONE;
-
     if (cursor_class == CURSOR_CLASS_SPLIT)
     {
         borders->top    = CELL_BORDER_LINE_LIGHT;
         borders->bottom = CELL_BORDER_LINE_LIGHT;
-        borders->left   = MIN (borders->left,   CELL_BORDER_LINE_LIGHT);
-        borders->right  = MIN (borders->right,  CELL_BORDER_LINE_LIGHT);
-
-        if (virt_loc.phys_col_offset == vcell->cellblock->start_col)
-            borders->left = CELL_BORDER_LINE_LIGHT;
-        if (virt_loc.phys_col_offset == vcell->cellblock->stop_col)
-            borders->right = CELL_BORDER_LINE_LIGHT;
+        borders->left   = MIN (borders->left,   CELL_BORDER_LINE_NORMAL);
+        borders->right  = MIN (borders->right,  CELL_BORDER_LINE_NORMAL);
     }
 }
 
diff --git a/src/register/register-gnome/gnucash-style.c b/src/register/register-gnome/gnucash-style.c
index 2566806..97d44a5 100644
--- a/src/register/register-gnome/gnucash-style.c
+++ b/src/register/register-gnome/gnucash-style.c
@@ -592,9 +592,6 @@ gnucash_sheet_get_borders (GnucashSheet *sheet, VirtualLocation virt_loc,
     borders->left  = line_style;
     borders->right = line_style;
 
-    if (virt_loc.phys_col_offset == 0)
-        borders->left = CELL_BORDER_LINE_NORMAL;
-
     style = gnucash_sheet_get_style_from_cursor (sheet, CURSOR_HEADER);
     if (style)
         if (virt_loc.phys_col_offset == (style->ncols - 1))

commit 0456b8ae84cfc13d5e684154f966b843bd3c5d19
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Aug 1 08:26:38 2017 +0100

    Update the register grid

diff --git a/src/register/register-gnome/gnucash-register.c b/src/register/register-gnome/gnucash-register.c
index e1b4b11..269c611 100644
--- a/src/register/register-gnome/gnucash-register.c
+++ b/src/register/register-gnome/gnucash-register.c
@@ -502,7 +502,7 @@ gnucash_register_create_widget (Table *table)
     gtk_widget_show (sheet);
 
     scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL, GNUCASH_SHEET(sheet)->vadj);
-    gtk_grid_attach (GTK_GRID(widget), GTK_WIDGET(scrollbar), 1, 0, 1, 4);
+    gtk_grid_attach (GTK_GRID(widget), GTK_WIDGET(scrollbar), 1, 0, 1, 2);
     gtk_widget_set_hexpand (GTK_WIDGET(scrollbar), FALSE);
     gtk_widget_set_halign (GTK_WIDGET(scrollbar), GTK_ALIGN_FILL);
     gtk_widget_set_vexpand (GTK_WIDGET(scrollbar), TRUE);
@@ -511,7 +511,7 @@ gnucash_register_create_widget (Table *table)
     gtk_widget_show (scrollbar);
 
     scrollbar = gtk_scrollbar_new (GTK_ORIENTATION_HORIZONTAL, GNUCASH_SHEET(sheet)->hadj);
-    gtk_grid_attach (GTK_GRID(widget), GTK_WIDGET(scrollbar), 0, 3, 1, 1);
+    gtk_grid_attach (GTK_GRID(widget), GTK_WIDGET(scrollbar), 0, 2, 1, 1);
     gtk_widget_set_hexpand (GTK_WIDGET(scrollbar), TRUE);
     gtk_widget_set_halign (GTK_WIDGET(scrollbar), GTK_ALIGN_FILL);
     gtk_widget_set_vexpand (GTK_WIDGET(scrollbar), FALSE);
@@ -538,7 +538,7 @@ gnucash_register_create_widget (Table *table)
     gtk_box_pack_start(GTK_BOX(box),
                                 GNUCASH_SHEET(sheet)->split_color, TRUE, TRUE, 0);
 
-    gtk_grid_attach (GTK_GRID(widget), GTK_WIDGET(box), 0, 4, 1, 1);
+    gtk_grid_attach (GTK_GRID(widget), GTK_WIDGET(box), 0, 3, 1, 1);
     gtk_widget_set_hexpand (GTK_WIDGET(box), TRUE);
     gtk_widget_set_halign (GTK_WIDGET(box), GTK_ALIGN_FILL);
     gtk_widget_set_vexpand (GTK_WIDGET(box), TRUE);



Summary of changes:
 src/register/ledger-core/split-register-model.c    | 12 +---
 src/register/register-gnome/gnucash-header.c       | 39 ++++++++----
 src/register/register-gnome/gnucash-item-edit.c    | 60 ++++++++++++++-----
 src/register/register-gnome/gnucash-item-edit.h    |  3 +-
 src/register/register-gnome/gnucash-register.c     | 13 +++-
 .../register-gnome/gnucash-sheet-private.c         | 69 +++++++++++++---------
 src/register/register-gnome/gnucash-sheet.c        |  7 +++
 src/register/register-gnome/gnucash-sheetP.h       |  1 +
 src/register/register-gnome/gnucash-style.c        |  3 -
 9 files changed, 137 insertions(+), 70 deletions(-)



More information about the gnucash-changes mailing list