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 +
62 if (gap_left && packing_changed) {
63 if (allocate_at_bottom
64 && notebook->cur_page->pack
67 notebook->cur_page->allocation.
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 && top_y >= anchor
95 anchor + child_allocation.height / 2)
97 notebook->cur_page->allocation.
102 if ((page == priv->detached_tab
103 && priv->operation == DRAG_OPERATION_DETACH)
104 || (page == notebook->cur_page
105 && priv->operation == DRAG_OPERATION_REORDER))
106 page->allocation.x = 0;
107 if (page != notebook->cur_page)
110 page->allocation.y = 0;
114 page->allocation.x = 0;
119 if (priv->operation != DRAG_OPERATION_REORDER
120 || priv->operation == DRAG_OPERATION_REORDER
121 && page != notebook->cur_page)
122 if (!allocate_at_bottom)
124 child_allocation.width
128 if (priv->operation != DRAG_OPERATION_REORDER
129 || priv->operation == DRAG_OPERATION_REORDER
130 && page != notebook->cur_page)
131 if (priv->operation == DRAG_OPERATION_REORDER)
133 notebook->cur_page->pack
134 && !allocate_at_bottom
137 + child_allocation.height
140 anchor + child_allocation.height)
146 IA__gtk_widget_set_child_visible(page->tab_label, 1);