Update upstream
This commit is contained in:
@ -184,19 +184,31 @@ static const PikaEnumActionEntry edit_paste_actions[] =
|
||||
PIKA_HELP_EDIT_PASTE_IN_PLACE },
|
||||
|
||||
{ "edit-paste-into", PIKA_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"),
|
||||
PIKA_PASTE_TYPE_FLOATING_INTO, FALSE,
|
||||
PIKA_HELP_EDIT_PASTE_INTO },
|
||||
|
||||
{ "edit-paste-into-in-place", PIKA_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"),
|
||||
PIKA_PASTE_TYPE_FLOATING_INTO_IN_PLACE, FALSE,
|
||||
PIKA_HELP_EDIT_PASTE_INTO_IN_PLACE }
|
||||
PIKA_HELP_EDIT_PASTE_INTO_IN_PLACE },
|
||||
|
||||
{ "edit-paste-float", PIKA_ICON_EDIT_PASTE,
|
||||
NC_("edit-action", "Paste as _Floating Data"), NULL, { NULL },
|
||||
NC_("edit-action", "Paste the content of the clipboard as Floating Data"),
|
||||
PIKA_PASTE_TYPE_FLOATING, FALSE,
|
||||
PIKA_HELP_EDIT_PASTE },
|
||||
|
||||
{ "edit-paste-float-in-place", PIKA_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"),
|
||||
PIKA_PASTE_TYPE_FLOATING_IN_PLACE, FALSE,
|
||||
PIKA_HELP_EDIT_PASTE }
|
||||
};
|
||||
|
||||
static const PikaEnumActionEntry edit_fill_actions[] =
|
||||
|
@ -972,7 +972,7 @@ layers_actions_update (PikaActionGroup *group,
|
||||
SET_SENSITIVE ("layers-new", image);
|
||||
SET_SENSITIVE ("layers-new-last-values", image);
|
||||
SET_SENSITIVE ("layers-new-from-visible", image);
|
||||
SET_SENSITIVE ("layers-new-group", image && !indexed);
|
||||
SET_SENSITIVE ("layers-new-group", image && !indexed && !fs);
|
||||
SET_SENSITIVE ("layers-duplicate", n_selected_layers > 0 && !fs && !ac);
|
||||
SET_SENSITIVE ("layers-delete", n_selected_layers > 0 && !ac);
|
||||
|
||||
|
@ -62,10 +62,16 @@ static const PikaActionEntry select_actions[] =
|
||||
select_invert_cmd_callback,
|
||||
PIKA_HELP_SELECTION_INVERT },
|
||||
|
||||
{ "select-float", PIKA_ICON_LAYER_FLOATING_SELECTION,
|
||||
NC_("select-action", "_Float"), NULL, { "<primary><shift>L", NULL },
|
||||
NC_("select-action", "Create a floating selection"),
|
||||
select_float_cmd_callback,
|
||||
{ "select-cut-float", PIKA_ICON_LAYER_FLOATING_SELECTION,
|
||||
NC_("select-action", "Cu_t and Float"), NULL, { "<primary><shift>L", NULL },
|
||||
NC_("select-action", "Cut the selection directly into a floating selection"),
|
||||
select_cut_float_cmd_callback,
|
||||
PIKA_HELP_SELECTION_FLOAT },
|
||||
|
||||
{ "select-copy-float", PIKA_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,
|
||||
PIKA_HELP_SELECTION_FLOAT },
|
||||
|
||||
{ "select-feather", NULL,
|
||||
@ -186,9 +192,13 @@ select_actions_update (PikaActionGroup *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 &&
|
||||
! pika_item_is_content_locked (drawables->data, NULL) &&
|
||||
! pika_viewable_get_children (drawables->data));
|
||||
|
||||
SET_SENSITIVE ("select-cut-float", g_list_length (drawables) == 1 && sel &&
|
||||
! pika_item_is_content_locked (drawables->data, NULL) &&
|
||||
! pika_viewable_get_children (drawables->data));
|
||||
SET_SENSITIVE ("select-copy-float", g_list_length (drawables) == 1 && sel &&
|
||||
! pika_item_is_content_locked (drawables->data, NULL) &&
|
||||
! pika_viewable_get_children (drawables->data));
|
||||
|
||||
SET_SENSITIVE ("select-feather", image && sel);
|
||||
SET_SENSITIVE ("select-sharpen", image && sel);
|
||||
|
@ -71,6 +71,10 @@ static void select_shrink_callback (GtkWidget *widget,
|
||||
gdouble size,
|
||||
PikaUnit unit,
|
||||
gpointer data);
|
||||
static void select_float (PikaAction *action,
|
||||
GVariant *value,
|
||||
gboolean cut,
|
||||
gpointer data);
|
||||
|
||||
|
||||
/* public functions */
|
||||
@ -112,33 +116,19 @@ select_invert_cmd_callback (PikaAction *action,
|
||||
}
|
||||
|
||||
void
|
||||
select_float_cmd_callback (PikaAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
select_cut_float_cmd_callback (PikaAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
PikaImage *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 = pika_image_get_selected_drawables (image);
|
||||
if (pika_selection_float (PIKA_SELECTION (pika_image_get_mask (image)),
|
||||
drawables,
|
||||
action_data_get_context (data),
|
||||
TRUE, 0, 0, &error))
|
||||
{
|
||||
pika_image_flush (image);
|
||||
}
|
||||
else
|
||||
{
|
||||
pika_message_literal (image->pika,
|
||||
G_OBJECT (widget), PIKA_MESSAGE_WARNING,
|
||||
error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
g_list_free (drawables);
|
||||
void
|
||||
select_copy_float_cmd_callback (PikaAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
select_float (action, value, FALSE, data);
|
||||
}
|
||||
|
||||
void
|
||||
@ -696,3 +686,34 @@ select_shrink_callback (GtkWidget *widget,
|
||||
TRUE);
|
||||
pika_image_flush (image);
|
||||
}
|
||||
|
||||
static void
|
||||
select_float (PikaAction *action,
|
||||
GVariant *value,
|
||||
gboolean cut,
|
||||
gpointer data)
|
||||
{
|
||||
PikaImage *image;
|
||||
GtkWidget *widget;
|
||||
GList *drawables;
|
||||
GError *error = NULL;
|
||||
return_if_no_image (image, data);
|
||||
return_if_no_widget (widget, data);
|
||||
|
||||
drawables = pika_image_get_selected_drawables (image);
|
||||
if (pika_selection_float (PIKA_SELECTION (pika_image_get_mask (image)),
|
||||
drawables,
|
||||
action_data_get_context (data),
|
||||
cut, 0, 0, &error))
|
||||
{
|
||||
pika_image_flush (image);
|
||||
}
|
||||
else
|
||||
{
|
||||
pika_message_literal (image->pika,
|
||||
G_OBJECT (widget), PIKA_MESSAGE_WARNING,
|
||||
error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
g_list_free (drawables);
|
||||
}
|
||||
|
@ -32,7 +32,10 @@ void select_none_cmd_callback (PikaAction *action,
|
||||
void select_invert_cmd_callback (PikaAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void select_float_cmd_callback (PikaAction *action,
|
||||
void select_cut_float_cmd_callback (PikaAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void select_copy_float_cmd_callback (PikaAction *action,
|
||||
GVariant *value,
|
||||
gpointer data);
|
||||
void select_feather_cmd_callback (PikaAction *action,
|
||||
|
Reference in New Issue
Block a user