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{
...
@@ -54,7 +54,7 @@ Flickable{
SearchListView
{
SearchListView
{
id
:
searchListView
id
:
searchListView
width
:
appLauncher
.
width
width
:
appLauncher
.
width
visible
:
alwaysShowSearch
visible
:
alwaysShowSearch
.
value
==
true
Timer
{
Timer
{
id
:
searchListViewTimer
;
id
:
searchListViewTimer
;
...
@@ -62,9 +62,9 @@ Flickable{
...
@@ -62,9 +62,9 @@ Flickable{
interval
:
7000
;
interval
:
7000
;
repeat
:
true
repeat
:
true
onTriggered
:
{
onTriggered
:
{
if
(
searchString
.
length
<
1
&&
!
alwaysShowSearch
)
if
(
searchString
.
length
<
1
&&
!
alwaysShowSearch
.
value
==
true
)
{
{
headerItem
.
visible
=
false
searchListView
.
visible
=
false
}
}
}
}
}
}
...
@@ -122,6 +122,13 @@ Flickable{
...
@@ -122,6 +122,13 @@ Flickable{
topMargin
:
Theme
.
itemSpacingHuge
topMargin
:
Theme
.
itemSpacingHuge
}
}
onContentYChanged
:
{
if
(
contentY
<
-
Theme
.
itemHeightHuge
*
2
&&
alwaysShowSearch
.
value
==
false
)
{
searchListView
.
visible
=
true
searchListViewTimer
.
running
=
true
}
}
property
int
folderIndex
:
-
1
property
int
folderIndex
:
-
1
property
bool
isRootFolder
:
true
property
bool
isRootFolder
:
true
property
bool
newFolderActive
property
bool
newFolderActive
...
...
src/qml/applauncher/SearchListView.qml
View file @
8442ef11
...
@@ -30,24 +30,19 @@
...
@@ -30,24 +30,19 @@
**
**
****************************************************************************************/
****************************************************************************************/
import
QtQuick
2.6
import
QtQuick
2.6
import
org
.
nemomobile
.
lipstick
0.1
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
org
.
nemomobile
.
lipstick
0.1
import
org
.
nemomobile
.
contacts
1.0
import
org
.
nemomobile
.
contacts
1.0
Item
{
Item
{
id
:
rootItem
id
:
rootItem
height
:
(
searchField
.
text
.
length
>
0
?
listView
.
height
+
searchField
.
height
:
searchField
.
height
)
+
(
visible
?
Theme
.
itemSpacingHuge
+
margin
.
height
:
0
)
height
:
calculateHeight
()
visible
:
false
anchors.bottomMargin
:
Theme
.
itemSpacingHuge
anchors.bottomMargin
:
Theme
.
itemSpacingHuge
property
alias
searchField
:
searchField
property
alias
searchField
:
searchField
property
int
oldHeight
property
int
oldHeight
Behavior
on
height
{
enabled
:
!
visible
NumberAnimation
{
duration
:
300
}
}
InverseMouseArea
{
InverseMouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onPressed
:
cleanup
()
onPressed
:
cleanup
()
...
@@ -59,28 +54,44 @@ Item {
...
@@ -59,28 +54,44 @@ Item {
appLauncher
.
searchString
=
""
appLauncher
.
searchString
=
""
searchField
.
text
=
""
searchField
.
text
=
""
if
(
!
alwaysShowSearch
)
if
(
!
alwaysShowSearch
.
value
==
true
)
{
{
searchListView
.
visible
=
false
;
searchListView
.
visible
=
false
;
}
}
}
}
onVisibleChanged
:
{
function
calculateHeight
()
if
(
visible
){
{
searchField
.
focus
=
true
if
(
rootItem
.
visible
){
searchField
.
forceActiveFocus
()
if
(
searchField
.
text
.
length
>
0
){
}
else
searchField
.
focus
=
false
return
parent
.
height
oldHeight
=
height
}
return
searchRow
.
height
+
Theme
.
itemSpacingHuge
}
else
{
return
0
;
}
}
}
Item
{
onVisibleChanged
:
{
id
:
margin
if
(
alwaysShowSearch
.
value
==
false
)
height
:
Theme
.
itemSpacingSmall
{
if
(
visible
){
rootItem
.
height
=
calculateHeight
()
searchField
.
focus
=
true
searchField
.
forceActiveFocus
()
}
else
{
searchField
.
focus
=
false
}
oldHeight
=
height
}
}
}
Row
{
Row
{
id
:
searchRow
id
:
searchRow
anchors
{
anchors
{
top
:
margin
.
bottom
top
:
parent
.
top
left
:
parent
.
left
left
:
parent
.
left
right
:
parent
.
right
right
:
parent
.
right
topMargin
:
Theme
.
itemSpacingHuge
topMargin
:
Theme
.
itemSpacingHuge
...
@@ -95,6 +106,15 @@ Item {
...
@@ -95,6 +106,15 @@ Item {
height
:
searchField
.
height
height
:
searchField
.
height
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
source
:
"
image://theme/search
"
source
:
"
image://theme/search
"
MouseArea
{
id
:
hideShowMouseArea
anchors.fill
:
parent
onPressAndHold
:
{
hideShowRow
.
visible
=
true
rootItem
.
height
=
rootItem
.
height
+
hideShowRow
.
height
}
}
}
}
TextField
{
TextField
{
...
@@ -112,15 +132,54 @@ Item {
...
@@ -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
{
ListView
{
id
:
listView
id
:
listView
clip
:
true
clip
:
true
width
:
parent
.
width
width
:
parent
.
width
height
:
contentHeight
height
:
contentHeight
anchors.top
:
searchRow
.
bottom
anchors
{
anchors.topMargin
:
Theme
.
itemSpacingSmall
top
:
searchRow
.
bottom
topMargin
:
listModel
.
count
>
0
?
Theme
.
itemSpacingSmall
:
0
}
visible
:
searchString
.
length
>
0
visible
:
searchString
.
length
>
0
section.property
:
'
category
'
section.property
:
'
category
'
section.delegate
:
Component
{
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