D19036: [notifications] Lift up notification content if one line of body text droops

Nathaniel Graham noreply at phabricator.kde.org
Fri Feb 15 15:58:26 GMT 2019


ngraham added a comment.


  In D19036#412809 <https://phabricator.kde.org/D19036#412809>, @rooty wrote:
  
  > I hope I didn't mess up the syntax... Do you prefer this to the ternary operator?
  >
  >   function adjustHeight()
  >   {
  >       var layoutHeight = mainLayout.height
  >       if (bodyText.lineCount > 1) layoutHeight = mainLayout.height
  >         else if (appIconItem.valid || imageItem.nativeWidth > 0) {
  >           layoutHeight = Math.max((mainLayout.height + 1.5 * units.smallSpacing),(units.iconSizes.large + 2 * units.smallSpacing))
  >           } else if (bottomPart.height != 0) {
  >               if (mainLayout.height > units.iconSizes.large) {
  >                 layoutHeight = mainLayout.height + 1.5 * units.smallspacing }
  >                   else layoutHeight = mainLayout.height + 2 * units.smallSpacing }
  >                     else layoutHeight = mainLayout.height + units.smallSpacing // because of the close button
  >       return layoutHeight
  >   }
  >  
  >   implicitHeight: adjustHeight()
  >   
  >   
  
  
  Can you use the typical KDE coding style for if/else blocks?
  
    if (thing) {
        //do stuff
    } else {
        if (other_thing) {
            // do other stuff
        } else {
            // lots of stuff
        }
    }

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D19036

To: rooty, #plasma, #vdg
Cc: ngraham, abetts, broulik, plasma-devel, jraleigh, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190215/1d682154/attachment-0001.html>


More information about the Plasma-devel mailing list