Fix resizing bug.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5722 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-10-25 06:01:44 +00:00
parent c2f199c910
commit 33cb44bfc9
2 changed files with 4 additions and 30 deletions

View File

@@ -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);
}

View File

@@ -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);