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
54f28831
Commit
54f28831
authored
Feb 21, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Main/ContactEdit): display correctly background color
parent
3e6d15f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
180 additions
and
179 deletions
+180
-179
ContactEdit.qml
linphone-desktop/ui/views/App/Main/ContactEdit.qml
+180
-179
No files found.
linphone-desktop/ui/views/App/Main/ContactEdit.qml
View file @
54f28831
...
@@ -215,243 +215,244 @@ ColumnLayout {
...
@@ -215,243 +215,244 @@ ColumnLayout {
// Info list.
// Info list.
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Loader
{
Rectangle
{
Layout.fillHeight
:
true
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Layout.fillWidth
:
true
active
:
_vcard
!=
null
color
:
ContactEditStyle
.
content
.
color
sourceComponent
:
Flickable
{
id
:
flick
// -----------------------------------------------------------------------
Loader
{
anchors.fill
:
parent
function
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
{
active
:
_vcard
!=
null
if
(
newValue
===
defaultValue
)
{
sourceComponent
:
Flickable
{
return
id
:
flick
}
// ---------------------------------------------------------------------
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
function
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
{
?
_vcard
.
addSipAddress
(
newValue
)
if
(
newValue
===
defaultValue
)
{
:
_vcard
.
updateSipAddress
(
defaultValue
,
newValue
)
return
}
addresses
.
setInvalid
(
index
,
!
so_far_so_good
)
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
}
?
_vcard
.
addSipAddress
(
newValue
)
:
_vcard
.
updateSipAddress
(
defaultValue
,
newValue
)
function
_handleCompanyChanged
(
index
,
defaultValue
,
newValue
)
{
addresses
.
setInvalid
(
index
,
!
so_far_so_good
)
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
}
?
_vcard
.
addCompany
(
newValue
)
:
_vcard
.
updateCompany
(
defaultValue
,
newValue
)
function
_handleCompanyChanged
(
index
,
defaultValue
,
newValue
)
{
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
_vcard
.
addCompany
(
newValue
)
:
_vcard
.
updateCompany
(
defaultValue
,
newValue
)
companies
.
setInvalid
(
index
,
!
so_far_so_good
)
companies
.
setInvalid
(
index
,
!
so_far_so_good
)
}
}
function
_handleEmailChanged
(
index
,
defaultValue
,
newValue
)
{
function
_handleEmailChanged
(
index
,
defaultValue
,
newValue
)
{
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
var
so_far_so_good
=
(
defaultValue
.
length
===
0
)
?
_vcard
.
addEmail
(
newValue
)
?
_vcard
.
addEmail
(
newValue
)
:
_vcard
.
updateEmail
(
defaultValue
,
newValue
)
:
_vcard
.
updateEmail
(
defaultValue
,
newValue
)
emails
.
setInvalid
(
index
,
!
so_far_so_good
)
emails
.
setInvalid
(
index
,
!
so_far_so_good
)
}
function
_handleUrlChanged
(
index
,
defaultValue
,
newValue
)
{
var
url
=
Utils
.
extractFirstUri
(
newValue
)
if
(
url
===
defaultValue
)
{
return
}
}
var
so_far_so_good
=
url
&&
(
function
_handleUrlChanged
(
index
,
defaultValue
,
newValue
)
{
var
url
=
Utils
.
extractFirstUri
(
newValue
)
if
(
url
===
defaultValue
)
{
return
}
var
so_far_so_good
=
url
&&
(
defaultValue
.
length
===
0
defaultValue
.
length
===
0
?
_vcard
.
addUrl
(
newValue
)
?
_vcard
.
addUrl
(
newValue
)
:
_vcard
.
updateUrl
(
defaultValue
,
newValue
)
:
_vcard
.
updateUrl
(
defaultValue
,
newValue
)
)
)
urls
.
setInvalid
(
index
,
!
so_far_so_good
)
urls
.
setInvalid
(
index
,
!
so_far_so_good
)
}
}
function
_handleAddressChanged
(
index
,
value
)
{
function
_handleAddressChanged
(
index
,
value
)
{
if
(
index
===
0
)
{
// Street.
if
(
index
===
0
)
{
// Street.
_vcard
.
setStreet
(
value
)
_vcard
.
setStreet
(
value
)
}
else
if
(
index
===
1
)
{
// Locality.
}
else
if
(
index
===
1
)
{
// Locality.
_vcard
.
setLocality
(
value
)
_vcard
.
setLocality
(
value
)
}
else
if
(
index
===
2
)
{
// Postal code.
}
else
if
(
index
===
2
)
{
// Postal code.
_vcard
.
setPostalCode
(
value
)
_vcard
.
setPostalCode
(
value
)
}
else
if
(
index
===
3
)
{
// Country.
}
else
if
(
index
===
3
)
{
// Country.
_vcard
.
setCountry
(
value
)
_vcard
.
setCountry
(
value
)
}
}
}
}
// --
---------------------------------------------------------------------
//
---------------------------------------------------------------------
ScrollBar.vertical
:
ForceScrollBar
{}
ScrollBar.vertical
:
ForceScrollBar
{}
boundsBehavior
:
Flickable
.
StopAtBounds
boundsBehavior
:
Flickable
.
StopAtBounds
clip
:
true
clip
:
true
contentHeight
:
infoList
.
height
contentHeight
:
infoList
.
height
contentWidth
:
width
-
ScrollBar
.
vertical
.
width
contentWidth
:
width
-
ScrollBar
.
vertical
.
width
flickableDirection
:
Flickable
.
VerticalFlick
flickableDirection
:
Flickable
.
VerticalFlick
// --
---------------------------------------------------------------------
//
---------------------------------------------------------------------
Connections
{
Connections
{
target
:
_vcard
target
:
_vcard
onVcardUpdated
:
{
onVcardUpdated
:
{
addresses
.
setData
(
_vcard
.
sipAddresses
)
addresses
.
setData
(
_vcard
.
sipAddresses
)
companies
.
setData
(
_vcard
.
companies
)
companies
.
setData
(
_vcard
.
companies
)
emails
.
setData
(
_vcard
.
emails
)
emails
.
setData
(
_vcard
.
emails
)
urls
.
setData
(
_vcard
.
urls
)
urls
.
setData
(
_vcard
.
urls
)
}
}
}
}
// -----------------------------------------------------------------------
Rectangle
{
// ---------------------------------------------------------------------
anchors.fill
:
parent
color
:
ContactEditStyle
.
content
.
color
}
ColumnLayout
{
id
:
infoList
width
:
flick
.
contentWidth
ColumnLayout
{
id
:
infoList
ListForm
{
width
:
flick
.
contentWidth
id
:
addresses
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
ListForm
{
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
id
:
addresses
Layout.topMargin
:
ContactEditStyle
.
values
.
topMargin
defaultData
:
_vcard
.
sipAddresses
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
minValues
:
_contact
?
1
:
0
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
placeholder
:
qsTr
(
'
sipAccountsPlaceholder
'
)
Layout.topMargin
:
ContactEditStyle
.
values
.
topMargin
readOnly
:
!
_edition
title
:
qsTr
(
'
sipAccounts
'
)
onChanged
:
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
defaultData
:
_vcard
.
sipAddresses
onRemoved
:
_vcard
.
removeSipAddress
(
value
)
minValues
:
_contact
?
1
:
0
}
placeholder
:
qsTr
(
'
sipAccountsPlaceholder
'
)
readOnly
:
!
_edition
title
:
qsTr
(
'
sipAccounts
'
)
Rectangle
{
onChanged
:
_handleSipAddressChanged
(
index
,
defaultValue
,
newValue
)
Layout.fillWidth
:
true
onRemoved
:
_vcard
.
removeSipAddress
(
value
)
Layout.preferredHeight
:
ContactEditStyle
.
values
.
separator
.
height
}
color
:
ContactEditStyle
.
values
.
separator
.
color
}
ListForm
{
Rectangle
{
id
:
companies
Layout.fillWidth
:
true
Layout.preferredHeight
:
ContactEditStyle
.
values
.
separator
.
height
color
:
ContactEditStyle
.
values
.
separator
.
color
}
L
ayout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
L
istForm
{
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
id
:
companies
defaultData
:
_vcard
.
companies
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
placeholder
:
qsTr
(
'
companiesPlaceholder
'
)
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
readOnly
:
!
_edition
title
:
qsTr
(
'
companies
'
)
onChanged
:
_handleCompanyChanged
(
index
,
defaultValue
,
newValue
)
defaultData
:
_vcard
.
companies
onRemoved
:
_vcard
.
removeCompany
(
value
)
placeholder
:
qsTr
(
'
companiesPlaceholder
'
)
}
readOnly
:
!
_edition
title
:
qsTr
(
'
companies
'
)
Rectangle
{
onChanged
:
_handleCompanyChanged
(
index
,
defaultValue
,
newValue
)
Layout.fillWidth
:
true
onRemoved
:
_vcard
.
removeCompany
(
value
)
Layout.preferredHeight
:
ContactEditStyle
.
values
.
separator
.
height
}
color
:
ContactEditStyle
.
values
.
separator
.
color
}
ListForm
{
Rectangle
{
id
:
emails
Layout.fillWidth
:
true
Layout.preferredHeight
:
ContactEditStyle
.
values
.
separator
.
height
color
:
ContactEditStyle
.
values
.
separator
.
color
}
L
ayout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
L
istForm
{
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
id
:
emails
defaultData
:
_vcard
.
emails
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
inputMethodHints
:
Qt
.
ImhEmailCharactersOnly
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
placeholder
:
qsTr
(
'
emailsPlaceholder
'
)
readOnly
:
!
_edition
title
:
qsTr
(
'
emails
'
)
onChanged
:
_handleEmailChanged
(
index
,
defaultValue
,
newValue
)
defaultData
:
_vcard
.
emails
onRemoved
:
_vcard
.
removeEmail
(
value
)
inputMethodHints
:
Qt
.
ImhEmailCharactersOnly
}
placeholder
:
qsTr
(
'
emailsPlaceholder
'
)
readOnly
:
!
_edition
title
:
qsTr
(
'
emails
'
)
Rectangle
{
onChanged
:
_handleEmailChanged
(
index
,
defaultValue
,
newValue
)
Layout.fillWidth
:
true
onRemoved
:
_vcard
.
removeEmail
(
value
)
Layout.preferredHeight
:
ContactEditStyle
.
values
.
separator
.
height
}
color
:
ContactEditStyle
.
values
.
separator
.
color
}
ListForm
{
id
:
urls
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
Rectangle
{
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
Layout.fillWidth
:
true
Layout.preferredHeight
:
ContactEditStyle
.
values
.
separator
.
height
color
:
ContactEditStyle
.
values
.
separator
.
color
}
defaultData
:
_vcard
.
urls
ListForm
{
inputMethodHints
:
Qt
.
ImhUrlCharactersOnly
id
:
urls
placeholder
:
qsTr
(
'
webSitesPlaceholder
'
)
readOnly
:
!
_edition
title
:
qsTr
(
'
webSites
'
)
onChanged
:
_handleUrlChanged
(
index
,
defaultValue
,
newValue
)
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
onRemoved
:
_vcard
.
removeUrl
(
value
)
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
}
Rectangle
{
defaultData
:
_vcard
.
urls
Layout.fillWidth
:
true
inputMethodHints
:
Qt
.
ImhUrlCharactersOnly
Layout.preferredHeight
:
ContactEditStyle
.
values
.
separator
.
height
placeholder
:
qsTr
(
'
webSitesPlaceholder
'
)
color
:
ContactEditStyle
.
values
.
separator
.
color
readOnly
:
!
_edition
}
title
:
qsTr
(
'
webSites
'
)
StaticListForm
{
onChanged
:
_handleUrlChanged
(
index
,
defaultValue
,
newValue
)
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
onRemoved
:
_vcard
.
removeUrl
(
value
)
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
fields
:
{
var
address
=
_vcard
.
address
return
[{
placeholder
:
qsTr
(
'
street
'
),
text
:
address
.
street
},
{
placeholder
:
qsTr
(
'
locality
'
),
text
:
address
.
locality
},
{
placeholder
:
qsTr
(
'
postalCode
'
),
text
:
address
.
postalCode
},
{
placeholder
:
qsTr
(
'
country
'
),
text
:
address
.
country
}]
}
}
readOnly
:
!
_edition
Rectangle
{
title
:
qsTr
(
'
address
'
)
Layout.fillWidth
:
true
Layout.preferredHeight
:
ContactEditStyle
.
values
.
separator
.
height
color
:
ContactEditStyle
.
values
.
separator
.
color
}
onChanged
:
_handleAddressChanged
(
index
,
value
)
StaticListForm
{
}
Layout.leftMargin
:
ContactEditStyle
.
values
.
leftMargin
Layout.rightMargin
:
ContactEditStyle
.
values
.
rightMargin
fields
:
{
var
address
=
_vcard
.
address
return
[{
placeholder
:
qsTr
(
'
street
'
),
text
:
address
.
street
},
{
placeholder
:
qsTr
(
'
locality
'
),
text
:
address
.
locality
},
{
placeholder
:
qsTr
(
'
postalCode
'
),
text
:
address
.
postalCode
},
{
placeholder
:
qsTr
(
'
country
'
),
text
:
address
.
country
}]
}
readOnly
:
!
_edition
title
:
qsTr
(
'
address
'
)
onChanged
:
_handleAddressChanged
(
index
,
value
)
}
// --
-------------------------------------------------------------------
//
-------------------------------------------------------------------
// Edition buttons.
// Edition buttons.
// --
-------------------------------------------------------------------
//
-------------------------------------------------------------------
Row
{
Row
{
Layout.alignment
:
Qt
.
AlignHCenter
Layout.alignment
:
Qt
.
AlignHCenter
Layout.bottomMargin
:
ContactEditStyle
.
values
.
bottomMargin
Layout.bottomMargin
:
ContactEditStyle
.
values
.
bottomMargin
Layout.topMargin
:
ContactEditStyle
.
buttons
.
topMargin
Layout.topMargin
:
ContactEditStyle
.
buttons
.
topMargin
spacing
:
ContactEditStyle
.
buttons
.
spacing
spacing
:
ContactEditStyle
.
buttons
.
spacing
visible
:
_edition
visible
:
_edition
TextButtonA
{
TextButtonA
{
text
:
qsTr
(
'
cancel
'
)
text
:
qsTr
(
'
cancel
'
)
onClicked
:
_cancel
()
onClicked
:
_cancel
()
}
}
TextButtonB
{
TextButtonB
{
enabled
:
usernameInput
.
text
.
length
>
0
&&
_vcard
.
sipAddresses
.
length
>
0
enabled
:
usernameInput
.
text
.
length
>
0
&&
_vcard
.
sipAddresses
.
length
>
0
text
:
qsTr
(
'
save
'
)
text
:
qsTr
(
'
save
'
)
onClicked
:
_save
()
onClicked
:
_save
()
}
}
}
}
}
}
}
...
...
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