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

Summary:
@ngraham recommended that I split up https://phabricator.kde.org/D27438 into three patches:

1. The foundation code to get landed first so that the other two patches can be done as patches that change two separate lines instead of just one

2. Tablet Mode increases tray icon spacing

3. Increase tray icon spacing slightly on Non-Tablet Mode (half of the amount it increases by in Tablet Mode)

This patch integrates both patch 1 and 2 of what ngraham recommended to make system tray icon click areas larger when Kirigami's Tablet Mode setting is true than they normally are.

Test Plan:
1. Test that System Tray still works after these changes have been made

2. Check that when Kirigami.Settings.tabletMode is enabled the system tray icon click areas become slightly larger in size

Reviewers: ngraham, #vdg, #plasma, niccolove

Reviewed By: ngraham, #vdg, niccolove

Subscribers: davidre, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D27465
wilder-portage-prov
Dominic Hayes 6 years ago committed by Nate Graham
parent 731a190810
commit 9e0711ac40
  1. 10
      applets/systemtray/package/contents/ui/main.qml

@ -41,7 +41,15 @@ MouseArea {
property int iconSize: plasmoid.configuration.iconSize + (Kirigami.Settings.tabletMode ? 1 : 0)
property bool vertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
readonly property int itemSize: units.roundToIconSize(Math.min(Math.min(width, height), units.iconSizes[iconSizes[Math.min(iconSizes.length-1, iconSize)]]))
readonly property int itemSize: {
var baseSize = units.roundToIconSize(Math.min(Math.min(width, height), units.iconSizes[iconSizes[Math.min(iconSizes.length-1, iconSize)]]));
if (Kirigami.Settings.tabletMode) {
// Set the tray items' clickable areas on the panel to be bigger than normal to allow for easier touchability
return baseSize + units.smallSpacing;
} else {
return baseSize;
}
}
property int hiddenItemSize: units.iconSizes.smallMedium
property alias expanded: dialog.visible
property Item activeApplet

Loading…
Cancel
Save