forked from AuroraMiddleware/gtk
Drop internal function to find page position
This commit is contained in:
parent
f838ecf9f0
commit
a7bb193377
@ -445,8 +445,6 @@ static gint gtk_notebook_page_compare (gconstpointer a,
|
|||||||
static GList* gtk_notebook_find_child (GtkNotebook *notebook,
|
static GList* gtk_notebook_find_child (GtkNotebook *notebook,
|
||||||
GtkWidget *child,
|
GtkWidget *child,
|
||||||
const gchar *function);
|
const gchar *function);
|
||||||
static gint gtk_notebook_real_page_position (GtkNotebook *notebook,
|
|
||||||
GList *list);
|
|
||||||
static GList * gtk_notebook_search_page (GtkNotebook *notebook,
|
static GList * gtk_notebook_search_page (GtkNotebook *notebook,
|
||||||
GList *list,
|
GList *list,
|
||||||
gint direction,
|
gint direction,
|
||||||
@ -4568,7 +4566,6 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
|
|||||||
* gtk_notebook_timer
|
* gtk_notebook_timer
|
||||||
* gtk_notebook_set_scroll_timer
|
* gtk_notebook_set_scroll_timer
|
||||||
* gtk_notebook_page_compare
|
* gtk_notebook_page_compare
|
||||||
* gtk_notebook_real_page_position
|
|
||||||
* gtk_notebook_search_page
|
* gtk_notebook_search_page
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
@ -4891,28 +4888,6 @@ gtk_notebook_update_labels (GtkNotebook *notebook)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gint
|
|
||||||
gtk_notebook_real_page_position (GtkNotebook *notebook,
|
|
||||||
GList *list)
|
|
||||||
{
|
|
||||||
GtkNotebookPrivate *priv = notebook->priv;
|
|
||||||
GList *work;
|
|
||||||
gint count_start;
|
|
||||||
|
|
||||||
for (work = priv->children, count_start = 0;
|
|
||||||
work && work != list; work = work->next)
|
|
||||||
if (GTK_NOTEBOOK_PAGE (work)->pack == GTK_PACK_START)
|
|
||||||
count_start++;
|
|
||||||
|
|
||||||
if (!work)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (GTK_NOTEBOOK_PAGE (list)->pack == GTK_PACK_START)
|
|
||||||
return count_start;
|
|
||||||
|
|
||||||
return (count_start + g_list_length (list) - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GList *
|
static GList *
|
||||||
gtk_notebook_search_page (GtkNotebook *notebook,
|
gtk_notebook_search_page (GtkNotebook *notebook,
|
||||||
GList *list,
|
GList *list,
|
||||||
@ -6582,7 +6557,7 @@ gtk_notebook_menu_item_create (GtkNotebook *notebook,
|
|||||||
menu_item = gtk_menu_item_new ();
|
menu_item = gtk_menu_item_new ();
|
||||||
gtk_container_add (GTK_CONTAINER (menu_item), page->menu_label);
|
gtk_container_add (GTK_CONTAINER (menu_item), page->menu_label);
|
||||||
gtk_menu_shell_insert (GTK_MENU_SHELL (priv->menu), menu_item,
|
gtk_menu_shell_insert (GTK_MENU_SHELL (priv->menu), menu_item,
|
||||||
gtk_notebook_real_page_position (notebook, list));
|
g_list_position (priv->children, list));
|
||||||
g_signal_connect (menu_item, "activate",
|
g_signal_connect (menu_item, "activate",
|
||||||
G_CALLBACK (gtk_notebook_menu_switch_page), page);
|
G_CALLBACK (gtk_notebook_menu_switch_page), page);
|
||||||
if (gtk_widget_get_visible (page->child))
|
if (gtk_widget_get_visible (page->child))
|
||||||
@ -7516,7 +7491,7 @@ gtk_notebook_set_tab_label (GtkNotebook *notebook,
|
|||||||
gchar string[32];
|
gchar string[32];
|
||||||
|
|
||||||
g_snprintf (string, sizeof(string), _("Page %u"),
|
g_snprintf (string, sizeof(string), _("Page %u"),
|
||||||
gtk_notebook_real_page_position (notebook, list));
|
g_list_position (priv->children, list));
|
||||||
page->tab_label = gtk_label_new (string);
|
page->tab_label = gtk_label_new (string);
|
||||||
gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook));
|
gtk_widget_set_parent (page->tab_label, GTK_WIDGET (notebook));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user