Page MenuHome

Fix T92313: Adjust header to the center
AbandonedPublic

Authored by Pratik Borhade (PratikPB2123) on Nov 12 2021, 6:41 AM.

Details

Summary

Fix T92313.

Patch corrects the alignment of panel header.

BrokenAfter the patch

Diff Detail

Repository
rB Blender

Event Timeline

Pratik Borhade (PratikPB2123) requested review of this revision.Nov 12 2021, 6:41 AM
Pratik Borhade (PratikPB2123) created this revision.

Thanks for working on this one!

Looks good visually. @Hans Goudey (HooglyBoogly) could you please check if the code is alright? Thanks!

Hans Goudey (HooglyBoogly) requested changes to this revision.Nov 12 2021, 7:11 PM

Unfortunately I don't think this is the right solution. While this might work for this case, we shouldn't resort to string comparisons of panel identifiers to solve issues like this.
Further, it seems to move all panels (in the second screenshot) in a way I don't think is actually desired, unless I'm missing something.

I'm not sure, but there must be something different about the floating redo region, some way to have that data in the right place that makes semantic sense.

This revision now requires changes to proceed.Nov 12 2021, 7:11 PM

Hi, thanks for reviewing

string comparisons of panel identifiers to solve issues

Agree. Comparing string is not the best way to fix this alignment issue. I could not see any other way to bypass the margin so I did.

it seems to move all panels (in the second screenshot)

Panels are not moving actually. It's just me taking bad screenshots.

but there must be something different about the floating redo region, some way to have that data in the right place

May be interface_region_hud.c?

source/blender/editors/interface/interface_panel.c
1753

I can replace string comparison with

 if ((region->regiontype & RGN_TYPE_HUD) == 0) {
      y -= UI_PANEL_MARGIN_Y;
}

Feel free to commit the fix if this is not correct

Pratik Borhade (PratikPB2123) abandoned this revision.EditedNov 25 2021, 5:20 PM

Julian committed fix so closing this patch: rB5514ca58a4d4: Fix T92313: Heading of redo panel is not aligned properly

Thanks everyone for the review :)

Thanks for the patch, it took me a while to decide what the best way for this is. Eventually I realized we should add the margins only if there is a background, which fixes some other little regressions as mentioned in the commit.