app: remove enum GimpTransformGridType
and use the two new values from GimpGuidesType instead.
This commit is contained in:
@ -129,8 +129,8 @@ gimp_transform_options_class_init (GimpTransformOptionsClass *klass)
|
|||||||
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_GRID_TYPE,
|
GIMP_CONFIG_INSTALL_PROP_ENUM (object_class, PROP_GRID_TYPE,
|
||||||
"grid-type",
|
"grid-type",
|
||||||
N_("How to define grid settings"),
|
N_("How to define grid settings"),
|
||||||
GIMP_TYPE_TRANSFORM_GRID_TYPE,
|
GIMP_TYPE_GUIDES_TYPE,
|
||||||
GIMP_TRANSFORM_GRID_TYPE_N_LINES,
|
GIMP_GUIDES_N_LINES,
|
||||||
GIMP_PARAM_STATIC_STRINGS);
|
GIMP_PARAM_STATIC_STRINGS);
|
||||||
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_GRID_SIZE,
|
GIMP_CONFIG_INSTALL_PROP_INT (object_class, PROP_GRID_SIZE,
|
||||||
"grid-size",
|
"grid-size",
|
||||||
@ -334,7 +334,9 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
|
|||||||
gimp_transform_options_preview_opacity_notify (options, NULL, scale);
|
gimp_transform_options_preview_opacity_notify (options, NULL, scale);
|
||||||
|
|
||||||
/* the grid type menu */
|
/* the grid type menu */
|
||||||
combo = gimp_prop_enum_combo_box_new (config, "grid-type", 0, 0);
|
combo = gimp_prop_enum_combo_box_new (config, "grid-type",
|
||||||
|
GIMP_GUIDES_N_LINES,
|
||||||
|
GIMP_GUIDES_SPACING);
|
||||||
gtk_box_pack_start (GTK_BOX (preview_box), combo, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (preview_box), combo, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (combo);
|
gtk_widget_show (combo);
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ struct _GimpTransformOptions
|
|||||||
gboolean clip;
|
gboolean clip;
|
||||||
GimpTransformPreviewType preview_type;
|
GimpTransformPreviewType preview_type;
|
||||||
gdouble preview_opacity;
|
gdouble preview_opacity;
|
||||||
GimpTransformGridType grid_type;
|
GimpGuidesType grid_type;
|
||||||
gint grid_size;
|
gint grid_size;
|
||||||
gboolean constrain;
|
gboolean constrain;
|
||||||
};
|
};
|
||||||
|
@ -1350,8 +1350,8 @@ gimp_transform_tool_grid_recalc (GimpTransformTool *tr_tool)
|
|||||||
|
|
||||||
switch (options->grid_type)
|
switch (options->grid_type)
|
||||||
{
|
{
|
||||||
case GIMP_TRANSFORM_GRID_TYPE_N_LINES:
|
case GIMP_GUIDES_N_LINES:
|
||||||
case GIMP_TRANSFORM_GRID_TYPE_SPACING:
|
case GIMP_GUIDES_SPACING:
|
||||||
{
|
{
|
||||||
gint i, gci;
|
gint i, gci;
|
||||||
gdouble *coords;
|
gdouble *coords;
|
||||||
@ -1360,7 +1360,7 @@ gimp_transform_tool_grid_recalc (GimpTransformTool *tr_tool)
|
|||||||
width = MAX (1, tr_tool->x2 - tr_tool->x1);
|
width = MAX (1, tr_tool->x2 - tr_tool->x1);
|
||||||
height = MAX (1, tr_tool->y2 - tr_tool->y1);
|
height = MAX (1, tr_tool->y2 - tr_tool->y1);
|
||||||
|
|
||||||
if (options->grid_type == GIMP_TRANSFORM_GRID_TYPE_N_LINES)
|
if (options->grid_type == GIMP_GUIDES_N_LINES)
|
||||||
{
|
{
|
||||||
if (width <= height)
|
if (width <= height)
|
||||||
{
|
{
|
||||||
@ -1373,7 +1373,7 @@ gimp_transform_tool_grid_recalc (GimpTransformTool *tr_tool)
|
|||||||
tr_tool->ngx = tr_tool->ngy * MAX (1, width / height);
|
tr_tool->ngx = tr_tool->ngy * MAX (1, width / height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else /* GIMP_TRANSFORM_GRID_TYPE_SPACING */
|
else /* GIMP_GUIDES_SPACING */
|
||||||
{
|
{
|
||||||
gint grid_size = MAX (2, options->grid_size);
|
gint grid_size = MAX (2, options->grid_size);
|
||||||
|
|
||||||
|
@ -261,35 +261,6 @@ gimp_transform_preview_type_get_type (void)
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
GType
|
|
||||||
gimp_transform_grid_type_get_type (void)
|
|
||||||
{
|
|
||||||
static const GEnumValue values[] =
|
|
||||||
{
|
|
||||||
{ GIMP_TRANSFORM_GRID_TYPE_N_LINES, "GIMP_TRANSFORM_GRID_TYPE_N_LINES", "n-lines" },
|
|
||||||
{ GIMP_TRANSFORM_GRID_TYPE_SPACING, "GIMP_TRANSFORM_GRID_TYPE_SPACING", "spacing" },
|
|
||||||
{ 0, NULL, NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
static const GimpEnumDesc descs[] =
|
|
||||||
{
|
|
||||||
{ GIMP_TRANSFORM_GRID_TYPE_N_LINES, NC_("transform-grid-type", "Number of grid lines"), NULL },
|
|
||||||
{ GIMP_TRANSFORM_GRID_TYPE_SPACING, NC_("transform-grid-type", "Grid line spacing"), NULL },
|
|
||||||
{ 0, NULL, NULL }
|
|
||||||
};
|
|
||||||
|
|
||||||
static GType type = 0;
|
|
||||||
|
|
||||||
if (G_UNLIKELY (! type))
|
|
||||||
{
|
|
||||||
type = g_enum_register_static ("GimpTransformGridType", values);
|
|
||||||
gimp_type_set_translation_context (type, "transform-grid-type");
|
|
||||||
gimp_enum_set_value_descriptions (type, descs);
|
|
||||||
}
|
|
||||||
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
GType
|
GType
|
||||||
gimp_vector_mode_get_type (void)
|
gimp_vector_mode_get_type (void)
|
||||||
{
|
{
|
||||||
|
@ -120,17 +120,6 @@ typedef enum
|
|||||||
} GimpTransformPreviewType;
|
} GimpTransformPreviewType;
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_TRANSFORM_GRID_TYPE (gimp_transform_grid_type_get_type ())
|
|
||||||
|
|
||||||
GType gimp_transform_grid_type_get_type (void) G_GNUC_CONST;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
GIMP_TRANSFORM_GRID_TYPE_N_LINES, /*< desc="Number of grid lines" >*/
|
|
||||||
GIMP_TRANSFORM_GRID_TYPE_SPACING /*< desc="Grid line spacing" >*/
|
|
||||||
} GimpTransformGridType;
|
|
||||||
|
|
||||||
|
|
||||||
#define GIMP_TYPE_VECTOR_MODE (gimp_vector_mode_get_type ())
|
#define GIMP_TYPE_VECTOR_MODE (gimp_vector_mode_get_type ())
|
||||||
|
|
||||||
GType gimp_vector_mode_get_type (void) G_GNUC_CONST;
|
GType gimp_vector_mode_get_type (void) G_GNUC_CONST;
|
||||||
|
Reference in New Issue
Block a user