Improve GtkNotbook behaviour with too little space
This fixes bug 582488. The patch was provided by Morten Welinder.
This commit is contained in:
@ -4981,12 +4981,15 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
|
|||||||
remaining_space, STEP_NEXT);
|
remaining_space, STEP_NEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*remaining_space <= 0)
|
if (tab_space <= 0 || *remaining_space < 0)
|
||||||
{
|
{
|
||||||
/* show 1 tab */
|
/* show 1 tab */
|
||||||
notebook->first_tab = notebook->focus_tab;
|
notebook->first_tab = notebook->focus_tab;
|
||||||
*last_child = gtk_notebook_search_page (notebook, notebook->focus_tab,
|
*last_child = gtk_notebook_search_page (notebook, notebook->focus_tab,
|
||||||
STEP_NEXT, TRUE);
|
STEP_NEXT, TRUE);
|
||||||
|
page = notebook->first_tab->data;
|
||||||
|
*remaining_space = tab_space - page->requisition.width;
|
||||||
|
*n = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -5073,7 +5076,6 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
|
|||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (*remaining_space < 0)
|
if (*remaining_space < 0)
|
||||||
{
|
{
|
||||||
@ -5089,6 +5091,7 @@ gtk_notebook_calculate_shown_tabs (GtkNotebook *notebook,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
*remaining_space = 0;
|
*remaining_space = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* unmap all non-visible tabs */
|
/* unmap all non-visible tabs */
|
||||||
for (children = gtk_notebook_search_page (notebook, NULL,
|
for (children = gtk_notebook_search_page (notebook, NULL,
|
||||||
|
|||||||
Reference in New Issue
Block a user