Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-03-29 15:36:06 +0300
committerJulian Eisel <julian@blender.org>2022-03-29 15:36:06 +0300
commit4def6e80728a120977f869b475251b133d88e4ab (patch)
tree8f003009ffb6c63f5673e7fe729db1eb5c37b449 /source/blender/editors/interface/interface_icons.c
parent62c73db734151c1a12ef07d3c8458521f2441e1c (diff)
Icons: Programmatically create indirect library icon, remove from SVG
The indirect library data icon was just a grayed out version of the regular one. This graying out is now done in code, so the icon can be removed from the SVG. Note that the icon is still defined as `ICON_LIBRARY_DATA_INDIRECT` (or `LIBRARY_DATA_INDIRECT` in BPY).
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r--source/blender/editors/interface/interface_icons.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 07e4f6c2a24..887781beda1 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -465,6 +465,17 @@ DEF_ICON_STRIP_COLOR_DRAW(09, SEQUENCE_COLOR_09);
# undef DEF_ICON_STRIP_COLOR_DRAW
+# define ICON_INDIRECT_DATA_ALPHA 0.6f
+
+static void vicon_strip_color_draw_library_data_indirect(
+ int x, int y, int w, int UNUSED(h), float alpha)
+{
+ const float aspect = (float)ICON_DEFAULT_WIDTH / (float)w;
+
+ UI_icon_draw_ex(
+ x, y, ICON_LIBRARY_DATA_DIRECT, aspect, ICON_INDIRECT_DATA_ALPHA * alpha, 0.0f, NULL, false);
+}
+
/* Dynamically render icon instead of rendering a plain color to a texture/buffer
* This is not strictly a "vicon", as it needs access to icon->obj to get the color info,
* but it works in a very similar way.
@@ -974,6 +985,8 @@ static void init_internal_icons(void)
def_internal_vicon(ICON_SEQUENCE_COLOR_07, vicon_strip_color_draw_07);
def_internal_vicon(ICON_SEQUENCE_COLOR_08, vicon_strip_color_draw_08);
def_internal_vicon(ICON_SEQUENCE_COLOR_09, vicon_strip_color_draw_09);
+
+ def_internal_vicon(ICON_LIBRARY_DATA_INDIRECT, vicon_strip_color_draw_library_data_indirect);
}
static void init_iconfile_list(struct ListBase *list)