D17975: [Notifications] Add padding to notifications

Root noreply at phabricator.kde.org
Thu Jan 10 03:55:19 GMT 2019


rooty added a comment.


  In D17975#390336 <https://phabricator.kde.org/D17975#390336>, @rooty wrote:
  
  > Is there a way to give the icon itself padding? I've been using anchors but there's nothing I can think of to anchor it to? If I anchor it to the notification text in any way, I can add a margin, sure, but it gets //stretched out beyond belief// if there's too much text.
  
  
  AFter playing around with the code (I'm still very new to this), I came up with this:
  
    PlasmaCore.IconItem {
        id: appIconItem
    
        width: (bodyText.lineCount > 1) ? units.iconSizes.large : (notificationItem.height - 2 * units.smallSpacing)
        height: (bodyText.lineCount > 1) ? units.iconSizes.large : (notificationItem.height - 2 * units.smallSpacing) 
  
  And a dozen binding loops later (wow!) the padding is indeed even with one heading + one line of description, regardless of what font is used (and the icon is still a square). And it looks fine with 1x, 1.5x, 2x, 2.5x scaling set up, but when it's 1.1, 1.2 etc. or the font is >10 pt in size, the icon is larger when the lineCount is 1 than when the line count is greater than 1.
  
  This solution seems very strange/crude to me though, and it's not without its downsides.

REPOSITORY
  R120 Plasma Workspace

BRANCH
  master

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

To: rooty, #vdg, #plasma, ngraham, davidedmundson
Cc: broulik, Codezela, abetts, filipf, davidedmundson, hein, ndavis, plasma-devel, kvanton, 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/20190110/57ffc73b/attachment-0001.html>


More information about the Plasma-devel mailing list