Skip to content

Commit

Permalink
Fix problem when sheet first loaded in the register
Browse files Browse the repository at this point in the history
When the horizontal scroll bar is hidden there is a possibility that
the space is not taken up by the sheet so request a resize when idle.
  • Loading branch information
Bob-IT committed Sep 28, 2017
1 parent c3c01f4 commit cd92fe0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions gnucash/register/register-gnome/gnucash-register.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,15 @@ gnucash_register_goto_next_matching_row (GnucashRegister *reg,
gnucash_sheet_goto_virt_loc (sheet, virt_loc);
}

static gboolean
gnucash_register_sheet_resize (GnucashRegister *reg)
{
// Sometimes the space left by the horzontal scrollbar does
// not get filled on load, this makes sure it does
if (!reg->hscrollbar_visible)
gtk_widget_queue_resize (GTK_WIDGET (reg->sheet));
return FALSE;
}

static void
gnucash_register_update_hadjustment (GtkAdjustment *adj,
Expand All @@ -287,6 +296,10 @@ gnucash_register_update_hadjustment (GtkAdjustment *adj,
{
gtk_widget_hide(reg->hscrollbar);
reg->hscrollbar_visible = FALSE;
// When sheet first loaded and the scrollbar is hidden, the space left
// is not always automaticly taken up by the sheet so queue a resize
// when all is idle
g_idle_add ((GSourceFunc) gnucash_register_sheet_resize, reg);
}
}
}
Expand Down

0 comments on commit cd92fe0

Please sign in to comment.