Line 0
Link Here
|
|
|
1 |
diff --git plasma/generic/applets/systemtray/package/contents/ui/IconsList.qml plasma/generic/applets/systemtray/package/contents/ui/IconsList.qml |
2 |
index 336cff2..c1588bf 100644 |
3 |
--- plasma/generic/applets/systemtray/package/contents/ui/IconsList.qml |
4 |
+++ plasma/generic/applets/systemtray/package/contents/ui/IconsList.qml |
5 |
@@ -34,13 +34,13 @@ MouseArea { |
6 |
|
7 |
property int icons_size: 24 ///< Size of icons, icons are square i.e. width == height |
8 |
property int icons_margins: 4 ///< Margins for icons |
9 |
- property alias icons_number: repeater.count ///< [readonly] Number of icons |
10 |
- property alias model: repeater.model; ///< Model for grid |
11 |
+ property alias icons_number: list.count ///< [readonly] Number of icons |
12 |
+ property alias model: list.model; ///< Model for grid |
13 |
property int cell_size: icons_size + 2*icons_margins ///< [readonly] size of grid cell |
14 |
|
15 |
//Those properties are used by PlasmaCore.Dialog for size hints |
16 |
- property int minimumWidth: layoutColumn.childrenRect.width ///< [readonly] minimum width of component required to show whole grid |
17 |
- property int minimumHeight: layoutColumn.childrenRect.height ///< [readonly] minimum height of compontn required to show whole grid |
18 |
+ property int minimumWidth: list.contentItem.childrenRect.width ///< [readonly] minimum width of component required to show whole grid |
19 |
+ property int minimumHeight: list.contentItem.childrenRect.height ///< [readonly] minimum height of compontn required to show whole grid |
20 |
property int maximumWidth: minimumWidth |
21 |
property int maximumHeight: minimumHeight |
22 |
|
23 |
@@ -53,6 +53,7 @@ MouseArea { |
24 |
id: delegate_root_item |
25 |
width: childrenRect.width |
26 |
height: childrenRect.height |
27 |
+ z: 0 |
28 |
|
29 |
// we redirect some events to IconWidget or applet |
30 |
target: task.type == TypeStatusItem ? ui_item.getMouseArea() : task |
31 |
@@ -63,8 +64,9 @@ MouseArea { |
32 |
onClickRight: ui_item.click(Qt.RightButton) |
33 |
onScrollVert: ui_item.scrollVert(delta) |
34 |
onScrollHorz: ui_item.scrollHorz(delta) |
35 |
- onEntered: { |
36 |
- delegate_highlight.y = delegate_root_item.y |
37 |
+ onChangedMousePos: { |
38 |
+ var pos = mapToItem(list.contentItem, mouseX, mouseY) |
39 |
+ list.currentIndex = list.indexAt(pos.x, pos.y) |
40 |
} |
41 |
|
42 |
Row { |
43 |
@@ -108,38 +110,42 @@ MouseArea { |
44 |
} |
45 |
|
46 |
} |
47 |
- |
48 |
} |
49 |
|
50 |
|
51 |
|
52 |
- PlasmaWidgets.ItemBackground { |
53 |
+ Component { |
54 |
id: delegate_highlight |
55 |
- height: cell_size |
56 |
- width: minimumWidth |
57 |
- |
58 |
- opacity: root_item.containsMouse |
59 |
- Behavior on opacity { |
60 |
- NumberAnimation { |
61 |
- duration: 150 |
62 |
- easing: Easing.InOutQuad |
63 |
+ Item { |
64 |
+ height: cell_size |
65 |
+ width: minimumWidth |
66 |
+ |
67 |
+ PlasmaWidgets.ItemBackground { |
68 |
+ anchors.fill: parent |
69 |
} |
70 |
- } |
71 |
- Behavior on y { |
72 |
- NumberAnimation { |
73 |
- duration: 250 |
74 |
- easing: Easing.InOutQuad |
75 |
+ opacity: root_item.containsMouse |
76 |
+ Behavior on opacity { |
77 |
+ NumberAnimation { |
78 |
+ duration: 150 |
79 |
+ easing: Easing.InOutQuad |
80 |
+ } |
81 |
} |
82 |
} |
83 |
} |
84 |
|
85 |
- |
86 |
- Column { |
87 |
- id: layoutColumn |
88 |
+ ListView { |
89 |
+ id: list |
90 |
+ anchors.fill: parent |
91 |
+ //never delete items |
92 |
+ cacheBuffer: 1000 |
93 |
+ |
94 |
+ interactive: false |
95 |
+ delegate: delegate_task |
96 |
+ highlight: delegate_highlight |
97 |
+ highlightFollowsCurrentItem: true |
98 |
+ highlightMoveSpeed: -1 |
99 |
+ highlightMoveDuration: 250 |
100 |
spacing: 0 |
101 |
- Repeater { |
102 |
- id: repeater |
103 |
- delegate: delegate_task |
104 |
- } |
105 |
+ snapMode: ListView.SnapToItem |
106 |
} |
107 |
} |
108 |
diff --git plasma/generic/applets/systemtray/ui/mouseredirectarea.cpp plasma/generic/applets/systemtray/ui/mouseredirectarea.cpp |
109 |
index 753ece9..1abc798 100644 |
110 |
--- plasma/generic/applets/systemtray/ui/mouseredirectarea.cpp |
111 |
+++ plasma/generic/applets/systemtray/ui/mouseredirectarea.cpp |
112 |
@@ -146,14 +146,12 @@ void MouseRedirectArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) |
113 |
void MouseRedirectArea::hoverEnterEvent(QGraphicsSceneHoverEvent *event) |
114 |
{ |
115 |
forwardEvent(event); |
116 |
- emit entered(); |
117 |
} |
118 |
|
119 |
|
120 |
void MouseRedirectArea::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) |
121 |
{ |
122 |
forwardEvent(event); |
123 |
- emit exited(); |
124 |
} |
125 |
|
126 |
void MouseRedirectArea::hoverMoveEvent(QGraphicsSceneHoverEvent *event) |
127 |
diff --git plasma/generic/applets/systemtray/ui/mouseredirectarea.h plasma/generic/applets/systemtray/ui/mouseredirectarea.h |
128 |
index 15d114a..f05f7a6 100644 |
129 |
--- plasma/generic/applets/systemtray/ui/mouseredirectarea.h |
130 |
+++ plasma/generic/applets/systemtray/ui/mouseredirectarea.h |
131 |
@@ -67,8 +67,6 @@ signals: |
132 |
void scrollVert(int delta); |
133 |
void scrollHorz(int delta); |
134 |
void changedMousePos(qreal mouseX, qreal mouseY); |
135 |
- void entered(); |
136 |
- void exited(); |
137 |
|
138 |
private: //Events |
139 |
virtual void wheelEvent(QGraphicsSceneWheelEvent *event); |