Commit 488c4b74 authored by Eugene Popov's avatar Eugene Popov Committed by Nate Graham

[applets/taskmanager] Make the hover state clarifying, but not main

Summary:
I'm trying to make a custom appearance of the Task Manager by creating a new theme, but I ran into some issue. I expected that there are three main states (minimized, normal and active) and one clarifying state (hover). But I was surprised to find that there are four main states (minimized, normal, active and hover), and the hover state is also main, but not clarifying. I believe that the hover state should be clarifying for the main states, i.e. there must be three main states (minimized, normal and active) and three additional (minimzed-hover, normal-hover, active-hover).

BUG: 418318

See https://phabricator.kde.org/P555

Reviewers: davidedmundson, #vdg

Reviewed By: davidedmundson

Subscribers: broulik, ngraham, epopov, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28306
parent e2b8dae7
......@@ -324,8 +324,9 @@ MouseArea {
}
imagePath: "widgets/tasks"
property bool isHovered: task.highlighted && plasmoid.configuration.taskHoverEffect
property string basePrefix: "normal"
prefix: TaskTools.taskPrefix(basePrefix)
prefix: isHovered ? TaskTools.taskPrefixHovered(basePrefix) : TaskTools.taskPrefix(basePrefix)
PlasmaCore.ToolTipArea {
id: toolTipArea
......@@ -541,15 +542,6 @@ MouseArea {
basePrefix: ""
}
},
State {
name: "hovered"
when: task.highlighted && frame.hasElementPrefix("hover") && plasmoid.configuration.taskHoverEffect
PropertyChanges {
target: frame
basePrefix: "hover"
}
},
State {
name: "attention"
when: model.IsDemandingAttention === true || (task.smartLauncherItem && task.smartLauncherItem.urgent)
......
......@@ -163,3 +163,16 @@ function taskPrefix(prefix) {
}
return [effectivePrefix, prefix];
}
function taskPrefixHovered(prefix) {
var effectivePrefix = taskPrefix(prefix);
if ("" !== prefix)
effectivePrefix = [
...taskPrefix(prefix + "-hover"),
...taskPrefix("hover"),
...effectivePrefix
];
return effectivePrefix;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment