From 33cb44bfc9729db0d9eae6e5e686f0feb522f524 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Thu, 25 Oct 2001 06:01:44 +0000 Subject: [PATCH] Fix resizing bug. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5722 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/register/register-gnome/gnucash-header.c | 5 +++- src/register/register-gnome/gnucash-sheet.c | 29 -------------------- 2 files changed, 4 insertions(+), 30 deletions(-) diff --git a/src/register/register-gnome/gnucash-header.c b/src/register/register-gnome/gnucash-header.c index 6ee974fdb9..d7127c8dfc 100644 --- a/src/register/register-gnome/gnucash-header.c +++ b/src/register/register-gnome/gnucash-header.c @@ -313,13 +313,16 @@ gnucash_header_reconfigure (GnucashHeader *header) header->width != w || header->style != old_style) { + gint old_height = header->height; + header->height = h; header->width = w; gnome_canvas_set_scroll_region (GNOME_CANVAS(canvas), 0, 0, w, h); - gtk_widget_set_usize (GTK_WIDGET(canvas), -1, h); + if (old_height != h) + gtk_widget_set_usize (GTK_WIDGET(canvas), -1, h); gnucash_header_request_redraw (header); } diff --git a/src/register/register-gnome/gnucash-sheet.c b/src/register/register-gnome/gnucash-sheet.c index 25d87128d6..041c173ee9 100644 --- a/src/register/register-gnome/gnucash-sheet.c +++ b/src/register/register-gnome/gnucash-sheet.c @@ -40,12 +40,6 @@ #include "gnucash-header.h" #include "gnucash-item-edit.h" -/* +DEBUG Just for the time being, until we get this - * gnome-druid/gnucash-sheet problem sorted out. --jsled */ -#include "gnc-engine-util.h" -static short module = MOD_SX; -/* -DEBUG */ - #define DEFAULT_REGISTER_HEIGHT 400 #define DEFAULT_REGISTER_WIDTH 630 @@ -688,10 +682,6 @@ gnucash_sheet_size_request (GtkWidget *widget, GtkRequisition *requisition) requisition->width = compute_optimal_width (sheet); requisition->height = compute_optimal_height (sheet); -/* temporary -- jsled - DEBUG( "size_request: returning %d x %d\n", - requisition->width, requisition->height ); -*/ } const char * @@ -1022,30 +1012,11 @@ gnucash_sheet_size_allocate (GtkWidget *widget, GtkAllocation *allocation) if (GTK_WIDGET_CLASS(sheet_parent_class)->size_allocate) (*GTK_WIDGET_CLASS (sheet_parent_class)->size_allocate) (widget, allocation); -/* temporary -- jsled - DEBUG( "allocation: x: %d, y: %d, w: %d, h: %d, " - "sheet_width: %d, sheet_height: %d\n", - allocation->x, allocation->y, - allocation->width, allocation->height, - sheet->window_height, sheet->window_width ); -*/ if (allocation->height == sheet->window_height && allocation->width == sheet->window_width) return; - /* Deal with a bug in gnome-druid.c which causes the ledger to resize - * in 8x4 increments ad infinitum... :( - * - * THIS IS BAD AND LAME. THE RIGHT THING TO DO IS FIGURE OUT WHO'S - * DOING THE BAD THING AND FIX THEM. - * -- jsled - */ - if ( (allocation->height - GNOME_PAD_SMALL - sheet->window_height) == 0 - && (allocation->width - 2 * GNOME_PAD_SMALL - sheet->window_width) == 0 ) - return; - /* END LAMENESS */ - if (allocation->width != sheet->window_width) gnucash_sheet_styles_set_dimensions (sheet, allocation->width);