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
0b56121f
Commit
0b56121f
authored
Nov 02, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(MainWindow/Contacts): use new style
parent
e3eb67a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
151 additions
and
86 deletions
+151
-86
Contacts.qml
tests/ui/views/App/MainWindow/Contacts.qml
+125
-83
ContactsStyle.qml
tests/ui/views/App/Styles/MainWindow/ContactsStyle.qml
+26
-3
No files found.
tests/ui/views/App/MainWindow/Contacts.qml
View file @
0b56121f
...
...
@@ -10,6 +10,31 @@ import App.Styles 1.0
// ===================================================================
ColumnLayout
{
function
_filter
(
text
)
{
Utils
.
assert
(
contacts
.
setFilterFixedString
!=
null
,
'
`contacts.setFilterFixedString` must be defined.
'
)
Utils
.
assert
(
contacts
.
invalidate
!=
null
,
'
`contacts.invalidate` must be defined.
'
)
contacts
.
setFilterFixedString
(
text
)
contacts
.
invalidate
()
}
function
_removeContact
(
contact
)
{
Utils
.
openConfirmDialog
(
contact
,
{
descriptionText
:
qsTr
(
'
removeContactDescription
'
),
exitHandler
:
function
(
status
)
{
console
.
log
(
'
remove contact
'
,
status
)
},
title
:
qsTr
(
'
removeContactTitle
'
)
})
}
spacing
:
0
// -----------------------------------------------------------------
...
...
@@ -20,24 +45,22 @@ ColumnLayout {
Layout.fillWidth
:
true
Layout.preferredHeight
:
ContactsStyle
.
bar
.
height
color
:
ContactsStyle
.
bar
.
c
olor
color
:
ContactsStyle
.
bar
.
backgroundC
olor
RowLayout
{
anchors.fill
:
parent
anchors.leftMargin
:
ContactsStyle
.
bar
.
leftMargin
anchors.rightMargin
:
ContactsStyle
.
bar
.
rightMargin
spacing
:
20
anchors
{
fill
:
parent
leftMargin
:
ContactsStyle
.
bar
.
leftMargin
rightMargin
:
ContactsStyle
.
bar
.
rightMargin
}
spacing
:
ContactsStyle
.
spacing
TextField
{
Layout.fillWidth
:
true
icon
:
'
filter
'
placeholderText
:
qsTr
(
'
searchContactPlaceholder
'
)
onTextChanged
:
{
contacts
.
setFilterFixedString
(
text
)
contacts
.
invalidate
()
}
onTextChanged
:
_filter
(
text
)
}
ExclusiveButtons
{
...
...
@@ -67,115 +90,134 @@ ColumnLayout {
ScrollableListView
{
anchors.fill
:
parent
spacing
:
ContactsStyle
.
contacts
.
spacing
spacing
:
0
model
:
ContactsListModel
{
id
:
contacts
}
delegate
:
Rectangle
{
id
:
contact
color
:
'
#FFFFFF
'
height
:
50
delegate
:
Borders
{
borderColor
:
ContactsStyle
.
contact
.
border
.
color
bottomWidth
:
ContactsStyle
.
contact
.
border
.
width
height
:
ContactsStyle
.
contact
.
height
width
:
parent
.
width
MouseArea
{
anchors.fill
:
parent
hoverEnabled
:
true
onEntered
:
contact
.
state
=
'
hover
'
onExited
:
contact
.
state
=
''
}
Rectangle
{
id
:
contact
Item
{
anchors.verticalCenter
:
parent
.
verticalCenter
height
:
30
width
:
parent
.
width
anchors.fill
:
parent
color
:
ContactsStyle
.
contact
.
backgroundColor
.
normal
RowLayout
{
anchors.fill
:
parent
anchors.leftMargin
:
15
anchors.rightMargin
:
25
spacing
:
15
anchors
{
fill
:
parent
leftMargin
:
ContactsStyle
.
contact
.
leftMargin
rightMargin
:
ContactsStyle
.
contact
.
rightMargin
}
spacing
:
ContactsStyle
.
contact
.
spacing
// Avatar.
Avatar
{
Layout.
fillHeight
:
parent
.
height
Layout.preferredWidth
:
30
Layout.
preferredHeight
:
ContactsStyle
.
contact
.
avatarSize
Layout.preferredWidth
:
ContactsStyle
.
contact
.
avatarSize
image
:
$contact
.
avatar
username
:
$contact
.
username
}
// Presence.
Item
{
Layout.fillHeight
:
parent
.
height
Layout.preferredWidth
:
20
PresenceLevel
{
anchors.fill
:
parent
level
:
$contact
.
presenceLevel
}
}
// Username.
Text
{
Layout.fillHeight
:
parent
.
height
Layout.fillWidth
:
true
clip
:
true
color
:
'
#5A585B
'
Layout.preferredWidth
:
ContactsStyle
.
contact
.
username
.
width
color
:
ContactsStyle
.
contact
.
username
.
color
elide
:
Text
.
ElideRight
font.bold
:
true
text
:
$contact
.
username
verticalAlignment
:
Text
.
AlignVCenter
}
// Actions.
Row
{
id
:
actions
// Container.
Item
{
Layout.fillWidth
:
true
Layout.fillHeight
:
true
spacing
:
50
visible
:
false
ActionBar
{
i
conSize
:
parent
.
height
Item
{
i
d
:
container1
ActionButton
{
icon
:
'
video_call
'
onClicked
:
CallsWindow
.
show
()
anchors.fill
:
parent
PresenceLevel
{
anchors
{
left
:
parent
.
left
verticalCenter
:
parent
.
verticalCenter
}
height
:
ContactsStyle
.
contact
.
presenceLevelSize
width
:
ContactsStyle
.
contact
.
presenceLevelSize
level
:
$contact
.
presenceLevel
}
}
ActionButton
{
icon
:
'
call
'
onClicked
:
CallsWindow
.
show
()
Item
{
id
:
container2
anchors.fill
:
parent
visible
:
false
ActionBar
{
anchors
{
left
:
parent
.
left
verticalCenter
:
parent
.
verticalCenter
}
iconSize
:
ContactsStyle
.
contact
.
actionButtonsSize
ActionButton
{
icon
:
'
video_call
'
onClicked
:
CallsWindow
.
show
()
}
ActionButton
{
icon
:
'
call
'
onClicked
:
CallsWindow
.
show
()
}
ActionButton
{
icon
:
'
chat
'
onClicked
:
window
.
setView
(
'
Conversation
'
)
}
}
ActionButton
{
icon
:
'
chat
'
onClicked
:
window
.
setView
(
'
Conversation
'
)
anchors
{
right
:
parent
.
right
verticalCenter
:
parent
.
verticalCenter
}
icon
:
'
delete
'
iconSize
:
ContactsStyle
.
contact
.
deleteButtonSize
onClicked
:
_removeContact
(
$contact
)
}
}
ActionButton
{
iconSize
:
parent
.
height
icon
:
'
delete
'
onClicked
:
Utils
.
openConfirmDialog
(
contact
,
{
descriptionText
:
qsTr
(
'
removeContactDescription
'
),
exitHandler
:
function
(
status
)
{
console
.
log
(
'
remove contact
'
,
status
)
},
title
:
qsTr
(
'
removeContactTitle
'
)
})
}
}
}
}
states
:
State
{
name
:
'
hover
'
PropertyChanges
{
target
:
contact
;
color
:
'
#D1D1D1
'
}
PropertyChanges
{
target
:
actions
;
visible
:
true
}
MouseArea
{
anchors.fill
:
parent
hoverEnabled
:
true
onEntered
:
contact
.
state
=
'
hover
'
onExited
:
contact
.
state
=
''
}
// -----------------------------------------------------------
states
:
State
{
name
:
'
hover
'
PropertyChanges
{
color
:
ContactsStyle
.
contact
.
backgroundColor
.
hovered
target
:
contact
}
PropertyChanges
{
target
:
container1
;
visible
:
false
}
PropertyChanges
{
target
:
container2
;
visible
:
true
}
}
}
}
}
...
...
tests/ui/views/App/Styles/MainWindow/ContactsStyle.qml
View file @
0b56121f
...
...
@@ -7,15 +7,38 @@ import Common 1.0
QtObject
{
property
color
backgroundColor
:
'
#FFFFFF
'
property
int
spacing
:
20
property
QtObject
bar
:
QtObject
{
property
color
c
olor
:
'
#F3F3F3
'
property
color
backgroundC
olor
:
'
#F3F3F3
'
property
int
height
:
60
property
int
leftMargin
:
18
property
int
rightMargin
:
18
}
property
QtObject
contacts
:
QtObject
{
property
int
spacing
:
1
property
QtObject
contact
:
QtObject
{
property
int
actionButtonsSize
:
36
property
int
avatarSize
:
30
property
int
deleteButtonSize
:
16
property
int
height
:
50
property
int
leftMargin
:
15
property
int
presenceLevelSize
:
12
property
int
rightMargin
:
25
property
int
spacing
:
15
property
QtObject
backgroundColor
:
QtObject
{
property
color
normal
:
'
#FFFFFF
'
property
color
hovered
:
'
#E2E9EF
'
}
property
QtObject
border
:
QtObject
{
property
color
color
:
'
#E8E8E8
'
property
int
width
:
1
}
property
QtObject
username
:
QtObject
{
property
color
color
:
'
#4B5964
'
property
int
width
:
220
}
}
}
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