app: in GimpItemTreeView, use color tag of parent for children with no tag

Add gimp_item_get_merged_color_tag(), which returns the color tag
of the nearest ancestor (including the current item) that has a
color tag other than NONE.  Use this function in GimpItemTreeView,
instead of gimp_item_get_color_tag(), to set the cell color of
items, so that item's with a NONE color tag inherit the color of
their parent.  Add a boolean "inherited" parameter to
gimp_get_color_tag_color(), which indicates if the color tag is the
item's actual color tag, or an inherited color tag, and modify the
returned color accordingly, so that inherited colors are less
saturated/lighter than non-inherited ones.
This commit is contained in:
Ell
2017-12-07 16:42:54 -05:00
parent fa314d0f2b
commit 0beef7d97d
7 changed files with 52 additions and 12 deletions

View File

@ -60,7 +60,7 @@ items_actions_setup (GimpActionGroup *group,
gimp_action_group_set_action_context (group, action,
gimp_get_user_context (group->gimp));
gimp_get_color_tag_color (value->value, &color);
gimp_get_color_tag_color (value->value, &color, FALSE);
gimp_action_group_set_action_color (group, action, &color, FALSE);
}
}
@ -95,7 +95,7 @@ items_actions_update (GimpActionGroup *group,
can_lock_pos = gimp_item_can_lock_position (item);
has_color_tag = gimp_get_color_tag_color (gimp_item_get_color_tag (item),
&tag_color);
&tag_color, FALSE);
}
#define SET_SENSITIVE(action,condition) \