Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
glacier-home
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
glacier-home
Commits
f49af7f5
Commit
f49af7f5
authored
Jul 08, 2017
by
eekkelund
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AppLauncher] Add removing from folder. Add folder destruction if less than 2 items in folder
parent
36070da9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
LauncherItemFolder.qml
src/qml/LauncherItemFolder.qml
+2
-2
LauncherItemWrapper.qml
src/qml/LauncherItemWrapper.qml
+21
-3
No files found.
src/qml/LauncherItemFolder.qml
View file @
f49af7f5
...
...
@@ -94,7 +94,7 @@ Item {
id
:
folderLoader
property
Item
reorderItem
property
bool
isRootFolder
:
false
cacheBuffer
:
gridview
.
contentHeight
cacheBuffer
:
folderLoader
.
contentHeight
parent
:
gridview
.
contentItem
y
:
wrapper
.
y
+
wrapper
.
width
x
:
0
...
...
@@ -109,7 +109,7 @@ Item {
width
:
parent
.
width
height
:
parent
.
height
opacity
:
0.85
color
:
"
white
"
color
:
triangle
.
color
radius
:
Theme
.
itemSpacingMedium
z
:
-
1
}
...
...
src/qml/LauncherItemWrapper.qml
View file @
f49af7f5
...
...
@@ -51,7 +51,7 @@ MouseArea {
onYChanged
:
moved
()
drag.minimumX
:
parentItem
.
contentItem
.
x
-
width
/
2
drag.maximumX
:
parentItem
.
contentItem
.
width
+
width
/
2
drag.minimumY
:
parentItem
.
contentItem
.
y
-
height
/
2
drag.minimumY
:
parentItem
.
contentItem
.
y
-
height
/
2
-
height
/
4
drag.maximumY
:
parentItem
.
contentItem
.
height
+
height
/
2
onClicked
:
{
...
...
@@ -83,8 +83,8 @@ MouseArea {
onReleased
:
{
if
(
reordering
)
{
reorderEnded
()
reordering
=
false
reorderEnded
()
reorderTimer
.
stop
()
drag
.
target
=
null
reorderItem
=
null
...
...
@@ -165,6 +165,12 @@ MouseArea {
folderIndex
=
-
1
newFolderActive
=
false
}
//To drop appicon out of the folder
var
realY
=
parseInt
(
parentItem
.
mapFromItem
(
launcherItem
,
0
,
0
).
y
)
+
parseInt
(((
launcherItem
.
height
*
launcherItem
.
scale
-
launcherItem
.
height
)
/
2
).
toFixed
(
2
))
if
(
!
parent
.
isRootFolder
&&
(
realY
<
-
Math
.
abs
(
launcherItem
.
height
/
2
)
||
realY
>
parentItem
.
height
))
{
var
parentFolderIndex
=
folderModel
.
parentFolder
.
indexOf
(
folderModel
)
folderModel
.
parentFolder
.
moveToFolder
(
modelData
.
object
,
folderModel
.
parentFolder
,
parentFolderIndex
+
1
)
}
}
Timer
{
...
...
@@ -195,7 +201,19 @@ MouseArea {
NumberAnimation
{
target
:
launcherItem
;
property
:
"
y
"
;
to
:
wrapper
.
y
;
duration
:
130
;
easing.type
:
Easing
.
OutQuint
}
}
Connections
{
target
:
modelData
.
object
ignoreUnknownSignals
:
true
onItemRemoved
:
{
var
modelDataObject
=
modelData
.
object
//If there is only one item in folder, remove the folder
if
(
modelDataObject
.
itemCount
===
1
)
{
var
parentFolderIndex
=
modelDataObject
.
parentFolder
.
indexOf
(
modelDataObject
)
modelDataObject
.
parentFolder
.
moveToFolder
(
modelDataObject
.
get
(
0
),
modelDataObject
.
parentFolder
,
parentFolderIndex
)
modelDataObject
.
destroyFolder
()
}
}
}
Item
{
id
:
iconWrapper
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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