Asset Shelf: Transparent asset shelf header with background for buttons #112241

Merged
Julian Eisel merged 19 commits from JulianEisel/blender:temp-asset-shelf-button-sections into main 2023-09-26 17:12:45 +02:00
3 changed files with 9 additions and 4 deletions
Showing only changes of commit 5695cf56b7 - Show all commits

View File

@ -476,9 +476,12 @@ void ED_asset_shelf_header_region(const bContext *C, ARegion *region)
int ED_asset_shelf_header_region_size()
{
/* The asset shelf tends to look like a separate area. Making the shelf header smaller than a
* normal header helps a bit. */
return ED_area_headersize() * 0.85f;
/* Use a height that lets widgets sit just on top of the separator line drawn at the lower edge
* of the region (widgets will be centered).
*
* Note that this is usually a bit less than the header size. The asset shelf tends to look like
* a separate area, so making the shelf header smaller than a header helps. */
return UI_UNIT_Y + (UI_BUTTON_SECTION_SEPERATOR_LINE_WITH * 2);
}
void ED_asset_shelf_region_blend_read_data(BlendDataReader *reader, ARegion *region)

View File

@ -838,6 +838,8 @@ void UI_block_lock_set(uiBlock *block, bool val, const char *lockstr);
void UI_block_lock_clear(uiBlock *block);
#define UI_BUTTON_SECTION_MERGE_DISTANCE (UI_UNIT_X * 3)
/* 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 };
/**

View File

@ -145,7 +145,7 @@ static void ui_draw_button_sections_alignment_separator(const ARegion *region,
const uiButtonSectionsAlign align,
const float corner_radius)
{
const int separator_line_width = 2 * U.pixelsize;
const int separator_line_width = UI_BUTTON_SECTION_SEPERATOR_LINE_WITH;
float bg_color[4];
UI_GetThemeColor4fv(colorid, bg_color);