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
51265a95
Commit
51265a95
authored
May 17, 2018
by
Sergey Chupligin
Committed by
Sergey Chupligin
May 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[AppLauncher] Rework search panel
parent
730971ed
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
373 additions
and
303 deletions
+373
-303
AppLauncher.qml
src/qml/AppLauncher.qml
+126
-258
MainScreen.qml
src/qml/MainScreen.qml
+2
-1
Deleter.qml
src/qml/applauncher/Deleter.qml
+187
-0
SearchListView.qml
src/qml/applauncher/SearchListView.qml
+43
-7
src.pro
src/src.pro
+15
-37
No files found.
src/qml/AppLauncher.qml
View file @
51265a95
// This file is part of colorful-home, a nice user experience for touchscreens.
// This file is part of colorful-home, a nice user experience for touchscreens.
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// Permission is hereby granted, free of charge, to any person obtaining a copy
...
@@ -22,308 +21,177 @@
...
@@ -22,308 +21,177 @@
// Copyright (c) 2011, Tom Swindell <t.swindell@rubyx.co.uk>
// Copyright (c) 2011, Tom Swindell <t.swindell@rubyx.co.uk>
// Copyright (c) 2012, Timur Kristóf <venemo@fedoraproject.org>
// Copyright (c) 2012, Timur Kristóf <venemo@fedoraproject.org>
// Copyright (c) 2017, Eetu Kahelin
// Copyright (c) 2017, Eetu Kahelin
// Copyright (c) 2018, Chupligin Sergey <neochapay@gmail.com>
import
QtQuick
2.6
import
QtQuick
2.6
import
org
.
nemomobile
.
lipstick
0.1
import
org
.
nemomobile
.
lipstick
0.1
import
org
.
nemomobile
.
configuration
1.0
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
"
applauncher
"
// App Launcher page
// App Launcher page
// the place for browsing installed applications and launching them
// the place for browsing installed applications and launching them
Flickable
{
GridView
{
id
:
appLauncher
id
:
gridview
width
:
parent
.
width
width
:
cellWidth
*
columns
height
:
desktop
.
height
cacheBuffer
:
gridview
.
contentHeight
property
Item
reorderItem
property
bool
onUninstall
property
alias
deleter
:
deleter
property
var
switcher
:
null
property
var
switcher
:
null
property
string
searchString
property
string
searchString
property
int
minCellSize
:
Theme
.
iconSizeLauncher
+
Theme
.
iconSizeLauncher
/
2
property
int
rows
:
Math
.
floor
(
parent
.
height
/
minCellSize
)
property
int
columns
:
Math
.
floor
(
parent
.
width
/
minCellSize
)
cellWidth
:
parent
.
width
/
columns
cellHeight
:
Math
.
round
(
parent
.
height
/
rows
)
property
int
folderIndex
:
-
1
ConfigurationValue
{
property
bool
isRootFolder
:
true
id
:
alwaysShowSearch
property
bool
newFolderActive
key
:
"
/home/glacier/appLauncher/alwaysShowSearch
"
property
bool
newFolder
:
newFolderActive
&&
isRootFolder
&&
folderIndex
>=
0
defaultValue
:
true
clip
:
true
onContentYChanged
:
{
if
(
contentY
<
-
Theme
.
itemHeightHuge
*
2
)
{
headerItem
.
visible
=
true
;
timer
.
running
=
true
;
}
}
}
onSearchStringChanged
:
timer
.
restart
()
/*top search line*/
SearchListView
{
Timer
{
id
:
searchListView
id
:
timer
;
running
:
false
;
interval
:
7000
;
repeat
:
true
width
:
appLauncher
.
width
onTriggered
:
{
visible
:
alwaysShowSearch
if
(
searchString
.
length
<
1
)
headerItem
.
visible
=
false
Timer
{
id
:
searchListViewTimer
;
running
:
false
;
interval
:
7000
;
repeat
:
true
onTriggered
:
{
if
(
searchString
.
length
<
1
&&
!
alwaysShowSearch
)
{
headerItem
.
visible
=
false
}
}
}
}
}
}
Connections
{
Connections
{
target
:
headerItem
target
:
lockScreen
on
HeightChanged
:
{
on
VisibleChanged
:
{
if
(
headerItem
.
oldHeight
<
headerItem
.
height
)
if
(
lockscreenVisible
())
{
if
(
!
flicking
)
gridview
.
contentY
=
headerItem
.
y
searchListView
.
cleanup
()
headerItem
.
oldHeight
=
headerItem
.
height
}
}
}
onVisibleChanged
:
timer
.
restart
()
}
}
Connections
{
Connections
{
target
:
Lipstick
.
compositor
target
:
Lipstick
.
compositor
onDisplayOff
:
{
onDisplayOff
:
{
headerItem
.
searchField
.
text
=
""
searchListView
.
cleanup
()
headerItem
.
visible
=
false
}
}
onWindowAdded
:
{
onWindowAdded
:
{
if
(
window
.
category
==
""
&&
window
.
title
!==
"
Home
"
){
if
(
window
.
category
===
""
&&
window
.
title
!==
"
Home
"
){
headerItem
.
searchField
.
text
=
""
searchListView
.
cleanup
()
headerItem
.
visible
=
false
}
}
}
}
onWindowRaised
:
{
onWindowRaised
:
{
if
(
window
.
category
==
""
&&
window
.
title
!==
"
Home
"
){
if
(
window
.
category
===
""
&&
window
.
title
!==
"
Home
"
){
headerItem
.
searchField
.
text
=
""
searchListView
.
cleanup
()
headerItem
.
visible
=
false
}
}
}
}
}
}
Connections
{
target
:
pager
onFlickEnded
:
{
headerItem
.
searchField
.
text
=
""
headerItem
.
visible
=
false
}
onSearchStringChanged
:
searchListViewTimer
.
restart
()
}
Connections
{
target
:
lockScreen
onVisibleChanged
:
{
if
(
lockscreenVisible
())
{
headerItem
.
searchField
.
text
=
""
headerItem
.
visible
=
false
}
}
}
header
:
SearchListView
{
/*app grid*/
width
:
gridview
.
width
GridView
{
}
id
:
gridview
width
:
parent
.
width
height
:
parent
.
height
-
searchListView
.
height
-
Theme
.
itemSpacingHuge
footer
:
Item
{
visible
:
searchString
.
length
===
0
height
:
Theme
.
itemHeightLarge
*
1.5
}
Item
{
//Doesn't yet uninstall applications
cacheBuffer
:
gridview
.
contentHeight
id
:
deleter
property
Item
reorderItem
anchors.top
:
parent
.
top
property
bool
onUninstall
property
alias
remove
:
remove
property
alias
uninstall
:
uninstall
function
uninstalling
(
action
,
caption
)
{
state
=
action
if
(
action
===
"
remove
"
)
{
remove
.
text
=
qsTr
(
"
Removing
"
)
+
"
"
+
caption
}
else
if
(
action
==
"
uninstall
"
)
{
uninstall
.
text
=
qsTr
(
"
Uninstalling
"
)
+
"
"
+
caption
}
}
states
:
[
property
int
minCellSize
:
Theme
.
iconSizeLauncher
+
Theme
.
iconSizeLauncher
/
2
State
{
property
int
rows
:
Math
.
floor
(
parent
.
height
/
minCellSize
)
name
:
"
remove
"
property
int
columns
:
Math
.
floor
(
parent
.
width
/
minCellSize
)
PropertyChanges
{
target
:
remove
color1
:
"
#D9ff0000
"
color2
:
"
#D9ff0000
"
color3
:
"
#D9ff0000
"
}
PropertyChanges
{
target
:
uninstall
color1
:
"
#D9ff0000
"
color2
:
"
#80ff0000
"
color3
:
"
#4Dff0000
"
}
PropertyChanges
{
target
:
uninstall
text
:
qsTr
(
"
Uninstall
"
)
}
},
State
{
name
:
"
uninstall
"
PropertyChanges
{
target
:
uninstall
color1
:
"
#D9ff0000
"
color2
:
"
#D9ff0000
"
color3
:
"
#D9ff0000
"
}
PropertyChanges
{
target
:
remove
color1
:
"
#D9ff0000
"
color2
:
"
#80ff0000
"
color3
:
"
#4Dff0000
"
}
PropertyChanges
{
target
:
remove
text
:
qsTr
(
"
Remove
"
)
}
},
State
{
name
:
"
basic
"
PropertyChanges
{
target
:
remove
color1
:
"
#D9ff0000
"
color2
:
"
#80ff0000
"
color3
:
"
#4Dff0000
"
}
PropertyChanges
{
target
:
remove
text
:
qsTr
(
"
Remove
"
)
}
PropertyChanges
{
target
:
uninstall
color1
:
"
#D9ff0000
"
color2
:
"
#80ff0000
"
color3
:
"
#4Dff0000
"
}
PropertyChanges
{
target
:
uninstall
text
:
qsTr
(
"
Uninstall
"
)
}
}
]
Rectangle
{
//WHY?
cellWidth
:
parent
.
width
/
columns
id
:
remove
cellHeight
:
Math
.
round
(
parent
.
height
/
rows
)
property
color
color1
:
"
#D9ff0000
"
property
color
color2
:
"
#80ff0000
"
property
color
color3
:
"
#4Dff0000
"
property
alias
text
:
removeLabel
.
text
anchors.left
:
parent
.
left
visible
:
gridview
.
onUninstall
height
:
Theme
.
itemHeightExtraLarge
width
:
gridview
.
width
/
2
gradient
:
Gradient
{
GradientStop
{
position
:
0.0
;
color
:
remove
.
color1
}
GradientStop
{
position
:
0.5
;
color
:
remove
.
color2
}
GradientStop
{
position
:
1.0
;
color
:
remove
.
color3
}
}
Row
{
width
:
parent
.
width
height
:
parent
.
height
Image
{
id
:
removeIcon
fillMode
:
Image
.
PreserveAspectFit
height
:
parent
.
height
-
Theme
.
itemSpacingExtraSmall
width
:
height
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
image://theme/remove
"
visible
:
deleter
.
state
!=
"
remove
"
}
Label
{
anchors
{
id
:
removeLabel
top
:
searchListView
.
bottom
text
:
qsTr
(
"
Remove
"
)
topMargin
:
Theme
.
itemSpacingHuge
height
:
parent
.
height
width
:
parent
.
width
-
(
removeIcon
.
visible
?
removeIcon
.
width
:
0
)
anchors.verticalCenter
:
parent
.
verticalCenter
font.pixelSize
:
Theme
.
fontSizeSmall
elide
:
Text
.
ElideRight
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
}
}
}
}
Rectangle
{
id
:
uninstall
property
int
folderIndex
:
-
1
property
color
color1
:
"
#D9ff0000
"
property
bool
isRootFolder
:
true
property
color
color2
:
"
#80ff0000
"
property
bool
newFolderActive
property
color
color3
:
"
#4Dff0000
"
property
bool
newFolder
:
newFolderActive
&&
isRootFolder
&&
folderIndex
>=
0
property
alias
text
:
uninstallLabel
.
text
clip
:
true
anchors.left
:
remove
.
right
visible
:
gridview
.
onUninstall
/*onContentYChanged: {
width
:
gridview
.
width
/
2
if( contentY < -Theme.itemHeightHuge ) {
height
:
Theme
.
itemHeightExtraLarge
headerItem.visible = true;
gradient
:
Gradient
{
timer.running = true;
GradientStop
{
position
:
0.0
;
color
:
uninstall
.
color1
}
GradientStop
{
position
:
0.5
;
color
:
uninstall
.
color2
}
GradientStop
{
position
:
1.0
;
color
:
uninstall
.
color3
}
}
Row
{
width
:
parent
.
width
height
:
parent
.
height
Image
{
id
:
trashIcon
fillMode
:
Image
.
PreserveAspectFit
height
:
parent
.
height
-
Theme
.
itemSpacingExtraSmall
width
:
height
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
image://theme/trash
"
visible
:
deleter
.
state
!=
"
uninstall
"
}
Label
{
id
:
uninstallLabel
height
:
parent
.
height
width
:
parent
.
width
-
(
trashIcon
.
visible
?
trashIcon
.
width
:
0
)
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
Uninstall
"
)
font.pixelSize
:
Theme
.
fontSizeSmall
elide
:
Text
.
ElideRight
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
}
}
}
}*/
footer
:
Item
{
height
:
Theme
.
itemHeightLarge
*
1.5
}
}
}
onFolderIndexChanged
:
if
(
folderIndex
==
-
1
)
newFolderActive
=
false
onFolderIndexChanged
:
if
(
folderIndex
==
-
1
)
newFolderActive
=
false
model
:
LauncherFolderModel
{
id
:
launcherModel
}
model
:
LauncherFolderModel
{
//Using loader that in the future we can also have widgets as delegate
id
:
launcherModel
delegate
:
Loader
{
}
id
:
loader
width
:
cellWidth
height
:
cellHeight
onXChanged
:
item
.
x
=
x
onYChanged
:
item
.
y
=
y
property
QtObject
modelData
:
model
property
int
cellIndex
:
index
sourceComponent
:
object
.
type
==
LauncherModel
.
Folder
?
folder
:
app
}
Component
{
//Using loader that in the future we can also have widgets as delegate
id
:
app
delegate
:
Loader
{
LauncherItemDelegate
{
id
:
loader
id
:
launcherItem
width
:
gridview
.
cellWidth
parent
:
gridview
height
:
gridview
.
cellHeight
parentItem
:
gridview
onXChanged
:
item
.
x
=
x
iconCaption.color
:
Theme
.
textColor
onYChanged
:
item
.
y
=
y
iconCaption.text
:
modelData
.
object
.
title
property
QtObject
modelData
:
model
isFolder
:
modelData
.
object
.
type
==
LauncherModel
.
Folder
property
int
cellIndex
:
index
source
:
modelData
.
object
.
iconId
==
""
?
"
/usr/share/lipstick-glacier-home-qt5/qml/theme/default-icon.png
"
:
(
modelData
.
object
.
iconId
.
indexOf
(
"
/
"
)
==
0
?
"
file://
"
:
"
image://theme/
"
)
+
modelData
.
object
.
iconId
sourceComponent
:
object
.
type
==
LauncherModel
.
Folder
?
folder
:
app
notNemoIcon
:
isFolder
||
modelData
.
object
.
iconId
==
""
?
false
:
modelData
.
object
.
iconId
.
indexOf
(
"
harbour
"
)
>
-
1
||
modelData
.
object
.
iconId
.
indexOf
(
"
apkd_launcher
"
)
>
-
1
?
true
:
false
}
folderModel
:
launcherModel
Component
{
id
:
app
LauncherItemDelegate
{
id
:
launcherItem
parent
:
gridview
parentItem
:
gridview
iconCaption.color
:
Theme
.
textColor
iconCaption.text
:
modelData
.
object
.
title
isFolder
:
modelData
.
object
.
type
==
LauncherModel
.
Folder
source
:
modelData
.
object
.
iconId
==
""
?
"
/usr/share/lipstick-glacier-home-qt5/qml/theme/default-icon.png
"
:
(
modelData
.
object
.
iconId
.
indexOf
(
"
/
"
)
==
0
?
"
file://
"
:
"
image://theme/
"
)
+
modelData
.
object
.
iconId
notNemoIcon
:
isFolder
||
modelData
.
object
.
iconId
==
""
?
false
:
modelData
.
object
.
iconId
.
indexOf
(
"
harbour
"
)
>
-
1
||
modelData
.
object
.
iconId
.
indexOf
(
"
apkd_launcher
"
)
>
-
1
?
true
:
false
folderModel
:
launcherModel
}
}
Component
{
id
:
folder
LauncherItemFolder
{
id
:
launcherfolder
parent
:
gridview
iconCaption.color
:
Theme
.
textColor
iconCaption.text
:
modelData
.
object
.
title
isFolder
:
modelData
.
object
.
type
==
LauncherModel
.
Folder
folderAppsCount
:
isFolder
&&
modelData
.
object
?
modelData
.
object
.
itemCount
:
0
notNemoIcon
:
isFolder
||
modelData
.
object
.
iconId
==
""
?
false
:
modelData
.
object
.
iconId
.
indexOf
(
"
harbour
"
)
>
-
1
||
modelData
.
object
.
iconId
.
indexOf
(
"
apkd_launcher
"
)
>
-
1
?
true
:
false
folderModel
:
launcherModel
}
}
}
}
}
Component
{
id
:
folder
Deleter
{
LauncherItemFolder
{
id
:
deleter
id
:
launcherfolder
anchors
{
parent
:
gridview
bottom
:
parent
.
bottom
iconCaption.color
:
Theme
.
textColor
iconCaption.text
:
modelData
.
object
.
title
isFolder
:
modelData
.
object
.
type
==
LauncherModel
.
Folder
folderAppsCount
:
isFolder
&&
modelData
.
object
?
modelData
.
object
.
itemCount
:
0
notNemoIcon
:
isFolder
||
modelData
.
object
.
iconId
==
""
?
false
:
modelData
.
object
.
iconId
.
indexOf
(
"
harbour
"
)
>
-
1
||
modelData
.
object
.
iconId
.
indexOf
(
"
apkd_launcher
"
)
>
-
1
?
true
:
false
folderModel
:
launcherModel
}
}
state
:
"
uninstall
"
}
}
}
}
src/qml/MainScreen.qml
View file @
51265a95
...
@@ -43,6 +43,7 @@ import org.nemomobile.devicelock 1.0
...
@@ -43,6 +43,7 @@ import org.nemomobile.devicelock 1.0
import
"
scripts/desktop.js
"
as
Desktop
import
"
scripts/desktop.js
"
as
Desktop
Page
{
Page
{
id
:
desktop
// This is used in the favorites page and in the lock screen
// This is used in the favorites page and in the lock screen
WallClock
{
WallClock
{
id
:
wallClock
id
:
wallClock
...
@@ -63,7 +64,7 @@ Page {
...
@@ -63,7 +64,7 @@ Page {
key
:
"
/home/glacier/homeScreen/wallpaperImage
"
key
:
"
/home/glacier/homeScreen/wallpaperImage
"
defaultValue
:
"
/usr/share/lipstick-glacier-home-qt5/qml/images/wallpaper-portrait-bubbles.png
"
defaultValue
:
"
/usr/share/lipstick-glacier-home-qt5/qml/images/wallpaper-portrait-bubbles.png
"
}
}
id
:
desktop
property
alias
lockscreen
:
lockScreen
property
alias
lockscreen
:
lockScreen
property
alias
switcher
:
switcher
property
alias
switcher
:
switcher
property
int
statusBarHeight
:
statusbar
.
height
property
int
statusBarHeight
:
statusbar
.
height
...
...
src/qml/applauncher/Deleter.qml
0 → 100644
View file @
51265a95
// This file is part of glacier-home, a nice user experience for touchscreens.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Copyright (c) 2018, Chupligin Sergey <neochapay@gmail.com>
import
QtQuick
2.6
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
Item
{
//Doesn't yet uninstall applications
id
:
deleter
property
alias
remove
:
remove
property
alias
uninstall
:
uninstall
function
uninstalling
(
action
,
caption
)
{
state
=
action
if
(
action
===
"
remove
"
)
{
remove
.
text
=
qsTr
(
"
Removing
"
)
+
"
"
+
caption
}
else
if
(
action
==
"
uninstall
"
)
{
uninstall
.
text
=
qsTr
(
"
Uninstalling
"
)
+
"
"
+
caption
}
}
states
:
[
State
{
name
:
"
remove
"
PropertyChanges
{
target
:
remove
color1
:
"
#D9ff0000
"
color2
:
"
#D9ff0000
"
color3
:
"
#D9ff0000
"
}
PropertyChanges
{
target
:
uninstall
color1
:
"
#D9ff0000
"
color2
:
"
#80ff0000
"
color3
:
"
#4Dff0000
"
}
PropertyChanges
{
target
:
uninstall
text
:
qsTr
(
"
Uninstall
"
)
}
},
State
{
name
:
"
uninstall
"
PropertyChanges
{
target
:
uninstall
color1
:
"
#D9ff0000
"
color2
:
"
#D9ff0000
"
color3
:
"
#D9ff0000
"
}
PropertyChanges
{
target
:
remove
color1
:
"
#D9ff0000
"
color2
:
"
#80ff0000
"
color3
:
"
#4Dff0000
"
}
PropertyChanges
{
target
:
remove
text
:
qsTr
(
"
Remove
"
)
}
},
State
{
name
:
"
basic
"
PropertyChanges
{
target
:
remove
color1
:
"
#D9ff0000
"
color2
:
"
#80ff0000
"
color3
:
"
#4Dff0000
"
}
PropertyChanges
{
target
:
remove
text
:
qsTr
(
"
Remove
"
)
}
PropertyChanges
{
target
:
uninstall
color1
:
"
#D9ff0000
"
color2
:
"
#80ff0000
"
color3
:
"
#4Dff0000
"
}
PropertyChanges
{
target
:
uninstall
text
:
qsTr
(
"
Uninstall
"
)
}
}
]
Rectangle
{
//WHY?
id
:
remove
property
color
color1
:
"
#D9ff0000
"
property
color
color2
:
"
#80ff0000
"
property
color
color3
:
"
#4Dff0000
"
property
alias
text
:
removeLabel
.
text
anchors.left
:
parent
.
left
visible
:
gridview
.
onUninstall
height
:
Theme
.
itemHeightExtraLarge
width
:
gridview
.
width
/
2
gradient
:
Gradient
{
GradientStop
{
position
:
0.0
;
color
:
remove
.
color1
}
GradientStop
{
position
:
0.5
;
color
:
remove
.
color2
}
GradientStop
{
position
:
1.0
;
color
:
remove
.
color3
}
}
Row
{
width
:
parent
.
width
height
:
parent
.
height
Image
{
id
:
removeIcon
fillMode
:
Image
.
PreserveAspectFit
height
:
parent
.
height
-
Theme
.
itemSpacingExtraSmall
width
:
height
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
image://theme/remove
"
visible
:
deleter
.
state
!=
"
remove
"
}
Label
{
id
:
removeLabel
text
:
qsTr
(
"
Remove
"
)
height
:
parent
.
height
width
:
parent
.
width
-
(
removeIcon
.
visible
?
removeIcon
.
width
:
0
)
anchors.verticalCenter
:
parent
.
verticalCenter
font.pixelSize
:
Theme
.
fontSizeSmall
elide
:
Text
.
ElideRight
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
}
}
}
Rectangle
{
id
:
uninstall
property
color
color1
:
"
#D9ff0000
"
property
color
color2
:
"
#80ff0000
"
property
color
color3
:
"
#4Dff0000
"
property
alias
text
:
uninstallLabel
.
text
anchors.left
:
remove
.
right
visible
:
gridview
.
onUninstall
width
:
gridview
.
width
/
2
height
:
Theme
.
itemHeightExtraLarge
gradient
:
Gradient
{
GradientStop
{
position
:
0.0
;
color
:
uninstall
.
color1
}
GradientStop
{
position
:
0.5
;
color
:
uninstall
.
color2
}
GradientStop
{
position
:
1.0
;
color
:
uninstall
.
color3
}
}
Row
{
width
:
parent
.
width
height
:
parent
.
height
Image
{
id
:
trashIcon
fillMode
:
Image
.
PreserveAspectFit
height
:
parent
.
height
-
Theme
.
itemSpacingExtraSmall
width
:
height
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
image://theme/trash
"
visible
:
deleter
.
state
!=
"
uninstall
"
}
Label
{
id
:
uninstallLabel
height
:
parent
.
height
width
:
parent
.
width
-
(
trashIcon
.
visible
?
trashIcon
.
width
:
0
)
anchors.verticalCenter
:
parent
.
verticalCenter
text
:
qsTr
(
"
Uninstall
"
)
font.pixelSize
:
Theme
.
fontSizeSmall
elide
:
Text
.
ElideRight
horizontalAlignment
:
Text
.
AlignHCenter
verticalAlignment
:
Text
.
AlignVCenter
}
}
}
}
src/qml/SearchListView.qml
→
src/qml/
applauncher/
SearchListView.qml
View file @
51265a95
/****************************************************************************************
/****************************************************************************************
**
**
** Copyright (c) 2017, Eetu Kahelin
** Copyright (c) 2017, Eetu Kahelin
** Copyright (c) 2018, Chupligin Sergey
** All rights reserved.
** All rights reserved.
**
**
** You may use this file under the terms of BSD license as follows:
** You may use this file under the terms of BSD license as follows:
...
@@ -47,6 +48,22 @@ Item {
...
@@ -47,6 +48,22 @@ Item {
NumberAnimation
{
duration
:
300
}
NumberAnimation
{
duration
:
300
}
}
}
InverseMouseArea
{
anchors.fill
:
parent
onPressed
:
cleanup
()
}
function
cleanup
(){
searchField
.
focus
=
false
appLauncher
.
searchString
=
""
searchField
.
text
=
""
if
(
!
alwaysShowSearch
)
{
searchListView
.
visible
=
false
;
}
}
onVisibleChanged
:
{
onVisibleChanged
:
{
if
(
visible
){
if
(
visible
){
...
@@ -85,12 +102,12 @@ Item {
...
@@ -85,12 +102,12 @@ Item {
width
:
parent
.
width
-
searchIcon
.
width
-
Theme
.
itemSpacingMedium
width
:
parent
.
width
-
searchIcon
.
width
-
Theme
.
itemSpacingMedium
placeholderText
:
qsTr
(
"
Search
"
)
placeholderText
:
qsTr
(
"
Search
"
)
Binding
{
Binding
{
target
:
gridview
target
:
appLauncher
property
:
"
searchString
"
property
:
"
searchString
"
value
:
searchField
.
text
.
toLowerCase
().
trim
()
value
:
searchField
.
text
.
toLowerCase
().
trim
()
}
}
onTextChanged
:
{
onTextChanged
:
{
if
(
tex
.
lenght
>
0
)
{
if
(
searchField
.
lenght
>
0
)
{
searchField
.
forceActiveFocus
()
searchField
.
forceActiveFocus
()
}
}
}
}
...
@@ -155,7 +172,7 @@ Item {
...
@@ -155,7 +172,7 @@ Item {
}
}
Connections
{
Connections
{
target
:
gridview
target
:
appLauncher
onSearchStringChanged
:
listView
.
update
()
onSearchStringChanged
:
listView
.
update
()
}
}
...
@@ -190,15 +207,34 @@ Item {
...
@@ -190,15 +207,34 @@ Item {
for
(
i
=
0
;
i
<
searchLauncherModel
.
itemCount
;
++
i
)
{
for
(
i
=
0
;
i
<
searchLauncherModel
.
itemCount
;
++
i
)
{
if
(
searchLauncherModel
.
get
(
i
).
type
===
LauncherModel
.
Folder
)
{
if
(
searchLauncherModel
.
get
(
i
).
type
===
LauncherModel
.
Folder
)
{
for
(
var
j
=
0
;
j
<
searchLauncherModel
.
get
(
i
).
itemCount
;
++
j
)
{
for
(
var
j
=
0
;
j
<
searchLauncherModel
.
get
(
i
).
itemCount
;
++
j
)
{
titles
.
push
({
'
iconTitle
'
:
searchLauncherModel
.
get
(
i
).
get
(
j
).
title
,
'
iconSource
'
:
searchLauncherModel
.
get
(
i
).
get
(
j
).
iconId
,
'
id
'
:
i
,
'
folderId
'
:
j
,
'
category
'
:
qsTr
(
"
Application
"
)})
titles
.
push
({
'
iconTitle
'
:
searchLauncherModel
.
get
(
i
).
get
(
j
).
title
,
'
iconSource
'
:
searchLauncherModel
.
get
(
i
).
get
(
j
).
iconId
,
'
id
'
:
i
,
'
folderId
'
:
j
,
'
category
'
:
qsTr
(
"
Application
"
),
'
extraCaption
'
:
qsTr
(
"
installed on you device
"
)
})
}
}
}
else
{
}
else
{
titles
.
push
({
'
iconTitle
'
:
searchLauncherModel
.
get
(
i
).
title
,
'
iconSource
'
:
searchLauncherModel
.
get
(
i
).
iconId
,
'
id
'
:
i
,
'
folderId
'
:
-
1
,
'
category
'
:
qsTr
(
"
Application
"
)})
titles
.
push
({
'
iconTitle
'
:
searchLauncherModel
.
get
(
i
).
title
,
'
iconSource
'
:
searchLauncherModel
.
get
(
i
).
iconId
,
'
id
'
:
i
,
'
folderId
'
:
-
1
,
'
category
'
:
qsTr
(
"
Application
"
),
'
extraCaption
'
:
qsTr
(
"
installed on you device
"
)
})
}
}
}
}
for
(
i
=
0
;
i
<
peopleModel
.
count
;
++
i
)
{
for
(
i
=
0
;
i
<
peopleModel
.
count
;
++
i
)
{
if
(
peopleModel
.
get
(
i
).
firstName
&&
peopleModel
.
get
(
i
).
lastName
)
{
if
(
peopleModel
.
get
(
i
).
firstName
&&
peopleModel
.
get
(
i
).
lastName
)
{
contacts
.
push
({
'
title
'
:(
peopleModel
.
get
(
i
).
firstName
+
"
"
+
peopleModel
.
get
(
i
).
lastName
),
'
iconSource
'
:
peopleModel
.
get
(
i
).
avatarUrl
.
toString
(),
'
extraCaption
'
:
peopleModel
.
get
(
i
).
phoneNumbers
,
'
category
'
:
qsTr
(
"
Contact
"
)})
contacts
.
push
({
'
title
'
:(
peopleModel
.
get
(
i
).
firstName
+
"
"
+
peopleModel
.
get
(
i
).
lastName
),
'
iconSource
'
:
peopleModel
.
get
(
i
).
avatarUrl
.
toString
(),
'
extraCaption
'
:
peopleModel
.
get
(
i
).
phoneNumbers
,
'
category
'
:
qsTr
(
"
Contact
"
)
})
}
}
}
}
var
filteredTitles
=
titles
.
filter
(
function
(
icon
)
{
var
filteredTitles
=
titles
.
filter
(
function
(
icon
)
{
...
@@ -236,7 +272,7 @@ Item {
...
@@ -236,7 +272,7 @@ Item {
found
=
existingTitleObject
.
hasOwnProperty
(
iconTitle
)
found
=
existingTitleObject
.
hasOwnProperty
(
iconTitle
)
if
(
!
found
)
{
if
(
!
found
)
{
// for simplicity, just adding to end instead of corresponding position in original list
// for simplicity, just adding to end instead of corresponding position in original list
listModel
.
append
({
'
title
'
:
iconTitle
,
'
iconSource
'
:
iconId
,
'
id
'
:
id
,
'
folderId
'
:
folderId
,
'
category
'
:
category
})
listModel
.
append
({
'
title
'
:
iconTitle
,
'
iconSource
'
:
iconId
,
'
id
'
:
id
,
'
folderId
'
:
folderId
,
'
category
'
:
category
,
'
extraCaption
'
:
""
})
}
}
}
}
for
(
i
=
0
;
i
<
contacts
.
length
;
++
i
)
{
for
(
i
=
0
;
i
<
contacts
.
length
;
++
i
)
{
...
...
src/src.pro
View file @
51265a95
...
@@ -46,8 +46,7 @@ qml.files = qml/MainScreen.qml \
...
@@ -46,8 +46,7 @@ qml.files = qml/MainScreen.qml \
qml/GlacierRotation.qml \
qml/GlacierRotation.qml \
qml/DeviceLockUI.qml \
qml/DeviceLockUI.qml \
qml/LauncherItemWrapper.qml \
qml/LauncherItemWrapper.qml \
qml/LauncherItemFolder.qml \
qml/LauncherItemFolder.qml
qml/SearchListView.qml
qmlcompositor.path = /usr/share/lipstick-glacier-home-qt5/qml/compositor
qmlcompositor.path = /usr/share/lipstick-glacier-home-qt5/qml/compositor
qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \
qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \
...
@@ -83,6 +82,10 @@ statusbar.files = qml/statusbar/BatteryPanel.qml\
...
@@ -83,6 +82,10 @@ statusbar.files = qml/statusbar/BatteryPanel.qml\
qml/statusbar/NumButton.qml \
qml/statusbar/NumButton.qml \
qml/statusbar/MediaController.qml
qml/statusbar/MediaController.qml
applauncher.path = /usr/share/lipstick-glacier-home-qt5/qml/applauncher
applauncher.files = qml/applauncher/SearchListView.qml \
qml/applauncher/Deleter.qml
settingswallpaperplugin.files = settings-plugins/wallpaper/wallpaper.qml \
settingswallpaperplugin.files = settings-plugins/wallpaper/wallpaper.qml \
settings-plugins/wallpaper/selectImage.qml \
settings-plugins/wallpaper/selectImage.qml \
settings-plugins/wallpaper/wallpaper.svg
settings-plugins/wallpaper/wallpaper.svg
...
@@ -112,7 +115,8 @@ INSTALLS += styles \
...
@@ -112,7 +115,8 @@ INSTALLS += styles \
statusbar\
statusbar\
settingswallpaperplugin\
settingswallpaperplugin\
settingsnotificationsplugin\
settingsnotificationsplugin\
settingspluginconfig
settingspluginconfig \
applauncher
CONFIG += qt link_pkgconfig
CONFIG += qt link_pkgconfig
QT += quick compositor
QT += quick compositor
...
@@ -130,43 +134,17 @@ PKGCONFIG += lipstick-qt5 \
...
@@ -130,43 +134,17 @@ PKGCONFIG += lipstick-qt5 \
nemodevicelock
nemodevicelock
OTHER_FILES += qml
/*
.qml \
OTHER_FILES += qml
/*
.qml \
qml/MainScreen.qml \
qml/compositor
/*
.qml \
qml/compositor.qml \
qml/LauncherItemDelegate.qml \
qml/Lockscreen.qml \
qml/LockscreenClock.qml \
qml/AppSwitcher.qml \
qml/AppLauncher.qml \
qml/ToolBarLayoutExample.qml \
qml/SwitcherItem.qml \
qml/CloseButton.qml \
qml/compositor/WindowWrapperMystic.qml \
qml/compositor/WindowWrapperBase.qml \
qml/compositor/WindowWrapperAlpha.qml \
qml/compositor/ScreenGestureArea.qml \
qml/NotificationPreview.qml \
qml/scripts/desktop.js \
qml/scripts/desktop.js \
qml/FeedsPage.qml \
nemovars.conf \
qml/Statusbar.qml \
qml/connectivity
/*
.qml
qml/StatusbarItem.qml \
qml/WifiPanel.qml \
nemovars.conf \
qml/SimPanel.qml \
qml/NumButton.qml \
qml/USBModeSelector.qml \
qml/VolumeControl.qml \
qml/BatteryPanel.qml \
qml/CommonPanel.qml \
qml/ShutdownScreen.qml \
qml/GlacierRotation.qml
TRANSLATIONS += i18n/glacer-home.ts
TRANSLATIONS += i18n/glacer-home.ts
DISTFILES += \
DISTFILES += \
i18n/glacer-home.ts \
i18n/glacer-home.ts \
qml/connectivity/ConnectionSelector.qml \
qml
/*/*
.qml \
qml/statusbar/BatteryIndicator.qml \
settings-plugins
/*/*
.qml \
settings-plugins/wallpaper/selectImage.qml \
settings-plugins
/*/*
.json \
settings-plugins/notifications/notifications.json \
settings-plugins
/*/*
.svg
settings-plugins/notifications/notifications.svg \
settings-plugins/notifications/notifications.qml
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