Commit f0d1f905 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

added actions to zoom in/out.

2005-04-17  Sven Neumann  <sven@gimp.org>

	* plug-ins/helpbrowser/dialog.c: added actions to zoom in/out.

	* plug-ins/helpbrowser/gimpthrobberaction.[ch]: fixed handling of
	overflow menu items.
parent dab360d9
2005-04-17 Sven Neumann <sven@gimp.org>
* plug-ins/helpbrowser/dialog.c: added actions to zoom in/out.
* plug-ins/helpbrowser/gimpthrobberaction.[ch]: fixed handling of
overflow menu items.
2005-04-17 Sven Neumann <sven@gimp.org>
* plug-ins/helpbrowser/Makefile.am
......
......@@ -74,6 +74,10 @@ static void forward_callback (GtkAction *action,
gpointer data);
static void index_callback (GtkAction *action,
gpointer data);
static void zoom_in_callback (GtkAction *action,
gpointer data);
static void zoom_out_callback (GtkAction *action,
gpointer data);
static void close_callback (GtkAction *action,
gpointer data);
static void online_callback (GtkAction *action,
......@@ -419,6 +423,14 @@ ui_manager_new (GtkWidget *window)
NULL, NULL, N_("Go to the index page"),
G_CALLBACK (index_callback) },
{ "zoom-in", GTK_STOCK_ZOOM_IN,
NULL, NULL, NULL,
G_CALLBACK (zoom_in_callback) },
{ "zoom-out", GTK_STOCK_ZOOM_OUT,
NULL, NULL, NULL,
G_CALLBACK (zoom_out_callback) },
{ "close", GTK_STOCK_CLOSE,
NULL, "<control>W", NULL,
G_CALLBACK (close_callback) },
......@@ -437,6 +449,7 @@ ui_manager_new (GtkWidget *window)
gtk_action_group_add_actions (group, actions, G_N_ELEMENTS (actions), NULL);
action = gimp_throbber_action_new ("online",
"docs.gimp.org",
_("Visit the GIMP documentation website"),
GIMP_STOCK_WILBER);
g_signal_connect_closure (action, "activate",
......@@ -476,6 +489,9 @@ ui_manager_new (GtkWidget *window)
" <popup name=\"help-browser-popup\">"
" <menuitem action=\"back\" />"
" <menuitem action=\"forward\" />"
" <separator />"
" <menuitem action=\"zoom-in\" />"
" <menuitem action=\"zoom-out\" />"
" </popup>"
"</ui>",
-1, &error);
......@@ -555,6 +571,20 @@ index_callback (GtkAction *action,
browser_dialog_load ("index.html", TRUE);
}
static void
zoom_in_callback (GtkAction *action,
gpointer data)
{
html_view_zoom_in (HTML_VIEW (html));
}
static void
zoom_out_callback (GtkAction *action,
gpointer data)
{
html_view_zoom_out (HTML_VIEW (html));
}
static void
online_callback (GtkAction *action,
gpointer data)
......
......@@ -83,21 +83,25 @@ static void
gimp_throbber_action_connect_proxy (GtkAction *action,
GtkWidget *proxy)
{
GParamSpec *pspec;
GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy);
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (action),
"stock-id");
if (GIMP_IS_THROBBER (proxy))
{
GParamSpec *pspec;
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (action),
"stock-id");
gimp_throbber_action_sync_property (action, pspec, proxy);
g_signal_connect_object (action, "notify::stock-id",
G_CALLBACK (gimp_throbber_action_sync_property),
proxy, 0);
gimp_throbber_action_sync_property (action, pspec, proxy);
g_signal_connect_object (action, "notify::stock-id",
G_CALLBACK (gimp_throbber_action_sync_property),
proxy, 0);
g_signal_connect_object (proxy, "clicked",
G_CALLBACK (gtk_action_activate), action,
G_CONNECT_SWAPPED);
g_signal_connect_object (proxy, "clicked",
G_CALLBACK (gtk_action_activate), action,
G_CONNECT_SWAPPED);
}
}
static void
......@@ -117,11 +121,13 @@ gimp_throbber_action_sync_property (GtkAction *action,
GtkAction *
gimp_throbber_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
const gchar *stock_id)
{
return g_object_new (GIMP_TYPE_THROBBER_ACTION,
"name", name,
"label", label,
"tooltip", tooltip,
"stock-id", stock_id,
NULL);
......
......@@ -40,6 +40,7 @@ typedef GtkActionClass GimpThrobberActionClass;
GType gimp_throbber_action_get_type (void) G_GNUC_CONST;
GtkAction * gimp_throbber_action_new (const gchar *name,
const gchar *label,
const gchar *tooltip,
const gchar *stock_id);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment