zzag added a comment.
In D11175#222001 <https://phabricator.kde.org/D11175#222001>, @hpereiradacosta wrote: > I am confused. Where is the shadow rending code ? `BoxShadowHelper::boxShadow()` does pretty much all rendering. > How is it shared between style and deco ? Only box shadow rendering is shared. It's not obvious to me what I can share beside that. Params? Then shadow paint function should receive qpainter and the params. What about QMargins? They will be calculated twice and it also would require copying logic between kstyle, kdecoration, and libbreezecommon. The same applies to the top-left corner of the shadow inner rect and size of it. Also, kdecoration renders outline while kstyle not. I believe I could solve this by creating a bunch of classes, but it would complicate things a lot more. > In general, the sharing should be a separate patch, that could be applied even with the current shadows, before modifying how shadows are drawn ... > That would make a two steps patch: first share shadow code (with existing shadow) between kstyle and decoration, then modify shadow code. > > Some more comments will follow INLINE COMMENTS > hpereiradacosta wrote in breezeshadowhelper.cpp:145 > ok. I know this whole chunc of code is to make it look like css, but this is > ugly sorry. > The fact that you need to repeat all the member names for each new set of > parameters is not maintainable in the long run. Please add a proper > constructor to the structure (with three params), and use this to initialize > the various sets of parameters. > Idem in the kdecoration. No, I just prefer this method of initialization of structs. IMHO, it's more readable. I'll see what I can do. PS. I'd say it looks like js. REPOSITORY R31 Breeze REVISION DETAIL https://phabricator.kde.org/D11175 To: zzag, #breeze, #vdg, hpereiradacosta Cc: ngraham, plasma-devel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart