* Boston, MA 02111-1307, USA.
*/
-#include <config.h>
+#include "config.h"
#include <atk/atk.h>
{
GtkAssistantPrivate *priv = assistant->priv;
+ if (!priv->current_page)
+ return;
+
switch (priv->current_page->type)
{
case GTK_ASSISTANT_PAGE_INTRO:
{
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->close, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->cancel, FALSE, FALSE, 0);
- gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->last, FALSE, FALSE, 0);
- gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->back, FALSE, FALSE, 0);
- gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->forward, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->apply, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->forward, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->back, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (priv->action_area), assistant->last, FALSE, FALSE, 0);
}
gtk_widget_set_parent (priv->action_area, GTK_WIDGET (assistant));
while (page_node && !GTK_WIDGET_VISIBLE (((GtkAssistantPage *) page_node->data)->page))
page_node = page_node->next;
+ if (page_node == element)
+ page_node = page_node->next;
+
if (page_node)
priv->current_page = page_node->data;
else
/* Header */
gtk_widget_get_child_requisition (priv->header_image, &header_requisition);
- header_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width + header_padding;
- header_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width + header_padding;
+ header_allocation.x = GTK_CONTAINER (widget)->border_width + header_padding;
+ header_allocation.y = GTK_CONTAINER (widget)->border_width + header_padding;
header_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * header_padding;
header_allocation.height = header_requisition.height;
gtk_widget_size_allocate (priv->header_image, &header_allocation);
/* Action area */
- child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
- child_allocation.y = allocation->y + allocation->height -
+ child_allocation.x = GTK_CONTAINER (widget)->border_width;
+ child_allocation.y = allocation->height -
GTK_CONTAINER (widget)->border_width - priv->action_area->requisition.height;
child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width;
child_allocation.height = priv->action_area->requisition.height;
/* Sidebar */
if (rtl)
- child_allocation.x = allocation->x + allocation->width -
+ child_allocation.x = allocation->width -
GTK_CONTAINER (widget)->border_width - priv->sidebar_image->requisition.width;
else
- child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width;
+ child_allocation.x = GTK_CONTAINER (widget)->border_width;
- child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width +
+ child_allocation.y = GTK_CONTAINER (widget)->border_width +
priv->header_image->allocation.height + 2 * header_padding;
child_allocation.width = priv->sidebar_image->requisition.width;
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
gtk_widget_size_allocate (priv->sidebar_image, &child_allocation);
/* Pages */
- child_allocation.x = allocation->x + GTK_CONTAINER (widget)->border_width + content_padding;
- child_allocation.y = allocation->y + GTK_CONTAINER (widget)->border_width +
+ child_allocation.x = GTK_CONTAINER (widget)->border_width + content_padding;
+ child_allocation.y = GTK_CONTAINER (widget)->border_width +
priv->header_image->allocation.height + 2 * header_padding + content_padding;
child_allocation.width = allocation->width - 2 * GTK_CONTAINER (widget)->border_width - 2 * content_padding;
child_allocation.height = allocation->height - 2 * GTK_CONTAINER (widget)->border_width -
gtk_assistant_add (GtkContainer *container,
GtkWidget *page)
{
- g_return_if_fail (GTK_IS_WIDGET (page));
-
gtk_assistant_append_page (GTK_ASSISTANT (container), page);
}
gtk_assistant_remove (GtkContainer *container,
GtkWidget *page)
{
- GtkAssistant *assistant;
+ GtkAssistant *assistant = (GtkAssistant*) container;
GList *element;
- assistant = (GtkAssistant*) container;
-
element = find_page (assistant, page);
if (element)
* initial page is != to 0
*/
if (GTK_WIDGET_MAPPED (assistant))
- priv->visited_pages = g_slist_prepend (priv->visited_pages, page);
+ priv->visited_pages = g_slist_prepend (priv->visited_pages,
+ priv->current_page);
set_current_page (assistant, page);
}
/* Page flow has possibly changed, so the
buttons state might need to change too */
- if (priv->current_page)
- set_assistant_buttons_state (assistant);
+ set_assistant_buttons_state (assistant);
}
/**
/* Always set buttons state, a change in a future page
might change current page buttons */
- if (priv->current_page)
- set_assistant_buttons_state (assistant);
+ set_assistant_buttons_state (assistant);
gtk_widget_child_notify (page, "page-type");
}
/* Always set buttons state, a change in a future page
might change current page buttons */
- if (priv->current_page)
- set_assistant_buttons_state (assistant);
+ set_assistant_buttons_state (assistant);
gtk_widget_child_notify (page, "complete");
}
g_type_query (derived_atk_type, &query);
type = g_type_register_static_simple (derived_atk_type,
- "GtkAssistantAccessible",
+ I_("GtkAssistantAccessible"),
query.class_size,
(GClassInitFunc) gtk_assistant_accessible_class_init,
query.instance_size,
if (!type)
{
type = g_type_register_static_simple (ATK_TYPE_OBJECT_FACTORY,
- "GtkAssistantAccessibleFactory",
+ I_("GtkAssistantAccessibleFactory"),
sizeof (AtkObjectFactoryClass),
(GClassInitFunc) gtk_assistant_accessible_factory_class_init,
sizeof (AtkObjectFactory),