8 GTK_POS_LEFT, GTK_POS_RIGHT, GTK_POS_TOP, GTK_POS_BOTTOM,
9 DRAG_OPERATION_NONE, DRAG_OPERATION_REORDER, DRAG_OPERATION_DETACH
17 GdkRectangle requisition, allocation;
20 GtkNotebookPage *cur_page;
26 GtkNotebookPage *detached_tab;
28 gtk_notebook_calculate_tabs_allocation()
30 GtkNotebook *notebook;
35 GtkNotebookPrivate *priv;
36 GtkNotebookPage *page;
37 int allocate_at_bottom;
49 GdkRectangle child_allocation;
50 while (*children && *children != last_child) {
51 if (page->tab_label->parent != notebook)
53 if (*expanded_tabs && notebook->homogeneous)
54 tab_extra_space = *remaining_space / *expanded_tabs;
58 child_allocation.width =
59 page->requisition.width + tab_overlap +
61 if (gap_left && packing_changed) {
62 if (allocate_at_bottom
64 notebook->cur_page->pack
70 if (allocate_at_bottom)
71 anchor -= child_allocation.width;
72 if (priv->operation == DRAG_OPERATION_REORDER
73 && page->pack == notebook->cur_page->pack)
74 if (!allocate_at_bottom
77 anchor + child_allocation.width / 2)
82 child_allocation.x = anchor;
86 child_allocation.height =
87 page->requisition.height + tab_overlap +
90 priv->x = child_allocation.x;
91 if (priv->operation == DRAG_OPERATION_REORDER
92 && page->pack == notebook->cur_page->pack)
93 if (!allocate_at_bottom
97 child_allocation.height / 2)
103 if ((page == priv->detached_tab
104 && priv->operation == DRAG_OPERATION_DETACH)
105 || (page == notebook->cur_page
106 && priv->operation == DRAG_OPERATION_REORDER))
107 page->allocation.x = 0;
108 if (page != notebook->cur_page)
111 page->allocation.y = ythickness;
113 page->allocation.height =
114 page->allocation.height
117 page->allocation.x = xthickness;
119 page->allocation.width =
120 page->allocation.width ;
125 if (priv->operation != DRAG_OPERATION_REORDER
126 || priv->operation == DRAG_OPERATION_REORDER
127 && page != notebook->cur_page)
128 if (!allocate_at_bottom)
130 child_allocation.width -
134 if (priv->operation != DRAG_OPERATION_REORDER
135 || priv->operation == DRAG_OPERATION_REORDER
136 && page != notebook->cur_page)
137 if (priv->operation == DRAG_OPERATION_REORDER)
139 notebook->cur_page->pack
140 && !allocate_at_bottom
142 anchor + child_allocation.height / 2
144 anchor + child_allocation.height)
151 IA__gtk_widget_set_child_visible(page->tab_label, 1);