Asset Shelf: Transparent asset shelf header with background for buttons #112241
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112241
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "JulianEisel/blender:temp-asset-shelf-button-sections"
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?
Draw the background of the asset shelf header fully transparent, with an opaque background with rounded corners behind sections containing buttons. This reduces the visual space consumed by the asset shelf, and makes the header follow a tabbed folder metaphor better. Also, this works much better with our click-through feature, where transparent parts of regions without buttons are passed through the region under it (we might want to consider unifying code here a bit).
Region resizing respects the transparent sections:
When there is little space between sections, the sections get merged so that there are no small gaps in the bar:
Part of #107881.
Note that the core of this is implemented in a generic way, so this can be reused for other regions:
Asset Shelf: Draw asset shelf header transparent with button backgroundto WIP: Asset Shelf: Draw asset shelf header transparent with button background@ -2251,1 +2251,4 @@
}
void ui_draw_button_sections_background(const ARegion *region,
const blender::Vector<rcti> §ion_bounds,
Use
Span
here since this function doesn't need to know the data is stored in a vector.@ -52,0 +79,4 @@
BLI_assert(merge_distance_x >= 0);
const std::function finish_section_fn = [§ion_bounds,
This can just be a lambda, it doesn't need to be a
std::function
Also no need to be specific about the captures, it's fine to capture everything by reference.
[&]
can be a bit memory wasting since it essentially adds a new member variable for each outer scope variable to the function object generated by the compiler - being lazy has a cost here :) So I prefer not to default to it. In this case it's fine though.I'm not too keen on
auto
here, but I guessstd::function
add costs that can be avoided (micro-optimizing here). But at least with the_fn
suffix it's clear that this object is a functor when it pops up later in the function, so I guess it's fine.WIP: Asset Shelf: Draw asset shelf header transparent with button backgroundto Asset Shelf: Transparent asset shelf header with background for buttons@ -0,0 +103,4 @@
}
static void ui_draw_button_sections_background(const ARegion *region,
const Span<rcti> §ion_bounds,
Span
should be passed by value, otherwise it acts like a pointer to a pointer.Heh, rushing things before the meeting much? Thanks :)
Julian Eisel referenced this pull request2023-09-13 19:22:56 +02:00
+1 looks wise 👌
When toggling it off (via the piemenu), I see a big artifact showing up:
Meeting yesterday agreed on having this but also combined with the style applied to the top-bar for consistency.
Fixed in the last commit.
LGTM, only minor issues noted inline.
@ -506,3 +507,3 @@
update_active_shelf(*C, *space_type, *shelf_regiondata);
ED_region_header(C, region);
ED_region_header_layout(C, region);
Might it make sense to add a
ED_region_header_with_button_sections
? Since practically all other region functions useED_region_header(C, region)
.@ -842,0 +843,4 @@
/* Separator line between regions if the #uiButtonSectionsAlign is not #None. */
#define UI_BUTTON_SECTION_SEPERATOR_LINE_WITH (U.pixelsize * 2)
enum class uiButtonSectionsAlign : int16_t { None, Top, Bottom };
picky I have a slight preference to set the first value to
1
, so it's clear when debugging what the values are and so a zeroed value isn't implicitly initializing in a non obvious way.Also, why not
uint8_t
? (if the size is given at all, may as well not use a larger value then is needed.)@ -3594,0 +3603,4 @@
const ARegion *region,
const uiButtonSectionsAlign align)
{
const ThemeColorID bgcolorid = region_background_color_id(C, region);
Worth mentioning this follows
ED_region_header_draw
closely, it might make sense to but this directly below that function too so changes to one aren't as likely to be missed in the other.@ -3594,0 +3606,4 @@
const ThemeColorID bgcolorid = region_background_color_id(C, region);
/* Clear and draw button sections background when using region overlap. Otherwise clear using the
* background color like normally. */
*picky *normally -> normal.