Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv14604/src/cbits/GTK
Modified Files:
GroupBox.c Notebook.c
Log Message:
bugfix
Index: GroupBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/GroupBox.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** GroupBox.c 1 Oct 2003 22:29:59 -0000 1.3
--- GroupBox.c 4 Oct 2003 17:04:48 -0000 1.4
***************
*** 20,29 ****
GtkRequisition requisition;
! gtk_widget_size_request (groupbox, &requisition);
res[0] = 0;
res[1] = 0;
! res[2] = requisition.width;
! res[3] = requisition.height;
}
--- 20,30 ----
GtkRequisition requisition;
! gtk_widget_size_request (GTK_FRAME(groupbox)->label_widget, &requisition);
res[0] = 0;
res[1] = 0;
! res[2] = (GTK_CONTAINER (groupbox)->border_width + GTK_WIDGET (groupbox)->style->xthickness) * 2;
! res[3] = MAX (0, requisition.height - GTK_WIDGET (groupbox)->style->xthickness) +
! (GTK_CONTAINER (groupbox)->border_width + GTK_WIDGET (groupbox)->style->ythickness) * 2;
}
Index: Notebook.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Notebook.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Notebook.c 1 Oct 2003 22:09:00 -0000 1.6
--- Notebook.c 4 Oct 2003 17:04:48 -0000 1.7
***************
*** 29,44 ****
};
! void osGetNotebookReqSize(WindowHandle notebook, int *res)
{
! GtkRequisition requisition;
! // The size requisition of PortLayout is always 0. That means that the size request of notebook
! // will be equal to the external size of the notebook (i.e. the size consumed from borders and from
! // page labels. This is exactly what we need. In the haskell world to the external size is added
! // the size required to fit the pages of the notebook.
! gtk_widget_size_request (notebook, &requisition);
! res[0] = requisition.width;
! res[1] = requisition.height;
}
--- 29,79 ----
};
! void osGetNotebookReqSize(WindowHandle widget, int *res)
{
! GtkWidget *page, *label;
! GList *children;
! GtkRequisition child_requisition;
! gint focus_width;
! gint tab_width, tab_height;
! GtkNotebook *notebook = GTK_NOTEBOOK (widget);
! gtk_widget_style_get (widget, "focus-line-width", &focus_width, NULL);
! tab_width = 0;
! tab_height = 0;
!
! children = gtk_container_get_children(GTK_CONTAINER(notebook));
! while (children)
! {
! page = children->data;
!
! if (GTK_WIDGET_VISIBLE (page))
! {
! label = gtk_notebook_get_tab_label(notebook, page);
! gtk_widget_size_request (label, &child_requisition);
!
! child_requisition.width += 2 * widget->style->xthickness;
! child_requisition.height += 2 * widget->style->ythickness;
!
! switch (notebook->tab_pos)
! {
! case GTK_POS_TOP:
! case GTK_POS_BOTTOM:
! child_requisition.height += 2 * (notebook->tab_vborder + focus_width);
! tab_height = MAX (tab_height, child_requisition.height);
! break;
! case GTK_POS_LEFT:
! case GTK_POS_RIGHT:
! child_requisition.width += 2 * (notebook->tab_hborder + focus_width);
! tab_width = MAX (tab_width, child_requisition.width);
! break;
! }
! }
!
! children = g_list_remove(children, page);
! }
!
! res[0] = (widget->style->xthickness + GTK_CONTAINER (widget)->border_width) * 2 + tab_width;
! res[1] = (widget->style->ythickness + GTK_CONTAINER (widget)->border_width) * 2 + tab_height;
}
|