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
b598a943
Commit
b598a943
authored
Jan 20, 2017
by
Sergey Chupligin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ButtonRow] selector fix
parent
79e76a7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
27 deletions
+44
-27
ButtonRow.qml
src/controls/ButtonRow.qml
+44
-27
No files found.
src/controls/ButtonRow.qml
View file @
b598a943
...
...
@@ -39,52 +39,69 @@ Rectangle {
height
:
40
property
ListModel
model
:
ListModel
{}
property
bool
enabled
:
true
property
int
currentIndex
:
-
1
signal
selected
(
string
sel
)
Image
{
anchors.fill
:
parent
visible
:
!
main
.
enabled
source
:
"
images/disabled-overlay.png
"
fillMode
:
Image
.
Tile
}
Rectangle
{
id
:
selecter
height
:
50
y
:
-
5
color
:
"
#0091e5
"
z
:
0
visible
:
false
anchors
{
top
:
rowElement
.
top
topMargin
:
-
5
}
}
Row
{
spacing
:
0
id
:
rowElement
Repeater
{
id
:
rectangles
model
:
main
.
model
delegate
:
Rectangle
{
property
bool
active
:
false
delegate
:
Rectangle
{
id
:
rowItem
height
:
50
y
:
-
5
width
:
text
.
width
+
(
text
.
width
/
name
.
length
*
2
)
color
:
"
transparent
"
MouseArea
{
enabled
:
main
.
enabled
width
:
parent
.
width
height
:
parent
.
height
onClicked
:
{
if
(
!
parent
.
active
)
{
text
.
font
.
bold
=
true
parent
.
color
=
"
#0091e5
"
parent
.
active
=
true
}
else
{
text
.
font
.
bold
=
false
parent
.
color
=
"
transparent
"
parent
.
active
=
false
}
main
.
selected
(
name
)
}
MouseArea
{
enabled
:
main
.
enabled
width
:
parent
.
width
height
:
parent
.
height
onClicked
:
{
main
.
currentIndex
=
index
selecter
.
visible
=
true
moveSelecter
.
start
()
main
.
selected
(
name
)
}
Label
{
id
:
text
text
:
name
anchors.horizontalCenter
:
parent
.
horizontalCenter
Component.onCompleted
:
{
width
=
paintedWidth
}
}
Label
{
id
:
text
text
:
name
anchors.horizontalCenter
:
parent
.
horizontalCenter
Component.onCompleted
:
{
width
=
paintedWidth
}
z
:
1
font.bold
:
main
.
currentIndex
==
index
}
ParallelAnimation
{
id
:
moveSelecter
NumberAnimation
{
target
:
selecter
;
property
:
"
x
"
;
from
:
selecter
.
x
;
to
:
rowItem
.
x
;
duration
:
100
}
NumberAnimation
{
target
:
selecter
;
property
:
"
width
"
;
from
:
selecter
.
width
;
to
:
rowItem
.
width
;
duration
:
100
}
}
}
}
}
}
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