Skip to content

Draft: Avatar: Demote to pure graphics-only item

ivan tkachenko requested to merge work/ratijas/the-way-of-water into master

Actions were rarely used, with secondary action nowhere to be found in maintained KDE software. All this custom behavior can be replaced by a regular QQC2 button with Avatar as its contentItem component.

Now we don't have to worry about padding, focus management and mouse & keyboard interactions, yay!

The real content of this component is not square-sized to fit in the parent rather than being stretched in cases when Avatar for some reason has rectangular size. Private properties are uplifted to the root component and prefixed with double underscore to indicate that they are indeed still private: it was wasteful to allocate an extra object just for them, and it was making life harder when debugging in GammaRay.

Implementation note: radius of rectangles was simplified to not divide size by 2 anymore. The reason is that Rectangle will not be more round than that anyway, so the code is just simpler and less prone to rounding errors.


See #50 for more.

Note on this MR: I'm still hesitant about refactoring __textColor property. Why wasn't its expression bound straight to defaultInitialsColor property? Why is it being used for avatarIcon.color without accounting for initialsColor like text component does? @melvo

Merge request reports