mirror of https://github.com/GNOME/gimp.git
actions: Fix layer buttons relative to floating selections
The anchor and merge down buttons are visible at the same time, which should not be the case. Their visibility is now dependent on the existance of a floating selection. The New Group and Search/Link buttons are also disabled when there's a floating section.
This commit is contained in:
parent
f12a88bd65
commit
efa1267f13
|
@ -968,7 +968,7 @@ layers_actions_update (GimpActionGroup *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);
|
||||
|
||||
|
|
|
@ -100,6 +100,8 @@ static void gimp_action_proxy_button_activate (GtkButton *button,
|
|||
|
||||
static void gimp_action_update_proxy_sensitive (GimpAction *action,
|
||||
GtkWidget *proxy);
|
||||
static void gimp_action_update_proxy_visible (GimpAction *action,
|
||||
GtkWidget *proxy);
|
||||
static void gimp_action_update_proxy_tooltip (GimpAction *action,
|
||||
GtkWidget *proxy);
|
||||
|
||||
|
@ -442,9 +444,20 @@ void
|
|||
gimp_action_set_visible (GimpAction *action,
|
||||
gboolean visible)
|
||||
{
|
||||
g_object_set (action,
|
||||
"visible", visible,
|
||||
NULL);
|
||||
GimpActionPrivate *priv = GET_PRIVATE (action);
|
||||
|
||||
/* Only notify when the state actually changed. This is important for
|
||||
* handlers such as visibility of menu items in GimpMenuModel which
|
||||
* will assume that the action visibility changed. Otherwise we might
|
||||
* remove items by mistake.
|
||||
*/
|
||||
if (priv->visible != visible)
|
||||
{
|
||||
priv->visible = visible;
|
||||
|
||||
gimp_action_update_proxy_visible (action, NULL);
|
||||
g_object_notify (G_OBJECT (action), "visible");
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
|
@ -925,16 +938,8 @@ gimp_action_set_property (GObject *object,
|
|||
NULL);
|
||||
break;
|
||||
case GIMP_ACTION_PROP_VISIBLE:
|
||||
if (priv->visible != g_value_get_boolean (value))
|
||||
{
|
||||
priv->visible = g_value_get_boolean (value);
|
||||
/* Only notify when the state actually changed. This is important for
|
||||
* handlers such as visibility of menu items in GimpMenuModel which
|
||||
* will assume that the action visibility changed. Otherwise we might
|
||||
* remove items by mistake.
|
||||
*/
|
||||
g_object_notify (object, "visible");
|
||||
}
|
||||
gimp_action_set_visible (GIMP_ACTION (object),
|
||||
g_value_get_boolean (value));
|
||||
break;
|
||||
|
||||
case GIMP_ACTION_PROP_LABEL:
|
||||
|
@ -1387,6 +1392,24 @@ gimp_action_update_proxy_sensitive (GimpAction *action,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_action_update_proxy_visible (GimpAction *action,
|
||||
GtkWidget *proxy)
|
||||
{
|
||||
GimpActionPrivate *priv = GET_PRIVATE (action);
|
||||
gboolean visible = gimp_action_is_visible (action);
|
||||
|
||||
if (proxy)
|
||||
{
|
||||
gtk_widget_set_visible (proxy, visible);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (GList *list = priv->proxies; list; list = list->next)
|
||||
gtk_widget_set_visible (list->data, visible);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_action_update_proxy_tooltip (GimpAction *action,
|
||||
GtkWidget *proxy)
|
||||
|
|
|
@ -1220,6 +1220,8 @@ gimp_layer_tree_view_floating_selection_changed (GimpImage *image,
|
|||
g_list_free (all_layers);
|
||||
}
|
||||
|
||||
gtk_widget_set_sensitive (layer_view->priv->link_button, ! floating_sel);
|
||||
|
||||
gimp_layer_tree_view_update_highlight (layer_view);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue