Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/Task.qml
Show First 20 Lines • Show All 318 Lines • ▼ Show 20 Line(s) | 317 | anchors { | |||
---|---|---|---|---|---|
319 | 319 | | |||
320 | topMargin: (!tasks.vertical && taskList.rows > 1) ? units.smallSpacing / 4 : 0 | 320 | topMargin: (!tasks.vertical && taskList.rows > 1) ? units.smallSpacing / 4 : 0 | ||
321 | bottomMargin: (!tasks.vertical && taskList.rows > 1) ? units.smallSpacing / 4 : 0 | 321 | bottomMargin: (!tasks.vertical && taskList.rows > 1) ? units.smallSpacing / 4 : 0 | ||
322 | leftMargin: ((inPopup || tasks.vertical) && taskList.columns > 1) ? units.smallSpacing / 4 : 0 | 322 | leftMargin: ((inPopup || tasks.vertical) && taskList.columns > 1) ? units.smallSpacing / 4 : 0 | ||
323 | rightMargin: ((inPopup || tasks.vertical) && taskList.columns > 1) ? units.smallSpacing / 4 : 0 | 323 | rightMargin: ((inPopup || tasks.vertical) && taskList.columns > 1) ? units.smallSpacing / 4 : 0 | ||
324 | } | 324 | } | ||
325 | 325 | | |||
326 | imagePath: "widgets/tasks" | 326 | imagePath: "widgets/tasks" | ||
327 | property bool isHovered: task.highlighted && plasmoid.configuration.taskHoverEffect | ||||
327 | property string basePrefix: "normal" | 328 | property string basePrefix: "normal" | ||
328 | prefix: TaskTools.taskPrefix(basePrefix) | 329 | prefix: isHovered ? TaskTools.taskPrefixHovered(basePrefix) : TaskTools.taskPrefix(basePrefix) | ||
329 | 330 | | |||
330 | PlasmaCore.ToolTipArea { | 331 | PlasmaCore.ToolTipArea { | ||
davidedmundson: this is a bit longwinded, can we make a function in TasksTools? | |||||
We can use ECMAScript 6 now, use spread syntax: return [ ...TaskTools.taskPrefix(etc), ...foo, ...bar ]; Note the ... broulik: We can use ECMAScript 6 now, use spread syntax:
```
return [
...TaskTools.taskPrefix(etc)… | |||||
TaskTools.taskPrefix(...) returns an array, so it will be an array-of-arrays epopov: TaskTools.taskPrefix(...) returns an array, so it will be an array-of-arrays | |||||
epopov: Ah, now I understand. It looks amazing. | |||||
331 | id: toolTipArea | 332 | id: toolTipArea | ||
332 | 333 | | |||
333 | anchors.fill: parent | 334 | anchors.fill: parent | ||
334 | location: plasmoid.location | 335 | location: plasmoid.location | ||
335 | 336 | | |||
336 | active: !inPopup && !groupDialog.visible && plasmoid.configuration.showToolTips | 337 | active: !inPopup && !groupDialog.visible && plasmoid.configuration.showToolTips | ||
337 | interactive: true | 338 | interactive: true | ||
338 | 339 | | |||
▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Line(s) | 536 | State { | |||
537 | when: model.IsLauncher === true | 538 | when: model.IsLauncher === true | ||
538 | 539 | | |||
539 | PropertyChanges { | 540 | PropertyChanges { | ||
540 | target: frame | 541 | target: frame | ||
541 | basePrefix: "" | 542 | basePrefix: "" | ||
542 | } | 543 | } | ||
543 | }, | 544 | }, | ||
544 | State { | 545 | State { | ||
545 | name: "hovered" | | |||
546 | when: task.highlighted && frame.hasElementPrefix("hover") && plasmoid.configuration.taskHoverEffect | | |||
547 | | ||||
548 | PropertyChanges { | | |||
549 | target: frame | | |||
550 | basePrefix: "hover" | | |||
551 | } | | |||
552 | }, | | |||
553 | State { | | |||
554 | name: "attention" | 546 | name: "attention" | ||
555 | when: model.IsDemandingAttention === true || (task.smartLauncherItem && task.smartLauncherItem.urgent) | 547 | when: model.IsDemandingAttention === true || (task.smartLauncherItem && task.smartLauncherItem.urgent) | ||
556 | 548 | | |||
557 | PropertyChanges { | 549 | PropertyChanges { | ||
558 | target: frame | 550 | target: frame | ||
559 | basePrefix: "attention" | 551 | basePrefix: "attention" | ||
560 | } | 552 | } | ||
561 | }, | 553 | }, | ||
Show All 33 Lines |
this is a bit longwinded, can we make a function in TasksTools?