tools/shooter.c tweaked spacings.
2005-04-23 Sven Neumann <sven@gimp.org> * tools/shooter.c * tools/widgets.c: tweaked spacings.
This commit is contained in:

committed by
Sven Neumann

parent
7bb7945506
commit
25b28a10a2
@ -1,3 +1,8 @@
|
|||||||
|
2005-04-23 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* tools/shooter.c
|
||||||
|
* tools/widgets.c: tweaked spacings.
|
||||||
|
|
||||||
2005-04-20 DindinX <dindinx@gimp.org>
|
2005-04-20 DindinX <dindinx@gimp.org>
|
||||||
|
|
||||||
* tools/widgets.c: added all but the GimpPixmap widget.
|
* tools/widgets.c: added all but the GimpPixmap widget.
|
||||||
|
@ -91,18 +91,24 @@ remove_shaped_area (GdkPixbuf *pixbuf,
|
|||||||
{
|
{
|
||||||
int y, x;
|
int y, x;
|
||||||
|
|
||||||
for (y = rectangles[i].y; y < rectangles[i].y + rectangles[i].height; y++)
|
for (y = rectangles[i].y;
|
||||||
|
y < rectangles[i].y + rectangles[i].height;
|
||||||
|
y++)
|
||||||
{
|
{
|
||||||
guchar *src_pixels, *dest_pixels;
|
const guchar *src_pixels;
|
||||||
|
guchar *dest_pixels;
|
||||||
|
|
||||||
src_pixels = gdk_pixbuf_get_pixels (pixbuf) +
|
src_pixels = gdk_pixbuf_get_pixels (pixbuf) +
|
||||||
y * gdk_pixbuf_get_rowstride (pixbuf) +
|
y * gdk_pixbuf_get_rowstride (pixbuf) +
|
||||||
rectangles[i].x * (gdk_pixbuf_get_has_alpha (pixbuf) ? 4 : 3);
|
rectangles[i].x * (gdk_pixbuf_get_has_alpha (pixbuf) ? 4 : 3);
|
||||||
|
|
||||||
dest_pixels = gdk_pixbuf_get_pixels (retval) +
|
dest_pixels = gdk_pixbuf_get_pixels (retval) +
|
||||||
y * gdk_pixbuf_get_rowstride (retval) +
|
y * gdk_pixbuf_get_rowstride (retval) +
|
||||||
rectangles[i].x * 4;
|
rectangles[i].x * 4;
|
||||||
|
|
||||||
for (x = rectangles[i].x; x < rectangles[i].x + rectangles[i].width; x++)
|
for (x = rectangles[i].x;
|
||||||
|
x < rectangles[i].x + rectangles[i].width;
|
||||||
|
x++)
|
||||||
{
|
{
|
||||||
*dest_pixels++ = *src_pixels ++;
|
*dest_pixels++ = *src_pixels ++;
|
||||||
*dest_pixels++ = *src_pixels ++;
|
*dest_pixels++ = *src_pixels ++;
|
||||||
|
@ -36,8 +36,7 @@ adjust_size_callback (WidgetInfo *info)
|
|||||||
guint target_height = 0;
|
guint target_height = 0;
|
||||||
|
|
||||||
toplevel = GDK_WINDOW_XWINDOW (info->window->window);
|
toplevel = GDK_WINDOW_XWINDOW (info->window->window);
|
||||||
XGetGeometry (GDK_WINDOW_XDISPLAY (info->window->window),
|
XGetGeometry (GDK_WINDOW_XDISPLAY (info->window->window), toplevel,
|
||||||
toplevel,
|
|
||||||
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
|
&root, &tx, &ty, &twidth, &theight, &tborder_width, &tdepth);
|
||||||
|
|
||||||
switch (info->size)
|
switch (info->size)
|
||||||
@ -84,39 +83,42 @@ new_widget_info (const char *name,
|
|||||||
WidgetInfo *info;
|
WidgetInfo *info;
|
||||||
|
|
||||||
info = g_new0 (WidgetInfo, 1);
|
info = g_new0 (WidgetInfo, 1);
|
||||||
|
|
||||||
info->name = g_strdup (name);
|
info->name = g_strdup (name);
|
||||||
info->size = size;
|
info->size = size;
|
||||||
|
info->no_focus = TRUE;
|
||||||
|
|
||||||
|
|
||||||
if (GTK_IS_WINDOW (widget))
|
if (GTK_IS_WINDOW (widget))
|
||||||
{
|
{
|
||||||
info->window = widget;
|
info->window = widget;
|
||||||
|
|
||||||
gtk_window_set_resizable (GTK_WINDOW (info->window), FALSE);
|
gtk_window_set_resizable (GTK_WINDOW (info->window), FALSE);
|
||||||
info->include_decorations = FALSE;
|
|
||||||
g_signal_connect_swapped (info->window, "realize",
|
g_signal_connect_swapped (info->window, "realize",
|
||||||
G_CALLBACK (realize_callback), info);
|
G_CALLBACK (realize_callback), info);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
info->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
info->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||||
info->include_decorations = FALSE;
|
|
||||||
gtk_widget_show_all (widget);
|
gtk_container_set_border_width (GTK_CONTAINER (info->window), 12);
|
||||||
gtk_container_add (GTK_CONTAINER (info->window), widget);
|
gtk_container_add (GTK_CONTAINER (info->window), widget);
|
||||||
|
gtk_widget_show_all (widget);
|
||||||
}
|
}
|
||||||
info->no_focus = TRUE;
|
|
||||||
|
|
||||||
gtk_widget_set_app_paintable (info->window, TRUE);
|
gtk_widget_set_app_paintable (info->window, TRUE);
|
||||||
g_signal_connect (info->window, "focus", G_CALLBACK (gtk_true), NULL);
|
g_signal_connect (info->window, "focus", G_CALLBACK (gtk_true), NULL);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (info->window), 12);
|
|
||||||
|
|
||||||
switch (size)
|
switch (size)
|
||||||
{
|
{
|
||||||
case SMALL:
|
case SMALL:
|
||||||
gtk_widget_set_size_request (info->window, 240, 75);
|
gtk_widget_set_size_request (info->window, SMALL_WIDTH, SMALL_HEIGHT);
|
||||||
break;
|
break;
|
||||||
case MEDIUM:
|
case MEDIUM:
|
||||||
gtk_widget_set_size_request (info->window, 240, 165);
|
gtk_widget_set_size_request (info->window, MEDIUM_WIDTH, MEDIUM_HEIGHT);
|
||||||
break;
|
break;
|
||||||
case LARGE:
|
case LARGE:
|
||||||
gtk_widget_set_size_request (info->window, 240, 240);
|
gtk_widget_set_size_request (info->window, LARGE_WIDTH, LARGE_HEIGHT);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -157,10 +159,12 @@ create_chain_button (void)
|
|||||||
GtkWidget *chain;
|
GtkWidget *chain;
|
||||||
GtkWidget *separator;
|
GtkWidget *separator;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.8);
|
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.8);
|
||||||
gtk_box_pack_start_defaults (GTK_BOX (vbox), align);
|
gtk_box_pack_start_defaults (GTK_BOX (vbox), align);
|
||||||
table = gtk_table_new (2, 5, FALSE);
|
table = gtk_table_new (2, 5, FALSE);
|
||||||
|
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
||||||
|
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
||||||
gtk_container_add (GTK_CONTAINER (align), table);
|
gtk_container_add (GTK_CONTAINER (align), table);
|
||||||
chain = gimp_chain_button_new (GIMP_CHAIN_LEFT);
|
chain = gimp_chain_button_new (GIMP_CHAIN_LEFT);
|
||||||
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain), TRUE);
|
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain), TRUE);
|
||||||
@ -187,7 +191,7 @@ create_chain_button (void)
|
|||||||
GTK_SHRINK | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
GTK_SHRINK | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||||
|
|
||||||
gtk_box_pack_end_defaults (GTK_BOX (vbox), gtk_label_new ("Chain Button"));
|
gtk_box_pack_end_defaults (GTK_BOX (vbox), gtk_label_new ("Chain Button"));
|
||||||
return new_widget_info ("gimp-chain-button", vbox, SMALL);
|
return new_widget_info ("gimp-chain-button", vbox, MEDIUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WidgetInfo *
|
static WidgetInfo *
|
||||||
@ -200,11 +204,9 @@ create_color_area (void)
|
|||||||
|
|
||||||
color_init (&color);
|
color_init (&color);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
||||||
area = gimp_color_area_new (&color,
|
area = gimp_color_area_new (&color, GIMP_COLOR_AREA_SMALL_CHECKS, 0);
|
||||||
GIMP_COLOR_AREA_SMALL_CHECKS,
|
|
||||||
GDK_SHIFT_MASK);
|
|
||||||
gimp_color_area_set_draw_border (GIMP_COLOR_AREA (area), TRUE);
|
gimp_color_area_set_draw_border (GIMP_COLOR_AREA (area), TRUE);
|
||||||
gtk_widget_set_size_request (area, -1, 25);
|
gtk_widget_set_size_request (area, -1, 25);
|
||||||
gtk_container_add (GTK_CONTAINER (align), area);
|
gtk_container_add (GTK_CONTAINER (align), area);
|
||||||
@ -226,7 +228,7 @@ create_color_button (void)
|
|||||||
|
|
||||||
color_init (&color);
|
color_init (&color);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
||||||
button = gimp_color_button_new ("Color Button",
|
button = gimp_color_button_new ("Color Button",
|
||||||
80, 20, &color,
|
80, 20, &color,
|
||||||
@ -250,7 +252,7 @@ create_color_hex_entry (void)
|
|||||||
|
|
||||||
color_init (&color);
|
color_init (&color);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
||||||
entry = gimp_color_hex_entry_new ();
|
entry = gimp_color_hex_entry_new ();
|
||||||
gimp_color_hex_entry_set_color (GIMP_COLOR_HEX_ENTRY (entry), &color);
|
gimp_color_hex_entry_set_color (GIMP_COLOR_HEX_ENTRY (entry), &color);
|
||||||
@ -275,7 +277,7 @@ create_color_scale (void)
|
|||||||
color_init (&rgb);
|
color_init (&rgb);
|
||||||
gimp_rgb_to_hsv (&rgb, &hsv);
|
gimp_rgb_to_hsv (&rgb, &hsv);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.8, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.8, 0.0);
|
||||||
scale = gimp_color_scale_new (GTK_ORIENTATION_HORIZONTAL,
|
scale = gimp_color_scale_new (GTK_ORIENTATION_HORIZONTAL,
|
||||||
GIMP_COLOR_SELECTOR_HUE);
|
GIMP_COLOR_SELECTOR_HUE);
|
||||||
@ -300,13 +302,11 @@ create_color_selection (void)
|
|||||||
|
|
||||||
color_init (&color);
|
color_init (&color);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||||
selection = gimp_color_selection_new ();
|
selection = gimp_color_selection_new ();
|
||||||
gimp_color_selection_set_show_alpha(GIMP_COLOR_SELECTION (selection),
|
gimp_color_selection_set_show_alpha(GIMP_COLOR_SELECTION (selection), TRUE);
|
||||||
TRUE);
|
gimp_color_selection_set_color (GIMP_COLOR_SELECTION (selection), &color);
|
||||||
gimp_color_selection_set_color (GIMP_COLOR_SELECTION (selection),
|
|
||||||
&color);
|
|
||||||
gtk_widget_set_size_request (selection, 400, -1);
|
gtk_widget_set_size_request (selection, 400, -1);
|
||||||
gtk_container_add (GTK_CONTAINER (align), selection);
|
gtk_container_add (GTK_CONTAINER (align), selection);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
||||||
@ -348,11 +348,10 @@ create_enum_combo_box (void)
|
|||||||
GtkWidget *combo;
|
GtkWidget *combo;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
||||||
combo = gimp_enum_combo_box_new (GIMP_TYPE_CHANNEL_TYPE);
|
combo = gimp_enum_combo_box_new (GIMP_TYPE_CHANNEL_TYPE);
|
||||||
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo),
|
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), GIMP_BLUE_CHANNEL);
|
||||||
GIMP_BLUE_CHANNEL);
|
|
||||||
gtk_container_add (GTK_CONTAINER (align), combo);
|
gtk_container_add (GTK_CONTAINER (align), combo);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox),
|
gtk_box_pack_start (GTK_BOX (vbox),
|
||||||
@ -369,7 +368,7 @@ create_file_entry (void)
|
|||||||
GtkWidget *entry;
|
GtkWidget *entry;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
||||||
entry = gimp_file_entry_new ("File Entry",
|
entry = gimp_file_entry_new ("File Entry",
|
||||||
"wilber.png",
|
"wilber.png",
|
||||||
@ -404,7 +403,7 @@ create_int_combo_box (void)
|
|||||||
GtkWidget *combo;
|
GtkWidget *combo;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
||||||
combo = gimp_int_combo_box_new ("Sobel", 1,
|
combo = gimp_int_combo_box_new ("Sobel", 1,
|
||||||
"Prewitt", 2,
|
"Prewitt", 2,
|
||||||
@ -431,7 +430,7 @@ create_memsize_entry (void)
|
|||||||
GtkWidget *entry;
|
GtkWidget *entry;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||||
entry = gimp_memsize_entry_new ((3 * 1024 + 512) * 1024,
|
entry = gimp_memsize_entry_new ((3 * 1024 + 512) * 1024,
|
||||||
0, 1024 * 1024 * 1024);
|
0, 1024 * 1024 * 1024);
|
||||||
@ -452,7 +451,7 @@ create_offset_area (void)
|
|||||||
GtkWidget *area;
|
GtkWidget *area;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||||
frame = gtk_frame_new (NULL);
|
frame = gtk_frame_new (NULL);
|
||||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||||
@ -478,7 +477,7 @@ create_path_editor (void)
|
|||||||
gchar *config = gimp_config_build_data_path ("patterns");
|
gchar *config = gimp_config_build_data_path ("patterns");
|
||||||
gchar *path = gimp_config_path_expand (config, TRUE, NULL);
|
gchar *path = gimp_config_path_expand (config, TRUE, NULL);
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||||
editor = gimp_path_editor_new ("Path Editor", path);
|
editor = gimp_path_editor_new ("Path Editor", path);
|
||||||
gtk_widget_set_size_request (editor, -1, 240);
|
gtk_widget_set_size_request (editor, -1, 240);
|
||||||
@ -501,7 +500,7 @@ create_pick_button (void)
|
|||||||
GtkWidget *button;
|
GtkWidget *button;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 1.0);
|
||||||
button = gimp_pick_button_new ();
|
button = gimp_pick_button_new ();
|
||||||
gtk_container_add (GTK_CONTAINER (align), button);
|
gtk_container_add (GTK_CONTAINER (align), button);
|
||||||
@ -539,7 +538,7 @@ create_preview_area (void)
|
|||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||||
area = gimp_preview_area_new ();
|
area = gimp_preview_area_new ();
|
||||||
g_signal_connect (area, "realize",
|
g_signal_connect (area, "realize",
|
||||||
@ -566,7 +565,7 @@ create_unit_menu (void)
|
|||||||
GtkWidget *menu;
|
GtkWidget *menu;
|
||||||
GtkWidget *align;
|
GtkWidget *align;
|
||||||
|
|
||||||
vbox = gtk_vbox_new (FALSE, 3);
|
vbox = gtk_vbox_new (FALSE, 6);
|
||||||
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
align = gtk_alignment_new (0.5, 0.5, 0.5, 0.0);
|
||||||
menu = gimp_unit_menu_new ("%a - %y (%f\"", GIMP_UNIT_POINT,
|
menu = gimp_unit_menu_new ("%a - %y (%f\"", GIMP_UNIT_POINT,
|
||||||
TRUE, TRUE, TRUE);
|
TRUE, TRUE, TRUE);
|
||||||
|
Reference in New Issue
Block a user