Fix register resize bug.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3638 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-02-12 09:00:44 +00:00
parent eeb76cd05b
commit 961b14e8ff
2 changed files with 29 additions and 11 deletions

View File

@ -80,6 +80,8 @@ struct _RegWindow
/* Top level window */
GtkWidget * window;
gint width;
GtkWidget * toolbar;
SCM toolbar_change_callback_id;
@ -1815,6 +1817,25 @@ gnc_toolbar_change_cb (void *data)
gnc_reg_refresh_toolbar (regData);
}
static void
size_allocate (GtkWidget *widget,
GtkAllocation *allocation,
gpointer user_data)
{
RegWindow *regData = user_data;
/* HACK ALERT. this seems to be the only thing to get the
* freekin register window to stop freekin resizing itself
* all the freekin time. */
if (regData->width == allocation->width)
return;
regData->width = allocation->width;
gtk_window_set_default_size (GTK_WINDOW(regData->window), regData->width, 0);
}
/********************************************************************\
* regWindowLedger *
* opens up a ledger window for the account list *
@ -1861,15 +1882,19 @@ regWindowLedger (xaccLedgerDisplay *ledger)
regData->ledger = ledger;
regData->window = register_window;
regData->sort_type = BY_STANDARD;
regData->width = -1;
gnc_reg_set_window_name(regData);
/* Invoked when window is being destroyed. */
gtk_signal_connect(GTK_OBJECT(regData->window), "destroy",
GTK_SIGNAL_FUNC (gnc_register_destroy_cb), regData);
gtk_signal_connect (GTK_OBJECT(regData->window), "destroy",
GTK_SIGNAL_FUNC (gnc_register_destroy_cb), regData);
gtk_signal_connect(GTK_OBJECT(regData->window), "delete-event",
GTK_SIGNAL_FUNC (gnc_register_delete_cb), regData);
gtk_signal_connect (GTK_OBJECT(regData->window), "delete-event",
GTK_SIGNAL_FUNC (gnc_register_delete_cb), regData);
gtk_signal_connect (GTK_OBJECT(regData->window), "size_allocate",
GTK_SIGNAL_FUNC (size_allocate), regData);
show_all = gnc_lookup_boolean_option ("Register",
"Show All Transactions",

View File

@ -931,7 +931,6 @@ static void
gnucash_sheet_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
GnucashSheet *sheet = GNUCASH_SHEET(widget);
GtkWidget *window;
if (GTK_WIDGET_CLASS(sheet_parent_class)->size_allocate)
(*GTK_WIDGET_CLASS (sheet_parent_class)->size_allocate)
@ -953,12 +952,6 @@ gnucash_sheet_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
item_edit_configure (ITEM_EDIT(sheet->item_editor));
gnucash_sheet_update_adjustments (sheet);
/* HACK ALERT. this seems to be the only thing to get the
* freekin register window to stop freekin resizing itself
* all the freekin time. */
window = gtk_widget_get_toplevel (widget);
gtk_window_set_default_size (GTK_WINDOW(window), allocation->width, 0);
}
static gboolean