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

Authored by The-Feren-OS-Dev on Feb 17 2020, 8:53 PM.

Details

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
  1. Tablet Mode increases tray icon spacing
  1. 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
  1. Check that when Kirigami.Settings.tabletMode is enabled the system tray icon click areas become slightly larger in size

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22600
Build 22618: arc lint + arc unit
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 17 2020, 8:53 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
The-Feren-OS-Dev requested review of this revision.Feb 17 2020, 8:53 PM
The-Feren-OS-Dev retitled this revision from Added foundations for two future patches to complete the splitting of patch D27438 to Add foundations for two future patches to complete the splitting of patch D27438.

Do your second step here imo

Make the click areas of system tray icons larger in Kirigami Tablet Mode

The-Feren-OS-Dev edited the summary of this revision. (Show Details)Feb 17 2020, 9:14 PM
The-Feren-OS-Dev edited the test plan for this revision. (Show Details)
The-Feren-OS-Dev edited reviewers, added: VDG; removed: Plasma.
The-Feren-OS-Dev retitled this revision from Add foundations for two future patches to complete the splitting of patch D27438 to Make the icon hitboxes for the System Tray Plasmoid larger when Kirigami Tablet Mode is enabled.

Got rid of unnecessary rounding of smallSpacing at the end of the Tablet Mode padding addition

The-Feren-OS-Dev edited the summary of this revision. (Show Details)Feb 17 2020, 9:42 PM
ngraham added inline comments.Feb 18 2020, 1:27 AM
applets/systemtray/package/contents/ui/main.qml
47

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

Tidied up code a bit and introduced new baseSize variable - Slightly increase system tray icon hitboxes in Non Tablet Mode Plasma

ngraham added inline comments.Feb 18 2020, 2:37 AM
applets/systemtray/package/contents/ui/main.qml
44–51

this doesn't need to be a property; just make it a variable (var baseSize = ...) inside the new inline function itself.

The-Feren-OS-Dev marked an inline comment as done.

Moved baseSize declaration and changed it to a standard variable

ngraham accepted this revision.Feb 18 2020, 2:48 PM
ngraham added a reviewer: Plasma.

LGTM. Plasma folks, is this all technically correct?

This revision is now accepted and ready to land.Feb 18 2020, 2:48 PM
niccolove accepted this revision.Feb 29 2020, 1:11 PM
This revision was automatically updated to reflect the committed changes.