Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qtquickcontrols-nemo
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
qtquickcontrols-nemo
Commits
70cfdc07
Commit
70cfdc07
authored
Feb 08, 2017
by
Sergey Chupligin
Committed by
Aleksi Suomalainen
Mar 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SelectRoller] create delegate property
parent
e94290d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
20 deletions
+51
-20
SelectRollerPage.qml
examples/touch/content/SelectRollerPage.qml
+44
-0
GlacierRoller.qml
src/controls/GlacierRoller.qml
+7
-20
No files found.
examples/touch/content/SelectRollerPage.qml
View file @
70cfdc07
...
...
@@ -45,6 +45,28 @@ Page {
clip
:
true
model
:
animalsModel
label
:
qsTr
(
"
Choose your favorite animal
"
)
delegate
:
Text
{
height
:
simpleRoller
.
itemHeight
text
:
name
color
:
"
white
"
font.pixelSize
:
32
font.bold
:
(
simpleRoller
.
active
&&
ListView
.
view
.
currentIndex
===
index
)
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
!
simpleRoller
.
active
)
{
simpleRoller
.
active
=
true
;
}
else
{
simpleRoller
.
currentIndex
=
index
simpleRoller
.
active
=
false
}
}
}
}
}
GlacierRoller
{
...
...
@@ -58,5 +80,27 @@ Page {
clip
:
true
model
:
animalsModel
label
:
qsTr
(
"
Choose your second favorite animal
"
)
delegate
:
Text
{
height
:
simpleRoller2
.
itemHeight
text
:
name
color
:
"
white
"
font.pixelSize
:
32
font.bold
:
(
simpleRoller2
.
active
&&
ListView
.
view
.
currentIndex
===
index
)
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
!
simpleRoller2
.
active
)
{
simpleRoller2
.
active
=
true
;
}
else
{
simpleRoller2
.
currentIndex
=
index
simpleRoller2
.
active
=
false
}
}
}
}
}
}
src/controls/GlacierRoller.qml
View file @
70cfdc07
...
...
@@ -4,6 +4,7 @@ Item {
id
:
glacierRoller
property
alias
model
:
view
.
model
property
alias
label
:
label
.
text
property
alias
delegate
:
view
.
delegate
property
int
currentIndex
:
-
1
property
int
activateSize
:
5
...
...
@@ -80,30 +81,11 @@ Item {
anchors
{
verticalCenter
:
view
.
verticalCenter
}
}
delegate
:
Text
{
id
:
listItem
//width: parent.width
height
:
itemHeight
text
:
name
color
:
"
white
"
font.pixelSize
:
32
font.bold
:
(
active
&&
ListView
.
view
.
currentIndex
===
index
)
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
!
active
)
{
active
=
true
;
}
else
{
glacierRoller
.
currentIndex
=
index
view
.
currentIndex
=
index
active
=
false
}
active
=
true
}
}
}
...
...
@@ -126,6 +108,11 @@ Item {
}
}
onCurrentIndexChanged
:
{
view
.
currentIndex
=
currentIndex
arrowDown
.
x
=
view
.
currentItem
.
width
+
25
}
onActiveChanged
:
{
if
(
active
)
{
...
...
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