Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Desktop
Commits
d3c1366f
Commit
d3c1366f
authored
Mar 25, 2021
by
David Edmundson
Browse files
Use smarter hover activation
See
plasma-workspace!741
parent
70f8d100
Changes
2
Hide whitespace changes
Inline
Side-by-side
applets/kickoff/package/contents/ui/ApplicationsGroupView.qml
View file @
d3c1366f
...
...
@@ -22,6 +22,7 @@
import
QtQuick
2.0
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
import
org
.
kde
.
plasma
.
components
3.0
as
PlasmaComponents3
import
org
.
kde
.
plasma
.
private
.
kicker
0.1
as
Kicker
FocusScope
{
id
:
appViewContainer
...
...
@@ -68,37 +69,43 @@ FocusScope {
}
}
KickoffListView
{
id
:
applicationsView
isManagerMode
:
true
Kicker.TriangleMouseFilter
{
anchors.fill
:
parent
property
Item
activatedItem
:
null
property
var
newModel
:
null
edge
:
LayoutMirroring
.
enabled
?
Qt
.
LeftEdge
:
Qt
.
RightEdge
Behavior
on
opacity
{
NumberAnimation
{
duration
:
PlasmaCore
.
Units
.
longDuration
easing.type
:
Easing
.
InOutQuad
KickoffListView
{
id
:
applicationsView
isManagerMode
:
true
anchors.fill
:
parent
property
Item
activatedItem
:
null
property
var
newModel
:
null
Behavior
on
opacity
{
NumberAnimation
{
duration
:
PlasmaCore
.
Units
.
longDuration
easing.type
:
Easing
.
InOutQuad
}
}
}
focus
:
true
focus
:
true
appView
:
true
appView
:
true
model
:
rootModel
model
:
rootModel
function
moveRight
()
{
var
childModel
=
activatedItem
.
activate
()
if
(
childModel
!=
null
)
{
appViewContainer
.
activatedSection
=
childModel
.
model
appViewContainer
.
newBreadcrumbName
=
childModel
.
name
appViewContainer
.
appModelChange
()
function
moveRight
()
{
var
childModel
=
activatedItem
.
activate
()
if
(
childModel
!=
null
)
{
appViewContainer
.
activatedSection
=
childModel
.
model
appViewContainer
.
newBreadcrumbName
=
childModel
.
name
appViewContainer
.
appModelChange
()
}
}
}
onReset
:
appViewContainer
.
reset
()
onReset
:
appViewContainer
.
reset
()
}
}
// Displays text when application list gets updated
...
...
applets/kickoff/package/contents/ui/KickoffListView.qml
View file @
d3c1366f
...
...
@@ -113,20 +113,6 @@ FocusScope {
repeat
:
false
}
Timer
{
id
:
delayedActivation
// interaction time needs to be a constant
interval
:
250
repeat
:
false
property
int
indexToGoTo
:
-
1
onTriggered
:
{
if
(
indexToGoTo
!==
-
1
)
{
listView
.
currentIndex
=
indexToGoTo
indexToGoTo
=
-
1
}
}
}
PC3.ScrollView
{
anchors.fill
:
parent
PC3.ScrollBar.horizontal.visible
:
false
...
...
@@ -248,13 +234,6 @@ FocusScope {
hoverEnabled
:
true
acceptedButtons
:
Qt
.
LeftButton
|
Qt
.
RightButton
onExited
:
{
if
(
view
.
isManagerMode
||
view
.
isExternalManagerMode
)
{
delayedActivation
.
stop
();
delayedActivation
.
indexToGoTo
=
-
1
;
}
}
onPressed
:
{
var
mapped
=
listView
.
mapToItem
(
listView
.
contentItem
,
mouse
.
x
,
mouse
.
y
);
var
item
=
listView
.
itemAt
(
mapped
.
x
,
mapped
.
y
);
...
...
@@ -320,12 +299,7 @@ FocusScope {
}
}
if
(
kickoff
.
dragSource
==
null
||
kickoff
.
dragSource
==
item
)
{
if
((
!
view
.
isManagerMode
&&
!
view
.
isExternalManagerMode
)
||
changedIndexRecently
.
running
||
mouse
.
source
==
Qt
.
MouseEventSynthesizedByQt
)
{
listView
.
currentIndex
=
item
.
itemIndex
;
}
else
{
delayedActivation
.
indexToGoTo
=
item
.
itemIndex
;
delayedActivation
.
start
()
}
listView
.
currentIndex
=
item
.
itemIndex
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment