handle allocation > requisition for the gradient preview.
2004-10-04 Sven Neumann <sven@gimp.org> * libgimp/gimpgradientmenu.c: handle allocation > requisition for the gradient preview. * plug-ins/script-fu/script-fu-interface.c: added a horizontal size group for the left-aligned controls.
This commit is contained in:

committed by
Sven Neumann

parent
ae14240862
commit
224633fef3
@ -1,3 +1,11 @@
|
|||||||
|
2004-10-04 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimp/gimpgradientmenu.c: handle allocation > requisition for
|
||||||
|
the gradient preview.
|
||||||
|
|
||||||
|
* plug-ins/script-fu/script-fu-interface.c: added a horizontal
|
||||||
|
size group for the left-aligned controls.
|
||||||
|
|
||||||
2004-10-03 DindinX <dindinx@gimp.org>
|
2004-10-03 DindinX <dindinx@gimp.org>
|
||||||
|
|
||||||
* plug-ins/common/destripe.c: ported to GimpAspectPreview.
|
* plug-ins/common/destripe.c: ported to GimpAspectPreview.
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
#define RESPONSE_ABOUT 2
|
#define RESPONSE_ABOUT 2
|
||||||
|
|
||||||
#define TEXT_WIDTH 100
|
#define TEXT_WIDTH 100
|
||||||
#define COLOR_SAMPLE_WIDTH 100
|
|
||||||
#define COLOR_SAMPLE_HEIGHT 15
|
#define COLOR_SAMPLE_HEIGHT 15
|
||||||
#define SLIDER_WIDTH 80
|
#define SLIDER_WIDTH 80
|
||||||
|
|
||||||
@ -153,16 +152,16 @@ script_fu_interface_report_cc (gchar *command)
|
|||||||
void
|
void
|
||||||
script_fu_interface (SFScript *script)
|
script_fu_interface (SFScript *script)
|
||||||
{
|
{
|
||||||
GtkWidget *dlg;
|
GtkWidget *dlg;
|
||||||
GtkWidget *frame;
|
GtkWidget *frame;
|
||||||
GtkWidget *menu;
|
GtkWidget *menu;
|
||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *vbox2;
|
GtkWidget *vbox2;
|
||||||
GSList *list;
|
GtkSizeGroup *group;
|
||||||
gchar *title;
|
GSList *list;
|
||||||
gchar *buf;
|
gchar *title;
|
||||||
gint start_args;
|
gchar *buf;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
static gboolean gtk_initted = FALSE;
|
static gboolean gtk_initted = FALSE;
|
||||||
|
|
||||||
@ -248,16 +247,18 @@ script_fu_interface (SFScript *script)
|
|||||||
gtk_container_add (GTK_CONTAINER (frame), sf_interface->args_table);
|
gtk_container_add (GTK_CONTAINER (frame), sf_interface->args_table);
|
||||||
gtk_widget_show (sf_interface->args_table);
|
gtk_widget_show (sf_interface->args_table);
|
||||||
|
|
||||||
start_args = (script->image_based) ? 2 : 0;
|
group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||||
|
|
||||||
for (i = start_args; i < script->num_args; i++)
|
i = (script->image_based) ? 2 : 0;
|
||||||
|
|
||||||
|
for ( ; i < script->num_args; i++)
|
||||||
{
|
{
|
||||||
GtkWidget *widget = NULL;
|
GtkWidget *widget = NULL;
|
||||||
gchar *label_text;
|
gchar *label_text;
|
||||||
gfloat label_yalign = 0.5;
|
gfloat label_yalign = 0.5;
|
||||||
gboolean leftalign = FALSE;
|
|
||||||
gint *ID_ptr = NULL;
|
gint *ID_ptr = NULL;
|
||||||
gint row = i;
|
gint row = i;
|
||||||
|
gboolean left_align = FALSE;
|
||||||
|
|
||||||
if (script->image_based)
|
if (script->image_based)
|
||||||
row -= 2;
|
row -= 2;
|
||||||
@ -308,8 +309,9 @@ script_fu_interface (SFScript *script)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SF_COLOR:
|
case SF_COLOR:
|
||||||
|
left_align = TRUE;
|
||||||
widget = gimp_color_button_new (_("Script-Fu Color Selection"),
|
widget = gimp_color_button_new (_("Script-Fu Color Selection"),
|
||||||
COLOR_SAMPLE_WIDTH,
|
-1,
|
||||||
COLOR_SAMPLE_HEIGHT,
|
COLOR_SAMPLE_HEIGHT,
|
||||||
&script->arg_values[i].sfa_color,
|
&script->arg_values[i].sfa_color,
|
||||||
GIMP_COLOR_AREA_FLAT);
|
GIMP_COLOR_AREA_FLAT);
|
||||||
@ -389,7 +391,7 @@ script_fu_interface (SFScript *script)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SF_SPINNER:
|
case SF_SPINNER:
|
||||||
leftalign = TRUE;
|
left_align = TRUE;
|
||||||
script->arg_values[i].sfa_adjustment.adj = (GtkAdjustment *)
|
script->arg_values[i].sfa_adjustment.adj = (GtkAdjustment *)
|
||||||
gtk_adjustment_new (script->arg_values[i].sfa_adjustment.value,
|
gtk_adjustment_new (script->arg_values[i].sfa_adjustment.value,
|
||||||
script->arg_defaults[i].sfa_adjustment.lower,
|
script->arg_defaults[i].sfa_adjustment.lower,
|
||||||
@ -444,14 +446,14 @@ script_fu_interface (SFScript *script)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SF_PATTERN:
|
case SF_PATTERN:
|
||||||
leftalign = TRUE;
|
left_align = TRUE;
|
||||||
widget = gimp_pattern_select_widget_new (_("Script-fu Pattern Selection"),
|
widget = gimp_pattern_select_widget_new (_("Script-fu Pattern Selection"),
|
||||||
script->arg_values[i].sfa_pattern,
|
script->arg_values[i].sfa_pattern,
|
||||||
script_fu_pattern_callback,
|
script_fu_pattern_callback,
|
||||||
&script->arg_values[i].sfa_pattern);
|
&script->arg_values[i].sfa_pattern);
|
||||||
break;
|
break;
|
||||||
case SF_GRADIENT:
|
case SF_GRADIENT:
|
||||||
leftalign = TRUE;
|
left_align = TRUE;
|
||||||
widget = gimp_gradient_select_widget_new (_("Script-Fu Gradient Selection"),
|
widget = gimp_gradient_select_widget_new (_("Script-Fu Gradient Selection"),
|
||||||
script->arg_values[i].sfa_gradient,
|
script->arg_values[i].sfa_gradient,
|
||||||
script_fu_gradient_callback,
|
script_fu_gradient_callback,
|
||||||
@ -459,7 +461,7 @@ script_fu_interface (SFScript *script)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SF_BRUSH:
|
case SF_BRUSH:
|
||||||
leftalign = TRUE;
|
left_align = TRUE;
|
||||||
widget = gimp_brush_select_widget_new (_("Script-Fu Brush Selection"),
|
widget = gimp_brush_select_widget_new (_("Script-Fu Brush Selection"),
|
||||||
script->arg_values[i].sfa_brush.name,
|
script->arg_values[i].sfa_brush.name,
|
||||||
script->arg_values[i].sfa_brush.opacity,
|
script->arg_values[i].sfa_brush.opacity,
|
||||||
@ -498,7 +500,7 @@ script_fu_interface (SFScript *script)
|
|||||||
gimp_table_attach_aligned (GTK_TABLE (sf_interface->args_table),
|
gimp_table_attach_aligned (GTK_TABLE (sf_interface->args_table),
|
||||||
0, row,
|
0, row,
|
||||||
label_text, 0.0, label_yalign,
|
label_text, 0.0, label_yalign,
|
||||||
widget, 2, leftalign);
|
widget, 2, left_align);
|
||||||
g_free (label_text);
|
g_free (label_text);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -508,11 +510,16 @@ script_fu_interface (SFScript *script)
|
|||||||
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||||
gtk_widget_show (widget);
|
gtk_widget_show (widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (left_align)
|
||||||
|
gtk_size_group_add_widget (group, widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
sf_interface->args_widgets[i] = widget;
|
sf_interface->args_widgets[i] = widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_unref (group);
|
||||||
|
|
||||||
/* the script progress frame */
|
/* the script progress frame */
|
||||||
frame = gimp_frame_new (_("Script Progress"));
|
frame = gimp_frame_new (_("Script Progress"));
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
|
||||||
|
Reference in New Issue
Block a user