Page MenuHome

Fix T95709: Improve pulldown menu corner rounding
Needs ReviewPublic

Authored by Leon Schittek (lone_noel) on May 6 2021, 12:30 AM.
Tags
Subscribers
None
Tokens
"Like" token, awarded by DiogoX2."Like" token, awarded by SHEK3."Like" token, awarded by PratikPB2123."Like" token, awarded by Fracture128.

Details

Summary

This patch refines the current logic for rounding the menu corners of
pulldown menus.

Currently we only check, whether the menu is drawn above/below the
button and then round the top/bottom corners. The patch extends the
behavior so all corners of the pulldown menu that are not directly
attached to the button it's spawned from are rounded.


currentpatch (roundness = 0.4)patch (roundness = 1.0)

From my testing the current implementation handles all corner cases and
overall behaves the way I want it to.

On the other hand I feel this is a bit of a hack.
The implementation works by not only storing one direction for the block
of the pulldown to note if it's above of below the button, but also an
additional direction flag to know, how the pulldown is aligned to the
button: is it left-aligned, right-aligned or not aligned at all.
Because currently pulldown menus are either drawn above or below the
button emitting them, we can get away with storing both direction flags
in block->direction by assuming that up/down is the primary direction
and then only using the left/right flag to round the remaining corner,
if it doesn't sit flush with the button.

Diff Detail

Repository
rB Blender
Branch
ui-pulldown-corners (branched from master)
Build Status
Buildable 14400
Build 14400: arc lint + arc unit

Event Timeline

Leon Schittek (lone_noel) requested review of this revision.May 6 2021, 12:30 AM
Leon Schittek (lone_noel) created this revision.
Leon Schittek (lone_noel) added projects: User Interface, Restricted Project.
  • Fix rounded menu corner sometimes clipping underneath the button.
  • Format and small clean-ups.
  • Update to latest master.
  • Remove unnecessary #define.
Leon Schittek (lone_noel) retitled this revision from (WIP) UI: Improve pulldown menu corner rounding to Fix T95709: Improve pulldown menu corner rounding.Feb 12 2022, 10:44 AM
Leon Schittek (lone_noel) edited the summary of this revision. (Show Details)
Leon Schittek (lone_noel) edited the summary of this revision. (Show Details)