UI: Add Optional Flags for Tooltip Image Fields #119437
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#119437
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Harley/blender:TooltipImageFlags"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add more flexibility to tooltip images by adding the ability to specify
if (one of two) checkerboards are added, border, premultiplied
blending, or recoloring.
The current tooltip images work okay in our current usages, but we need more flexibility to do things like this or that.
Why do we have two checkerboards? We have one that we use in most places which has colors that are set by the theme. But within the theme editor itself we use a checkerboard with fixed colors to always give consistent results. The former would be used for image thumbnails while the latter would be needed for previews of colors.
What is "recoloring"? When drawing images the shader has an option to shift the colors based on a passed color. An example of use is with font previews, which are always saved as white images on a transparent background. This would not be visible with light themes to we recolor with the text color so they appear dark there.
I like the way this is headed, but I think it could be a little friendlier/more flexible with a struct for parameters instead. For example,
UI_TIP_FLAG_IMAGE_CHECKER
andUI_TIP_FLAG_IMAGE_CHECKER_FIXED
are mutually exclusive, but that can't be represented by a flag.What about a struct, something loosely like this?
For now it's just booleans I guess, but it could also contain other things, even the size and the image pointer itself I guess.
@HooglyBoogly
What do you think of this? It certainly reads a lot nicer.
Looks great!
@ -1722,6 +1722,22 @@ enum uiTooltipColorID {
UI_TIP_LC_MAX
};
enum uiTooltipImageBackground {
How about this :)
@ -92,3 +92,2 @@
uiTooltipFormat format;
ImBuf *image;
short image_size[2];
uiTooltipImage *image = nullptr;
std::optional
seems simpler here than allocating a struct. I don't see a matchingdelete
in this PR, so I'd expect a memory leak currently.@ -125,3 +124,3 @@
}
void UI_tooltip_image_field_add(uiTooltipData *data, const ImBuf *image, const short image_size[2])
void UI_tooltip_image_field_add(uiTooltipData *data, uiTooltipImage image_data)
Think I'd pass this by const reference, it's not a small struct and it's not being
std::move
d here@blender-bot build