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

fixed the layers dialog's "New Layer" button by checking for a floating

2001-11-15  Michael Natterer  <mitch@gimp.org>

	* app/gui/layers-commands.c: fixed the layers dialog's "New Layer"
	button by checking for a floating selection in
	layers_new_layer_query() instead of
	layers_new_layer_cmd_callback().
parent f901b46d
2001-11-15 Michael Natterer <mitch@gimp.org>
* app/gui/layers-commands.c: fixed the layers dialog's "New Layer"
button by checking for a floating selection in
layers_new_layer_query() instead of
layers_new_layer_cmd_callback().
2001-11-15 Michael Natterer <mitch@gimp.org>
* app/tools/gimpdrawtool.[ch]: restructured the new draw utility
......
......@@ -181,26 +181,13 @@ layers_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpLayer *layer;
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
if (! gimage)
return;
/* If there is a floating selection, the new command transforms
* the current fs into a new layer
*/
if ((layer = gimp_image_floating_sel (gimage)))
{
floating_sel_to_layer (layer);
gdisplays_flush ();
}
else
{
layers_new_layer_query (gimage);
}
layers_new_layer_query (gimage);
}
void
......@@ -567,6 +554,7 @@ void
layers_new_layer_query (GimpImage *gimage)
{
NewLayerOptions *options;
GimpLayer *floating_sel;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
......@@ -574,6 +562,19 @@ layers_new_layer_query (GimpImage *gimage)
GtkWidget *spinbutton;
GtkWidget *frame;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
/* If there is a floating selection, the new command transforms
* the current fs into a new layer
*/
if ((floating_sel = gimp_image_floating_sel (gimage)))
{
floating_sel_to_layer (floating_sel);
gdisplays_flush ();
return;
}
options = g_new0 (NewLayerOptions, 1);
options->fill_type = fill_type;
......
......@@ -181,26 +181,13 @@ layers_new_cmd_callback (GtkWidget *widget,
gpointer data)
{
GimpImage *gimage;
GimpLayer *layer;
gimage = (GimpImage *) gimp_widget_get_callback_context (widget);
if (! gimage)
return;
/* If there is a floating selection, the new command transforms
* the current fs into a new layer
*/
if ((layer = gimp_image_floating_sel (gimage)))
{
floating_sel_to_layer (layer);
gdisplays_flush ();
}
else
{
layers_new_layer_query (gimage);
}
layers_new_layer_query (gimage);
}
void
......@@ -567,6 +554,7 @@ void
layers_new_layer_query (GimpImage *gimage)
{
NewLayerOptions *options;
GimpLayer *floating_sel;
GtkWidget *vbox;
GtkWidget *table;
GtkWidget *label;
......@@ -574,6 +562,19 @@ layers_new_layer_query (GimpImage *gimage)
GtkWidget *spinbutton;
GtkWidget *frame;
g_return_if_fail (GIMP_IS_IMAGE (gimage));
/* If there is a floating selection, the new command transforms
* the current fs into a new layer
*/
if ((floating_sel = gimp_image_floating_sel (gimage)))
{
floating_sel_to_layer (floating_sel);
gdisplays_flush ();
return;
}
options = g_new0 (NewLayerOptions, 1);
options->fill_type = fill_type;
......
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