diff --git a/app/actions/edit-actions.c b/app/actions/edit-actions.c index 32559aea88..6dd27ba8f7 100644 --- a/app/actions/edit-actions.c +++ b/app/actions/edit-actions.c @@ -180,19 +180,31 @@ static const GimpEnumActionEntry edit_paste_actions[] = GIMP_HELP_EDIT_PASTE_IN_PLACE }, { "edit-paste-into", GIMP_ICON_EDIT_PASTE_INTO, - NC_("edit-action", "Paste _Into Selection"), NULL, { NULL }, + NC_("edit-action", "Paste as Floating Data _Into Selection"), NULL, { NULL }, NC_("edit-action", "Paste the content of the clipboard into the current selection"), GIMP_PASTE_TYPE_FLOATING_INTO, FALSE, GIMP_HELP_EDIT_PASTE_INTO }, { "edit-paste-into-in-place", GIMP_ICON_EDIT_PASTE_INTO, - NC_("edit-action", "Paste Int_o Selection In Place"), NULL, { NULL }, + NC_("edit-action", "Paste as Floating Data Int_o Selection In Place"), NULL, { NULL }, NC_("edit-action", "Paste the content of the clipboard into the current selection " "at its original position"), GIMP_PASTE_TYPE_FLOATING_INTO_IN_PLACE, FALSE, - GIMP_HELP_EDIT_PASTE_INTO_IN_PLACE } + GIMP_HELP_EDIT_PASTE_INTO_IN_PLACE }, + + { "edit-paste-float", GIMP_ICON_EDIT_PASTE, + NC_("edit-action", "Paste as _Floating Data"), NULL, { NULL }, + NC_("edit-action", "Paste the content of the clipboard as Floating Data"), + GIMP_PASTE_TYPE_FLOATING, FALSE, + GIMP_HELP_EDIT_PASTE }, + + { "edit-paste-float-in-place", GIMP_ICON_EDIT_PASTE, + NC_("edit-action", "Paste as Floa_ting Data In Place"), NULL, { NULL }, + NC_("edit-action", "Paste the content of the clipboard as Floating Data at its original position"), + GIMP_PASTE_TYPE_FLOATING_IN_PLACE, FALSE, + GIMP_HELP_EDIT_PASTE } }; static const GimpEnumActionEntry edit_fill_actions[] = diff --git a/app/actions/select-actions.c b/app/actions/select-actions.c index 33c7e4c40c..c74c9a84f3 100644 --- a/app/actions/select-actions.c +++ b/app/actions/select-actions.c @@ -58,10 +58,16 @@ static const GimpActionEntry select_actions[] = select_invert_cmd_callback, GIMP_HELP_SELECTION_INVERT }, - { "select-float", GIMP_ICON_LAYER_FLOATING_SELECTION, - NC_("select-action", "_Float"), NULL, { "L", NULL }, - NC_("select-action", "Create a floating selection"), - select_float_cmd_callback, + { "select-cut-float", GIMP_ICON_LAYER_FLOATING_SELECTION, + NC_("select-action", "Cu_t and Float"), NULL, { "L", NULL }, + NC_("select-action", "Cut the selection directly into a floating selection"), + select_cut_float_cmd_callback, + GIMP_HELP_SELECTION_FLOAT }, + + { "select-copy-float", GIMP_ICON_LAYER_FLOATING_SELECTION, + NC_("select-action", "_Copy and Float"), NULL, { NULL }, + NC_("select-action", "Copy the selection directly into a floating selection"), + select_copy_float_cmd_callback, GIMP_HELP_SELECTION_FLOAT }, { "select-feather", NULL, @@ -182,9 +188,13 @@ select_actions_update (GimpActionGroup *group, SET_SENSITIVE ("select-all", image && ! sel_all); SET_SENSITIVE ("select-none", image && sel); SET_SENSITIVE ("select-invert", image); - SET_SENSITIVE ("select-float", g_list_length (drawables) == 1 && sel && - ! gimp_item_is_content_locked (drawables->data, NULL) && - ! gimp_viewable_get_children (drawables->data)); + + SET_SENSITIVE ("select-cut-float", g_list_length (drawables) == 1 && sel && + ! gimp_item_is_content_locked (drawables->data, NULL) && + ! gimp_viewable_get_children (drawables->data)); + SET_SENSITIVE ("select-copy-float", g_list_length (drawables) == 1 && sel && + ! gimp_item_is_content_locked (drawables->data, NULL) && + ! gimp_viewable_get_children (drawables->data)); SET_SENSITIVE ("select-feather", image && sel); SET_SENSITIVE ("select-sharpen", image && sel); diff --git a/app/actions/select-commands.c b/app/actions/select-commands.c index 5d92dd4b56..ef62926ace 100644 --- a/app/actions/select-commands.c +++ b/app/actions/select-commands.c @@ -67,6 +67,10 @@ static void select_shrink_callback (GtkWidget *widget, gdouble size, GimpUnit unit, gpointer data); +static void select_float (GimpAction *action, + GVariant *value, + gboolean cut, + gpointer data); /* public functions */ @@ -108,33 +112,19 @@ select_invert_cmd_callback (GimpAction *action, } void -select_float_cmd_callback (GimpAction *action, - GVariant *value, - gpointer data) +select_cut_float_cmd_callback (GimpAction *action, + GVariant *value, + gpointer data) { - GimpImage *image; - GtkWidget *widget; - GList *drawables; - GError *error = NULL; - return_if_no_image (image, data); - return_if_no_widget (widget, data); + select_float (action, value, TRUE, data); +} - drawables = gimp_image_get_selected_drawables (image); - if (gimp_selection_float (GIMP_SELECTION (gimp_image_get_mask (image)), - drawables, - action_data_get_context (data), - TRUE, 0, 0, &error)) - { - gimp_image_flush (image); - } - else - { - gimp_message_literal (image->gimp, - G_OBJECT (widget), GIMP_MESSAGE_WARNING, - error->message); - g_clear_error (&error); - } - g_list_free (drawables); +void +select_copy_float_cmd_callback (GimpAction *action, + GVariant *value, + gpointer data) +{ + select_float (action, value, FALSE, data); } void @@ -692,3 +682,34 @@ select_shrink_callback (GtkWidget *widget, TRUE); gimp_image_flush (image); } + +static void +select_float (GimpAction *action, + GVariant *value, + gboolean cut, + gpointer data) +{ + GimpImage *image; + GtkWidget *widget; + GList *drawables; + GError *error = NULL; + return_if_no_image (image, data); + return_if_no_widget (widget, data); + + drawables = gimp_image_get_selected_drawables (image); + if (gimp_selection_float (GIMP_SELECTION (gimp_image_get_mask (image)), + drawables, + action_data_get_context (data), + cut, 0, 0, &error)) + { + gimp_image_flush (image); + } + else + { + gimp_message_literal (image->gimp, + G_OBJECT (widget), GIMP_MESSAGE_WARNING, + error->message); + g_clear_error (&error); + } + g_list_free (drawables); +} diff --git a/app/actions/select-commands.h b/app/actions/select-commands.h index e6d2a30b64..b9c550478c 100644 --- a/app/actions/select-commands.h +++ b/app/actions/select-commands.h @@ -28,7 +28,10 @@ void select_none_cmd_callback (GimpAction *action, void select_invert_cmd_callback (GimpAction *action, GVariant *value, gpointer data); -void select_float_cmd_callback (GimpAction *action, +void select_cut_float_cmd_callback (GimpAction *action, + GVariant *value, + gpointer data); +void select_copy_float_cmd_callback (GimpAction *action, GVariant *value, gpointer data); void select_feather_cmd_callback (GimpAction *action, diff --git a/menus/image-menu.ui.in.in b/menus/image-menu.ui.in.in index 51de2da9bb..44e392e973 100644 --- a/menus/image-menu.ui.in.in +++ b/menus/image-menu.ui.in.in @@ -90,10 +90,16 @@ app.edit-paste-in-place Paste _as - app.edit-paste-merged - app.edit-paste-merged-in-place - app.edit-paste-into - app.edit-paste-into-in-place +
+ app.edit-paste-merged + app.edit-paste-merged-in-place +
+
+ app.edit-paste-float + app.edit-paste-float-in-place + app.edit-paste-into + app.edit-paste-into-in-place +
app.edit-paste-as-new-imagelong
@@ -143,7 +149,11 @@ app.select-all app.select-none app.select-invert - app.select-float + + _Float + app.select-cut-float + app.select-copy-float + app.tools-by-color-select-short app.vectors-selection-from-vectors app.dialogs-selection-editor diff --git a/menus/selection-menu.ui b/menus/selection-menu.ui index 23337119ca..9a8f6bda18 100644 --- a/menus/selection-menu.ui +++ b/menus/selection-menu.ui @@ -10,7 +10,10 @@ app.select-none app.select-invert app.vectors-selection-from-vectors - app.select-float +
+ app.select-cut-float + app.select-copy-float +
app.select-feather app.select-sharpen