From 5514ca58a4d4e03d9062bc479488faca7e577677 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 25 Nov 2021 16:53:44 +0100 Subject: Fix T92313: Heading of redo panel is not aligned properly This corrects some alignments issues through new margins introduced in 93544b641bd6. Basic idea of this fix is to only add the new margins when drawing a panel with background. These margins were added specifically for the background boxes, so that makes sense. Alternative fix to D13199. This also fixes some margings added unintentionally in mentioned commit. There is a little jump of the toolbar and the tabs in the Properties when comparing the UI without this fix to 2.93: {F12158085} {F12158039} The jump is gone with this fix applied (compare to the 2.93 screenshot): {F12158064} While not a serious issue, this confirms that this fix actually tackles the root of the issue. --- source/blender/editors/include/UI_interface.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/editors/include/UI_interface.h') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index d9f6c89e03b..f5240a2bedb 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -257,6 +257,8 @@ enum { #define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f) +/* Both these margins should be ignored if the panel doesn't show a background (check + * #UI_panel_should_show_background()). */ #define UI_PANEL_MARGIN_X (U.widget_unit * 0.4f) #define UI_PANEL_MARGIN_Y (U.widget_unit * 0.1f) @@ -1771,6 +1773,8 @@ void UI_panel_context_pointer_set(struct Panel *panel, const char *name, struct bool UI_panel_is_closed(const struct Panel *panel); bool UI_panel_is_active(const struct Panel *panel); void UI_panel_label_offset(const struct uiBlock *block, int *r_x, int *r_y); +bool UI_panel_should_show_background(const struct ARegion *region, + const struct PanelType *panel_type); int UI_panel_size_y(const struct Panel *panel); bool UI_panel_is_dragging(const struct Panel *panel); bool UI_panel_matches_search_filter(const struct Panel *panel); -- cgit v1.2.3