UI: Draw 3D view tools header transparent with background behind buttons

Makes use of the new buttons sections feature used by the asset shelf to
draw a background behind buttons, but the reset of the region fully
transparent. The UI team agreed on this as a way to minimize dead space,
but also as a better way to communicate our click through feature (where
dead space in overlapping regions forwards events to the underlying
region). The region background theme setting only affects the
non-transparent part of the region, the rest is always fully
transparent. With region overlap disabled, the bar is fully opaque still.

Also see #112241.
This commit is contained in:
Julian Eisel
2023-09-27 11:57:37 +02:00
parent 04d22d73f3
commit 55eaa755e3

View File

@@ -1965,6 +1965,11 @@ static void view3d_tools_region_draw(const bContext *C, ARegion *region)
ED_region_panels_ex(C, region, contexts);
}
static void view3d_tools_header_region_draw(const bContext *C, ARegion *region)
{
ED_region_header_with_button_sections(C, region, uiButtonSectionsAlign::Top);
}
/* add handlers, stuff you only do once or on area/region changes */
static void view3d_asset_shelf_region_init(wmWindowManager *wm, ARegion *region)
{
@@ -2268,7 +2273,7 @@ void ED_spacetype_view3d()
art->listener = view3d_header_region_listener;
art->message_subscribe = ED_area_do_mgs_subscribe_for_tool_header;
art->init = view3d_header_region_init;
art->draw = view3d_header_region_draw;
art->draw = view3d_tools_header_region_draw;
BLI_addhead(&st->regiontypes, art);
/* regions: header */