Add the option to show the current activity name and icon
ClosedPublic

Authored by ivan on Mar 19 2020, 10:16 AM.

Details

Summary

The current activity switching applet shows a generic icon that
opens the activity switcher which does not offer any information
on the current activity. This does not go well with other applets
like desktop pager.

This patch adds options (on by default) to show the current activity
icon and name in the applet.

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ivan created this revision.Mar 19 2020, 10:16 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 19 2020, 10:16 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ivan requested review of this revision.Mar 19 2020, 10:16 AM
ivan added a comment.Mar 19 2020, 10:20 AM

Screenshot:

Pretty nice! I wonder if we even need an option for the activity option though. How about this: if the activity has an icon, always show it. If it doesn't, show the generic one. That would probably satisfy everyone automatically, by re-using the user's preference with respect to icons for their activities.

Also in general it's nice to see Layouts used in new code as it tends to substantially simplify the width and height code for individual items.

applets/showActivityManager/package/contents/ui/ConfigAppearance.qml
37

this should instead be a Kirigami.FormData.label: i18n("Icon:") property set on radioCurrentActivityIcon`

54

this should instead be a Kirigami.FormData.label: i18n("Title:") property set on checkShowActivityName`

ivan added a comment.Mar 19 2020, 2:28 PM

The reason for the icon setting is to have full backwards compatibility. Maybe someone likes the static icon better than random icons they set for each activity. I don't like to have everything configurable, but here it is not a significant maintainance overhead, and the configuration dialogue would be quite dull with a single checkbox :)

ivan updated this revision to Diff 78006.Mar 19 2020, 2:33 PM

Kirigami has quite interesting features I must say :)

ngraham added inline comments.Mar 19 2020, 2:53 PM
applets/showActivityManager/package/contents/ui/ConfigAppearance.qml
49

I would add some whitespace between these, since they're different logical groups. You can easily do this with the following:

item { Kirigami.FormData.isSection: true }

ivan updated this revision to Diff 78014.Mar 19 2020, 3:17 PM
ivan marked 3 inline comments as done.

Done

ivan updated this revision to Diff 78018.Mar 19 2020, 3:25 PM

Last change - use "activities" icon if no icon is set (though this should not happen if the user creates the activity through legal ways)

ngraham accepted this revision.Mar 19 2020, 3:37 PM

Thanks!

I'd still prefer if main.qml used Layouts instead of Anchors, I also still think the option to show a generic icon is not really very useful; I have a hard time envisioning a user who manually sets icons for their activities but prefers to show a generic icon in the pager. However I don't use activities and it's your code, so your call. :)

This revision is now accepted and ready to land.Mar 19 2020, 3:37 PM
This revision was automatically updated to reflect the committed changes.
ivan added a comment.Mar 19 2020, 3:54 PM

used Layouts instead of Anchors

I know, I'm oldschool - when I was young, we didn't have QML, Kirigami and ... :)