Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
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
Administrator
linphone-desktop
Commits
b286809e
Commit
b286809e
authored
Sep 13, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(ExclusiveButtons): supports unlimited buttons
parent
23aa0376
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
35 deletions
+23
-35
ExclusiveButtons.qml
tests/ui/components/form/ExclusiveButtons.qml
+19
-33
contacts.qml
tests/ui/views/mainWindow/contacts.qml
+4
-2
No files found.
tests/ui/components/form/ExclusiveButtons.qml
View file @
b286809e
...
...
@@ -3,45 +3,31 @@ import QtQuick 2.7
// ===================================================================
Row
{
property
alias
text1
:
button1
.
text
property
alias
text2
:
button2
.
text
property
bool
button1IsSelected
:
true
property
int
selectedButton
:
0
property
variant
texts
signal
buttonChanged
(
int
button
)
spacing
:
8
Repeater
{
model
:
texts
SmallButton
{
anchors.verticalCenter
:
parent
.
verticalCenter
backgroundColor
:
button1IsSelected
backgroundColor
:
selectedButton
===
index
?
'
#8E8E8E
'
:
(
button1
.
down
:
(
button
.
down
?
'
#FE5E00
'
:
'
#D1D1D1
'
)
id
:
button1
onClicked
:
{
if
(
!
button1IsSelected
)
{
button1IsSelected
=
true
buttonChanged
(
1
)
}
}
}
id
:
button
text
:
modelData
SmallButton
{
anchors.verticalCenter
:
parent
.
verticalCenter
backgroundColor
:
!
button1IsSelected
?
'
#8E8E8E
'
:
(
button2
.
down
?
'
#FE5E00
'
:
'
#D1D1D1
'
)
id
:
button2
onClicked
:
{
if
(
button1IsSelected
)
{
button1IsSelected
=
false
buttonChanged
(
2
)
if
(
selectedButton
!==
index
)
{
selectedButton
=
index
buttonChanged
(
index
)
}
}
}
}
...
...
tests/ui/views/mainWindow/contacts.qml
View file @
b286809e
...
...
@@ -35,8 +35,10 @@ ColumnLayout {
ExclusiveButtons
{
Layout.preferredHeight
:
parent
.
height
text1
:
qsTr
(
'
selectAllContacts
'
)
text2
:
qsTr
(
'
selectConnectedContacts
'
)
texts
:
[
qsTr
(
'
selectAllContacts
'
),
qsTr
(
'
selectConnectedContacts
'
)
]
}
LightButton
{
...
...
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