D27465: Make the icon hitboxes for the System Tray Plasmoid larger when Kirigami Tablet Mode is enabled

Nathaniel Graham noreply at phabricator.kde.org
Tue Feb 18 01:27:52 GMT 2020


ngraham added inline comments.

INLINE COMMENTS

> main.qml:47
> +            // Set the tray items' clickable areas on the panel to be bigger than normal to allow for easier touchability
> +            return units.roundToIconSize(Math.min(Math.min(width, height), units.iconSizes[iconSizes[Math.min(iconSizes.length-1, iconSize)]])) + units.smallSpacing;
> +        } else {

Rather than repeating this long calculation twice, assign it to a variable called `baseSize` or something and then vary it in the return statements:

  if (Kirigami.Settings.tabletMode) {
      return baseSize + units.smallSpacing;
  } else {
      return baseSize;
  }

Also keep in mind that adding `units.smallSpacing` once will result in half that value amount being added to all sides. If you want to add `units.smallSpacing` to all sides, you'll need to add `units.smallSpacing * 2`

REPOSITORY
  R120 Plasma Workspace

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

To: The-Feren-OS-Dev, ngraham, #vdg
Cc: davidre, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200218/a2f92ab1/attachment.html>


More information about the Plasma-devel mailing list