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
8442ef11
Commit
8442ef11
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] Make search panel configurable
parent
51265a95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
24 deletions
+90
-24
AppLauncher.qml
src/qml/AppLauncher.qml
+10
-3
SearchListView.qml
src/qml/applauncher/SearchListView.qml
+80
-21
No files found.
src/qml/AppLauncher.qml
View file @
8442ef11
...
...
@@ -54,7 +54,7 @@ Flickable{
SearchListView
{
id
:
searchListView
width
:
appLauncher
.
width
visible
:
alwaysShowSearch
visible
:
alwaysShowSearch
.
value
==
true
Timer
{
id
:
searchListViewTimer
;
...
...
@@ -62,9 +62,9 @@ Flickable{
interval
:
7000
;
repeat
:
true
onTriggered
:
{
if
(
searchString
.
length
<
1
&&
!
alwaysShowSearch
)
if
(
searchString
.
length
<
1
&&
!
alwaysShowSearch
.
value
==
true
)
{
headerItem
.
visible
=
false
searchListView
.
visible
=
false
}
}
}
...
...
@@ -122,6 +122,13 @@ Flickable{
topMargin
:
Theme
.
itemSpacingHuge
}
onContentYChanged
:
{
if
(
contentY
<
-
Theme
.
itemHeightHuge
*
2
&&
alwaysShowSearch
.
value
==
false
)
{
searchListView
.
visible
=
true
searchListViewTimer
.
running
=
true
}
}
property
int
folderIndex
:
-
1
property
bool
isRootFolder
:
true
property
bool
newFolderActive
...
...
src/qml/applauncher/SearchListView.qml
View file @
8442ef11
...
...
@@ -30,24 +30,19 @@
**
****************************************************************************************/
import
QtQuick
2.6
import
org
.
nemomobile
.
lipstick
0.1
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
import
org
.
nemomobile
.
lipstick
0.1
import
org
.
nemomobile
.
contacts
1.0
Item
{
id
:
rootItem
height
:
(
searchField
.
text
.
length
>
0
?
listView
.
height
+
searchField
.
height
:
searchField
.
height
)
+
(
visible
?
Theme
.
itemSpacingHuge
+
margin
.
height
:
0
)
visible
:
false
height
:
calculateHeight
()
anchors.bottomMargin
:
Theme
.
itemSpacingHuge
property
alias
searchField
:
searchField
property
int
oldHeight
Behavior
on
height
{
enabled
:
!
visible
NumberAnimation
{
duration
:
300
}
}
InverseMouseArea
{
anchors.fill
:
parent
onPressed
:
cleanup
()
...
...
@@ -59,28 +54,44 @@ Item {
appLauncher
.
searchString
=
""
searchField
.
text
=
""
if
(
!
alwaysShowSearch
)
if
(
!
alwaysShowSearch
.
value
==
true
)
{
searchListView
.
visible
=
false
;
}
}
onVisibleChanged
:
{
if
(
visible
){
searchField
.
focus
=
true
searchField
.
forceActiveFocus
()
}
else
searchField
.
focus
=
false
oldHeight
=
height
function
calculateHeight
()
{
if
(
rootItem
.
visible
){
if
(
searchField
.
text
.
length
>
0
){
return
parent
.
height
}
return
searchRow
.
height
+
Theme
.
itemSpacingHuge
}
else
{
return
0
;
}
}
Item
{
id
:
margin
height
:
Theme
.
itemSpacingSmall
onVisibleChanged
:
{
if
(
alwaysShowSearch
.
value
==
false
)
{
if
(
visible
){
rootItem
.
height
=
calculateHeight
()
searchField
.
focus
=
true
searchField
.
forceActiveFocus
()
}
else
{
searchField
.
focus
=
false
}
oldHeight
=
height
}
}
Row
{
id
:
searchRow
anchors
{
top
:
margin
.
bottom
top
:
parent
.
top
left
:
parent
.
left
right
:
parent
.
right
topMargin
:
Theme
.
itemSpacingHuge
...
...
@@ -95,6 +106,15 @@ Item {
height
:
searchField
.
height
fillMode
:
Image
.
PreserveAspectFit
source
:
"
image://theme/search
"
MouseArea
{
id
:
hideShowMouseArea
anchors.fill
:
parent
onPressAndHold
:
{
hideShowRow
.
visible
=
true
rootItem
.
height
=
rootItem
.
height
+
hideShowRow
.
height
}
}
}
TextField
{
...
...
@@ -112,15 +132,54 @@ Item {
}
}
}
}
Row
{
id
:
hideShowRow
visible
:
false
width
:
parent
.
width
-
Theme
.
itemSpacingMedium
*
2
height
:
visible
?
hideShowButton
.
height
+
Theme
.
itemSpacingMedium
:
0
anchors
{
top
:
searchRow
.
bottom
topMargin
:
visible
?
Theme
.
itemSpacingMedium
:
0
}
Button
{
id
:
hideShowButton
text
:
alwaysShowSearch
.
value
==
true
?
qsTr
(
"
Hide search panel
"
)
:
qsTr
(
"
Pinup search panel
"
)
width
:
parent
.
width
onClicked
:
{
rootItem
.
height
=
rootItem
.
height
-
hideShowRow
.
height
hideShowRow
.
visible
=
false
if
(
alwaysShowSearch
.
value
==
true
)
{
alwaysShowSearch
.
value
=
false
}
else
{
alwaysShowSearch
.
value
=
true
}
}
}
InverseMouseArea
{
anchors.fill
:
parent
onPressed
:
{
rootItem
.
height
=
rootItem
.
height
-
hideShowRow
.
height
hideShowRow
.
visible
=
false
}
}
}
ListView
{
id
:
listView
clip
:
true
width
:
parent
.
width
height
:
contentHeight
anchors.top
:
searchRow
.
bottom
anchors.topMargin
:
Theme
.
itemSpacingSmall
anchors
{
top
:
searchRow
.
bottom
topMargin
:
listModel
.
count
>
0
?
Theme
.
itemSpacingSmall
:
0
}
visible
:
searchString
.
length
>
0
section.property
:
'
category
'
section.delegate
:
Component
{
...
...
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