diff options
Diffstat (limited to 'lib/widgets/ephy-spinner-tool-item.c')
-rw-r--r-- | lib/widgets/ephy-spinner-tool-item.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/widgets/ephy-spinner-tool-item.c b/lib/widgets/ephy-spinner-tool-item.c index 21583e8f5..96af434c6 100644 --- a/lib/widgets/ephy-spinner-tool-item.c +++ b/lib/widgets/ephy-spinner-tool-item.c @@ -24,6 +24,7 @@ #endif #include "ephy-spinner-tool-item.h" +#include "ephy-spinner.h" G_DEFINE_TYPE (EphySpinnerToolItem, ephy_spinner_tool_item, GTK_TYPE_TOOL_ITEM) @@ -32,7 +33,7 @@ ephy_spinner_tool_item_init (EphySpinnerToolItem *item) { GtkWidget *spinner; - spinner = gtk_spinner_new (); + spinner = ephy_spinner_new (); gtk_container_add (GTK_CONTAINER (item), spinner); gtk_widget_show (spinner); } @@ -40,38 +41,38 @@ ephy_spinner_tool_item_init (EphySpinnerToolItem *item) static void ephy_spinner_tool_item_toolbar_reconfigured (GtkToolItem *tool_item) { - GtkWidget *spinner; - GtkToolbarStyle style; - gint size; + EphySpinner *spinner; + GtkToolbarStyle style; + GtkIconSize spinner_size; - spinner = gtk_bin_get_child (GTK_BIN (tool_item)); - g_return_if_fail (spinner); + spinner = EPHY_SPINNER (gtk_bin_get_child (GTK_BIN (tool_item))); + g_return_if_fail (spinner); - style = gtk_tool_item_get_toolbar_style (tool_item); + style = gtk_tool_item_get_toolbar_style (tool_item); - /* FIXME: be smarter by taking the toolbar icon size (gtk_toolbar_get_icon_size) into account! */ + /* FIXME: be smarter by taking the toolbar icon size (gtk_toolbar_get_icon_size) into account! */ - if (style == GTK_TOOLBAR_BOTH) - { - size = 44; - } - else - { - size = 20; - } + if (style == GTK_TOOLBAR_BOTH) + { + spinner_size = GTK_ICON_SIZE_DIALOG; + } + else + { + spinner_size = GTK_ICON_SIZE_LARGE_TOOLBAR; + } - gtk_widget_set_size_request (spinner, size, size); + ephy_spinner_set_size (spinner, spinner_size); - if (GTK_TOOL_ITEM_CLASS (ephy_spinner_tool_item_parent_class)->toolbar_reconfigured) - GTK_TOOL_ITEM_CLASS (ephy_spinner_tool_item_parent_class)->toolbar_reconfigured (tool_item); + if (GTK_TOOL_ITEM_CLASS (ephy_spinner_tool_item_parent_class)->toolbar_reconfigured) + GTK_TOOL_ITEM_CLASS (ephy_spinner_tool_item_parent_class)->toolbar_reconfigured (tool_item); } static void ephy_spinner_tool_item_class_init (EphySpinnerToolItemClass *klass) { - GtkToolItemClass *tool_item_class = GTK_TOOL_ITEM_CLASS (klass); + GtkToolItemClass *tool_item_class = GTK_TOOL_ITEM_CLASS (klass); - tool_item_class->toolbar_reconfigured = ephy_spinner_tool_item_toolbar_reconfigured; + tool_item_class->toolbar_reconfigured = ephy_spinner_tool_item_toolbar_reconfigured; } /* @@ -98,18 +99,17 @@ void ephy_spinner_tool_item_set_spinning (EphySpinnerToolItem *item, gboolean spinning) { - GtkWidget *spinner; + EphySpinner *spinner; - spinner = gtk_bin_get_child (GTK_BIN (item)); + spinner = EPHY_SPINNER (gtk_bin_get_child (GTK_BIN (item))); g_return_if_fail (spinner); if (spinning) { - gtk_spinner_start (GTK_SPINNER (spinner)); + ephy_spinner_start (spinner); } else { - gtk_spinner_stop (GTK_SPINNER (spinner)); - gtk_spinner_reset (GTK_SPINNER (spinner)); + ephy_spinner_stop (spinner); } } |