aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-10-18 04:56:10 +0800
committerChristian Persch <chpe@src.gnome.org>2006-10-18 04:56:10 +0800
commit5ba3dbaf7e99a051d004362d86c12e6818674661 (patch)
tree5c7e17acdbb8f90abd4783556636e5a7088600fc /src
parent03d63a3c1d4522010a58e61aff6aad83d28a7db4 (diff)
downloadgsoc2013-epiphany-5ba3dbaf7e99a051d004362d86c12e6818674661.tar
gsoc2013-epiphany-5ba3dbaf7e99a051d004362d86c12e6818674661.tar.gz
gsoc2013-epiphany-5ba3dbaf7e99a051d004362d86c12e6818674661.tar.bz2
gsoc2013-epiphany-5ba3dbaf7e99a051d004362d86c12e6818674661.tar.lz
gsoc2013-epiphany-5ba3dbaf7e99a051d004362d86c12e6818674661.tar.xz
gsoc2013-epiphany-5ba3dbaf7e99a051d004362d86c12e6818674661.tar.zst
gsoc2013-epiphany-5ba3dbaf7e99a051d004362d86c12e6818674661.zip
A lib/widgets/ephy-spinner-tool-item.c: A
2006-10-17 Christian Persch <chpe@cvs.gnome.org> * lib/widgets/Makefile.am: A lib/widgets/ephy-spinner-tool-item.c: A lib/widgets/ephy-spinner-tool-item.h: * lib/widgets/testspinner.c: (change_toolbar_style_cb), (change_toolbar_icon_size_cb), (spin_toolbar_spinner_cb), (main): * src/ephy-toolbar.c: (ephy_toolbar_update_spinner), (ephy_toolbar_constructor): Add EphySpinnerToolItem which encapsulates a spinner and automatically adapts its size to toolbar style changes, and use it in EphyToolbar.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ephy-toolbar.c47
1 files changed, 6 insertions, 41 deletions
diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c
index 60acce052..a4c4bd8b7 100755
--- a/src/ephy-toolbar.c
+++ b/src/ephy-toolbar.c
@@ -31,7 +31,7 @@
#include "ephy-navigation-action.h"
#include "ephy-topic-action.h"
#include "ephy-zoom-action.h"
-#include "ephy-spinner.h"
+#include "ephy-spinner-tool-item.h"
#include "ephy-dnd.h"
#include "ephy-shell.h"
#include "ephy-stock-icons.h"
@@ -71,8 +71,7 @@ struct _EphyToolbarPrivate
GtkActionGroup *action_group;
GtkAction *actions[LAST_ACTION];
GtkWidget *fixed_toolbar;
- GtkWidget *spinner;
- GtkToolItem *spinner_item;
+ EphySpinnerToolItem *spinner;
GtkToolItem *sep_item;
GtkToolItem *exit_button;
gulong set_focus_handler;
@@ -135,35 +134,7 @@ ephy_toolbar_update_spinner (EphyToolbar *toolbar)
{
EphyToolbarPrivate *priv = toolbar->priv;
- if (priv->spinning)
- {
- ephy_spinner_start (EPHY_SPINNER (priv->spinner));
- }
- else
- {
- ephy_spinner_stop (EPHY_SPINNER (priv->spinner));
- }
-}
-
-static void
-fixed_toolbar_reconfigured_cb (GtkToolItem *item,
- EphySpinner *spinner)
-{
- GtkToolbarStyle style;
- GtkIconSize size;
-
- style = gtk_tool_item_get_toolbar_style (item);
-
- if (style == GTK_TOOLBAR_BOTH)
- {
- size = GTK_ICON_SIZE_INVALID;
- }
- else
- {
- size = GTK_ICON_SIZE_LARGE_TOOLBAR;
- }
-
- ephy_spinner_set_size (spinner, size);
+ ephy_spinner_tool_item_set_spinning (priv->spinner, priv->spinning);
}
static void
@@ -589,15 +560,9 @@ ephy_toolbar_constructor (GType type,
gtoolbar = GTK_TOOLBAR (priv->fixed_toolbar);
gtk_toolbar_set_show_arrow (gtoolbar, FALSE);
- priv->spinner = ephy_spinner_new ();
- gtk_widget_show (priv->spinner);
-
- priv->spinner_item = gtk_tool_item_new ();
- g_signal_connect (priv->spinner_item, "toolbar-reconfigured",
- G_CALLBACK (fixed_toolbar_reconfigured_cb), priv->spinner);
- gtk_container_add (GTK_CONTAINER (priv->spinner_item), priv->spinner);
- gtk_toolbar_insert (gtoolbar, priv->spinner_item, -1);
- gtk_widget_show (GTK_WIDGET (priv->spinner_item));
+ priv->spinner = ephy_spinner_tool_item_new ();
+ gtk_toolbar_insert (gtoolbar, GTK_TOOL_ITEM (priv->spinner), -1);
+ gtk_widget_show (GTK_WIDGET (priv->spinner));
priv->sep_item = gtk_separator_tool_item_new ();
gtk_toolbar_insert (gtoolbar, priv->sep_item, -1);