D11175: [WIP][kstyle] refine shadows

Hugo Pereira Da Costa noreply at phabricator.kde.org
Fri Mar 9 21:12:32 UTC 2018


hpereiradacosta added a comment.


  In D11175#222124 <https://phabricator.kde.org/D11175#222124>, @zzag wrote:
  
  > 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.
  
  
  But then, this code is compiled in a separate library ? 
  How is it linked against the kstyle code ? Doesn't that require changes to CMakeLists ? I'm confused. 
  (sorry if I missed something: I have not had the time to actually try apply the patches and compile them).
  
  > I believe I could solve this by creating a bunch of classes, but it would complicate things a lot more.
  > 
  > //Update//
  >  IMHO, DRY obsession is good, but in this case it would make things worse.
  
  So that means that the code is not actually shared, but copied ? I am fine with this also, I just don't see how it works here . 
  Not sure I understand what you mean by DRY obsession ?
  
  >> 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

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180309/37f75abe/attachment.html>


More information about the Plasma-devel mailing list