Commit 7654712d authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

app/actions/view-actions.c added separate callback for "view-zoom-other"

2004-06-07  Michael Natterer  <mitch@gimp.org>

	* app/actions/view-actions.c
	* app/actions/view-commands.[ch]: added separate callback for
	"view-zoom-other" and connect GtkAction::activate manually so
	"Other..." can be selected even if it's the active item in the
	zoom radio group. Fixes bug #143850.
parent 18c7f92a
2004-06-07 Michael Natterer <mitch@gimp.org>
* app/actions/view-actions.c
* app/actions/view-commands.[ch]: added separate callback for
"view-zoom-other" and connect GtkAction::activate manually so
"Other..." can be selected even if it's the active item in the
zoom radio group. Fixes bug #143850.
2004-06-07 Sven Neumann <sven@gimp.org>
* plug-ins/common/tileit.c (tileit_dialog): fixed a typo.
......
......@@ -239,6 +239,8 @@ static GimpRadioActionEntry view_zoom_actions[] =
void
view_actions_setup (GimpActionGroup *group)
{
GtkAction *action;
gimp_action_group_add_actions (group,
view_actions,
G_N_ELEMENTS (view_actions));
......@@ -252,6 +254,15 @@ view_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (view_zoom_actions),
10000,
G_CALLBACK (view_zoom_cmd_callback));
/* connect "activate" of view-zoom-other manually so it can be
* selected even if it's the active item of the radio group
*/
action = gtk_action_group_get_action (GTK_ACTION_GROUP (group),
"view-zoom-other");
g_signal_connect (action, "activate",
G_CALLBACK (view_zoom_other_cmd_callback),
group->user_data);
}
void
......
......@@ -133,21 +133,33 @@ view_zoom_cmd_callback (GtkAction *action,
value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
if (value == 0 /* Other... */)
{
/* check if we are activated by the user
* or from view_actions_set_zoom()
*/
if (shell->scale != shell->other_scale)
gimp_display_shell_scale_dialog (shell);
}
else
if (value != 0 /* not Other... */)
{
if (fabs (value - shell->scale) > 0.0001)
gimp_display_shell_scale (shell, GIMP_ZOOM_TO, (gdouble) value / 10000);
}
}
void
view_zoom_other_cmd_callback (GtkAction *action,
gpointer data)
{
GimpDisplay *gdisp;
GimpDisplayShell *shell;
return_if_no_display (gdisp, data);
shell = GIMP_DISPLAY_SHELL (gdisp->shell);
/* check if we are activated by the user or from
* view_actions_set_zoom()
*/
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) &&
shell->scale != shell->other_scale)
{
gimp_display_shell_scale_dialog (shell);
}
}
void
view_dot_for_dot_cmd_callback (GtkAction *action,
gpointer data)
......
......@@ -34,6 +34,8 @@ void view_zoom_fit_cmd_callback (GtkAction *action,
void view_zoom_cmd_callback (GtkAction *action,
GtkAction *current,
gpointer data);
void view_zoom_other_cmd_callback (GtkAction *action,
gpointer data);
void view_dot_for_dot_cmd_callback (GtkAction *action,
gpointer data);
void view_info_window_cmd_callback (GtkAction *action,
......
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