Commit ad3efec7 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/gui/image-menu.c app/gui/palette-editor-menu.c

2003-05-28  Michael Natterer  <mitch@gimp.org>

	* app/gui/image-menu.c
	* app/gui/palette-editor-menu.c
	* app/gui/view-commands.[ch]
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimppaletteeditor.[ch]: changed all places to show
	zoom menu items and icons in ZOOM_OUT, ZOOM_IN order. In an attack
	of consistency, also reordered all callbacks accordingly.
parent 6cee716d
2003-05-28 Michael Natterer <mitch@gimp.org>
* app/gui/image-menu.c
* app/gui/palette-editor-menu.c
* app/gui/view-commands.[ch]
* app/widgets/gimpgradienteditor.c
* app/widgets/gimppaletteeditor.[ch]: changed all places to show
zoom menu items and icons in ZOOM_OUT, ZOOM_IN order. In an attack
of consistency, also reordered all callbacks accordingly.
2003-05-28 Michael Natterer <mitch@gimp.org>
* app/display/gimpnavigationview.c: don't let the navigation
_popup_ auto-resize itself and don't allocate a minimum size
bacause that makes sense for the navigation _tab_ only. Fixes
because that makes sense for the navigation _tab_ only. Fixes
popup size and positioning.
2003-05-28 Sven Neumann <sven@gimp.org>
......@@ -57,23 +57,23 @@
void
view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data)
view_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), GIMP_ZOOM_IN);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), GIMP_ZOOM_OUT);
}
void
view_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data)
view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), GIMP_ZOOM_OUT);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), GIMP_ZOOM_IN);
}
void
......
......@@ -20,10 +20,10 @@
#define __VIEW_COMMANDS_H__
void view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_fit_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_cmd_callback (GtkWidget *widget,
......
......@@ -311,16 +311,16 @@ GimpItemFactoryEntry image_menu_entries[] =
/* <Image>/View/Zoom */
{ { N_("/View/Zoom/Zoom In"), "plus",
view_zoom_in_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_IN },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/Zoom Out"), "minus",
view_zoom_out_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/Zoom In"), "plus",
view_zoom_in_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_IN },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/Zoom to Fit Window"), "<control><shift>E",
view_zoom_fit_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_FIT },
......@@ -1299,8 +1299,8 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/View/New View", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom In", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom Out", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom In", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom to Fit Window", gdisp);
SET_SENSITIVE ("/View/Zoom/16:1", gdisp);
......
......@@ -50,14 +50,14 @@ GimpItemFactoryEntry palette_editor_menu_entries[] =
{ { "/---", NULL, NULL, 0, "<Separator>", NULL }, NULL, NULL, NULL },
{ { N_("/Zoom In"), "",
palette_editor_zoom_in_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_IN },
NULL, NULL, NULL },
{ { N_("/Zoom Out"), "",
palette_editor_zoom_out_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
NULL, NULL, NULL },
{ { N_("/Zoom In"), "",
palette_editor_zoom_in_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_IN },
NULL, NULL, NULL },
{ { N_("/Zoom All"), "",
palette_editor_zoom_all_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_FIT },
......@@ -88,8 +88,8 @@ palette_editor_menu_update (GtkItemFactory *factory,
SET_SENSITIVE ("/Edit Color...", editable && editor->color);
SET_SENSITIVE ("/Delete Color", editable && editor->color);
SET_SENSITIVE ("/Zoom In", data_editor->data);
SET_SENSITIVE ("/Zoom Out", data_editor->data);
SET_SENSITIVE ("/Zoom In", data_editor->data);
SET_SENSITIVE ("/Zoom All", data_editor->data);
#undef SET_SENSITIVE
......
......@@ -57,23 +57,23 @@
void
view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data)
view_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), GIMP_ZOOM_IN);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), GIMP_ZOOM_OUT);
}
void
view_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data)
view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpDisplay *gdisp;
return_if_no_display (gdisp, data);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), GIMP_ZOOM_OUT);
gimp_display_shell_scale (GIMP_DISPLAY_SHELL (gdisp->shell), GIMP_ZOOM_IN);
}
void
......
......@@ -20,10 +20,10 @@
#define __VIEW_COMMANDS_H__
void view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_out_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_in_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_fit_cmd_callback (GtkWidget *widget,
gpointer data);
void view_zoom_cmd_callback (GtkWidget *widget,
......
......@@ -311,16 +311,16 @@ GimpItemFactoryEntry image_menu_entries[] =
/* <Image>/View/Zoom */
{ { N_("/View/Zoom/Zoom In"), "plus",
view_zoom_in_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_IN },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/Zoom Out"), "minus",
view_zoom_out_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_OUT },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/Zoom In"), "plus",
view_zoom_in_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_IN },
NULL,
"view/zoom.html", NULL },
{ { N_("/View/Zoom/Zoom to Fit Window"), "<control><shift>E",
view_zoom_fit_cmd_callback, 0,
"<StockItem>", GTK_STOCK_ZOOM_FIT },
......@@ -1299,8 +1299,8 @@ image_menu_update (GtkItemFactory *item_factory,
SET_SENSITIVE ("/View/New View", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom In", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom Out", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom In", gdisp);
SET_SENSITIVE ("/View/Zoom/Zoom to Fit Window", gdisp);
SET_SENSITIVE ("/View/Zoom/16:1", gdisp);
......
......@@ -119,12 +119,12 @@ static void gradient_editor_drop_gradient (GtkWidget *widget,
gpointer data);
static void gradient_editor_scrollbar_update (GtkAdjustment *adj,
GimpGradientEditor *editor);
static void gradient_editor_zoom_all_callback (GtkWidget *widget,
GimpGradientEditor *editor);
static void gradient_editor_zoom_out_callback (GtkWidget *widget,
GimpGradientEditor *editor);
static void gradient_editor_zoom_in_callback (GtkWidget *widget,
GimpGradientEditor *editor);
static void gradient_editor_zoom_all_callback (GtkWidget *widget,
GimpGradientEditor *editor);
static void gradient_editor_instant_update_update (GtkWidget *widget,
GimpGradientEditor *editor);
......@@ -365,23 +365,21 @@ gimp_gradient_editor_init (GimpGradientEditor *editor)
/* +, - and Zoom Fit buttons */
gimp_editor_add_button (GIMP_EDITOR (editor),
GTK_STOCK_ZOOM_FIT,
_("Zoom All"), NULL,
G_CALLBACK (gradient_editor_zoom_all_callback),
GTK_STOCK_ZOOM_OUT,
_("Zoom Out"), NULL,
G_CALLBACK (gradient_editor_zoom_out_callback),
NULL,
editor);
gimp_editor_add_button (GIMP_EDITOR (editor),
GTK_STOCK_ZOOM_IN,
_("Zoom In"), NULL,
G_CALLBACK (gradient_editor_zoom_in_callback),
NULL,
editor);
gimp_editor_add_button (GIMP_EDITOR (editor),
GTK_STOCK_ZOOM_OUT,
_("Zoom Out"), NULL,
G_CALLBACK (gradient_editor_zoom_out_callback),
GTK_STOCK_ZOOM_FIT,
_("Zoom All"), NULL,
G_CALLBACK (gradient_editor_zoom_all_callback),
NULL,
editor);
......@@ -538,24 +536,6 @@ gradient_editor_scrollbar_update (GtkAdjustment *adjustment,
gimp_gradient_editor_update (editor);
}
static void
gradient_editor_zoom_all_callback (GtkWidget *widget,
GimpGradientEditor *editor)
{
GtkAdjustment *adjustment;
adjustment = GTK_ADJUSTMENT (editor->scroll_data);
editor->zoom_factor = 1;
adjustment->value = 0.0;
adjustment->page_size = 1.0;
adjustment->step_increment = GRAD_SCROLLBAR_STEP_SIZE;
adjustment->page_increment = GRAD_SCROLLBAR_PAGE_SIZE;
gtk_adjustment_changed (GTK_ADJUSTMENT (editor->scroll_data));
}
static void
gradient_editor_zoom_out_callback (GtkWidget *widget,
GimpGradientEditor *editor)
......@@ -618,6 +598,24 @@ gradient_editor_zoom_in_callback (GtkWidget *widget,
gtk_adjustment_changed (GTK_ADJUSTMENT (editor->scroll_data));
}
static void
gradient_editor_zoom_all_callback (GtkWidget *widget,
GimpGradientEditor *editor)
{
GtkAdjustment *adjustment;
adjustment = GTK_ADJUSTMENT (editor->scroll_data);
editor->zoom_factor = 1;
adjustment->value = 0.0;
adjustment->page_size = 1.0;
adjustment->step_increment = GRAD_SCROLLBAR_STEP_SIZE;
adjustment->page_increment = GRAD_SCROLLBAR_PAGE_SIZE;
gtk_adjustment_changed (GTK_ADJUSTMENT (editor->scroll_data));
}
static void
gradient_editor_instant_update_update (GtkWidget *widget,
GimpGradientEditor *editor)
......
......@@ -99,10 +99,10 @@ static void palette_editor_edit_clicked (GtkWidget *widget,
GimpPaletteEditor *editor);
static void palette_editor_delete_clicked (GtkWidget *widget,
GimpPaletteEditor *editor);
static void palette_editor_zoom_in_clicked (GtkWidget *widget,
GimpPaletteEditor *editor);
static void palette_editor_zoom_out_clicked (GtkWidget *widget,
GimpPaletteEditor *editor);
static void palette_editor_zoom_in_clicked (GtkWidget *widget,
GimpPaletteEditor *editor);
static void palette_editor_zoom_all_clicked (GtkWidget *widget,
GimpPaletteEditor *editor);
static void palette_editor_redraw_zoom (GimpPaletteEditor *editor);
......@@ -298,14 +298,6 @@ gimp_palette_editor_init (GimpPaletteEditor *editor)
NULL,
editor);
editor->zoom_in_button =
gimp_editor_add_button (GIMP_EDITOR (editor),
GTK_STOCK_ZOOM_IN,
_("Zoom In"), NULL,
G_CALLBACK (palette_editor_zoom_in_clicked),
NULL,
editor);
editor->zoom_out_button =
gimp_editor_add_button (GIMP_EDITOR (editor),
GTK_STOCK_ZOOM_OUT,
......@@ -314,6 +306,14 @@ gimp_palette_editor_init (GimpPaletteEditor *editor)
NULL,
editor);
editor->zoom_in_button =
gimp_editor_add_button (GIMP_EDITOR (editor),
GTK_STOCK_ZOOM_IN,
_("Zoom In"), NULL,
G_CALLBACK (palette_editor_zoom_in_clicked),
NULL,
editor);
editor->zoom_all_button =
gimp_editor_add_button (GIMP_EDITOR (editor),
GTK_STOCK_ZOOM_FIT,
......@@ -413,10 +413,10 @@ gimp_palette_editor_set_data (GimpDataEditor *editor,
gtk_widget_set_sensitive (palette_editor->edit_button, FALSE);
gtk_widget_set_sensitive (palette_editor->delete_button, FALSE);
gtk_widget_set_sensitive (palette_editor->zoom_in_button,
editor->data != NULL);
gtk_widget_set_sensitive (palette_editor->zoom_out_button,
editor->data != NULL);
gtk_widget_set_sensitive (palette_editor->zoom_in_button,
editor->data != NULL);
gtk_widget_set_sensitive (palette_editor->zoom_all_button,
editor->data != NULL);
}
......@@ -1057,19 +1057,19 @@ palette_editor_delete_clicked (GtkWidget *widget,
}
static void
palette_editor_zoom_in_clicked (GtkWidget *widget,
GimpPaletteEditor *editor)
palette_editor_zoom_out_clicked (GtkWidget *widget,
GimpPaletteEditor *editor)
{
editor->zoom_factor += 0.1;
editor->zoom_factor -= 0.1;
palette_editor_redraw_zoom (editor);
}
static void
palette_editor_zoom_out_clicked (GtkWidget *widget,
GimpPaletteEditor *editor)
palette_editor_zoom_in_clicked (GtkWidget *widget,
GimpPaletteEditor *editor)
{
editor->zoom_factor -= 0.1;
editor->zoom_factor += 0.1;
palette_editor_redraw_zoom (editor);
}
......
......@@ -56,8 +56,8 @@ struct _GimpPaletteEditor
GtkWidget *new_button;
GtkWidget *edit_button;
GtkWidget *delete_button;
GtkWidget *zoom_in_button;
GtkWidget *zoom_out_button;
GtkWidget *zoom_in_button;
GtkWidget *zoom_all_button;
ColorNotebook *color_notebook;
......
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