From 55eaa755e3fcb0b9cb3417afee6f3e65b2c43d7b Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Wed, 27 Sep 2023 11:57:37 +0200 Subject: [PATCH] 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. --- source/blender/editors/space_view3d/space_view3d.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_view3d/space_view3d.cc b/source/blender/editors/space_view3d/space_view3d.cc index 893b05f191d..c64f8d29c76 100644 --- a/source/blender/editors/space_view3d/space_view3d.cc +++ b/source/blender/editors/space_view3d/space_view3d.cc @@ -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 */