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
bd4b18d2
Commit
bd4b18d2
authored
Mar 17, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Calls/Incall): all logic functions are now in a specific file
parent
176e3d1a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
43 deletions
+42
-43
qmldir
linphone-desktop/ui/modules/Linphone/Styles/qmldir
+1
-1
Incall.js
linphone-desktop/ui/views/App/Calls/Incall.js
+31
-0
Incall.qml
linphone-desktop/ui/views/App/Calls/Incall.qml
+10
-42
No files found.
linphone-desktop/ui/modules/Linphone/Styles/qmldir
View file @
bd4b18d2
# See: https://wiki.qt.io/Qml_Styling
module Linphone.Style
module Linphone.Style
s
# Components styles ------------------------------------------------------------
...
...
linphone-desktop/ui/views/App/Calls/Incall.js
View file @
bd4b18d2
...
...
@@ -8,6 +8,14 @@
// =============================================================================
function
computeAvatarSize
(
maxSize
)
{
var
height
=
container
.
height
var
width
=
container
.
width
var
size
=
height
<
maxSize
&&
height
>
0
?
height
:
maxSize
return
size
<
width
?
size
:
width
}
function
handleVideoRequested
()
{
var
call
=
incall
.
call
var
dialog
...
...
@@ -30,6 +38,7 @@ function handleVideoRequested () {
call
.
statusChanged
.
connect
(
endedHandler
)
// Ask video to user.
dialog
=
Utils
.
openConfirmDialog
(
window
,
{
descriptionText
:
qsTr
(
'
acceptVideoDescription
'
),
exitHandler
:
function
(
status
)
{
...
...
@@ -48,3 +57,25 @@ function handleVideoRequested () {
title
:
qsTr
(
'
acceptVideoTitle
'
)
})
}
function
showFullScreen
()
{
if
(
incall
.
_fullscreen
)
{
return
}
incall
.
_fullscreen
=
Utils
.
openWindow
(
'
IncallFullscreenWindow
'
,
incall
,
{
properties
:
{
call
:
incall
.
call
,
callsWindow
:
incall
}
})
}
function
updateCallQualityIcon
()
{
var
quality
=
call
.
quality
callQuality
.
icon
=
'
call_quality_
'
+
(
// Note: `quality` is in the [0, 5] interval.
// It's necessary to map in the `call_quality_` interval. ([0, 3])
quality
>=
0
?
Math
.
round
(
quality
/
(
5
/
3
))
:
0
)
}
linphone-desktop/ui/views/App/Calls/Incall.qml
View file @
bd4b18d2
...
...
@@ -18,6 +18,7 @@ Rectangle {
// ---------------------------------------------------------------------------
// Used by `IncallFullscreenWindow.qml`.
readonly
property
bool
cameraActivated
:
cameraLoader
.
status
!==
Loader
.
Null
||
cameraPreviewLoader
.
status
!==
Loader
.
Null
...
...
@@ -29,21 +30,6 @@ Rectangle {
// ---------------------------------------------------------------------------
function
_showFullscreen
()
{
if
(
_fullscreen
)
{
return
}
_fullscreen
=
Utils
.
openWindow
(
'
IncallFullscreenWindow
'
,
incall
,
{
properties
:
{
call
:
incall
.
call
,
callsWindow
:
incall
}
})
}
// ---------------------------------------------------------------------------
color
:
CallStyle
.
backgroundColor
// ---------------------------------------------------------------------------
...
...
@@ -89,14 +75,7 @@ Rectangle {
running
:
true
triggeredOnStart
:
true
onTriggered
:
{
var
quality
=
call
.
quality
callQuality
.
icon
=
'
call_quality_
'
+
(
// Note: `quality` is in the [0, 5] interval.
// It's necessary to map in the `call_quality_` interval. ([0, 3])
quality
>=
0
?
Math
.
round
(
quality
/
(
5
/
3
))
:
0
)
}
onTriggered
:
Logic
.
updateCallQualityIcon
()
}
}
...
...
@@ -144,7 +123,7 @@ Rectangle {
icon
:
'
fullscreen
'
visible
:
call
.
videoEnabled
onClicked
:
_
showFullscreen
()
onClicked
:
Logic
.
showFullscreen
()
}
}
}
...
...
@@ -158,13 +137,13 @@ Rectangle {
font.pointSize
:
CallStyle
.
header
.
elapsedTime
.
fontSize
horizontalAlignment
:
Text
.
AlignHCenter
Component.onCompleted
:
{
var
updateDuration
=
function
()
{
text
=
Utils
.
formatElapsedTime
(
call
.
duration
)
Utils
.
setTimeout
(
elapsedTime
,
1000
,
updateDuration
)
}
Timer
{
interval
:
1000
repeat
:
true
running
:
true
triggeredOnStart
:
true
updateDuration
(
)
onTriggered
:
elapsedTime
.
text
=
Utils
.
formatElapsedTime
(
call
.
duration
)
}
}
...
...
@@ -183,17 +162,6 @@ Rectangle {
id
:
avatar
Avatar
{
function
_computeAvatarSize
()
{
var
height
=
container
.
height
var
width
=
container
.
width
var
size
=
height
<
CallStyle
.
container
.
avatar
.
maxSize
&&
height
>
0
?
height
:
CallStyle
.
container
.
avatar
.
maxSize
return
size
<
width
?
size
:
width
}
backgroundColor
:
CallStyle
.
container
.
avatar
.
backgroundColor
foregroundColor
:
call
.
status
===
CallModel
.
CallStatusPaused
?
CallStyle
.
container
.
pause
.
color
...
...
@@ -201,7 +169,7 @@ Rectangle {
image
:
_contactObserver
.
contact
&&
_contactObserver
.
contact
.
vcard
.
avatar
username
:
contactDescription
.
username
height
:
_computeAvatarSize
(
)
height
:
Logic
.
computeAvatarSize
(
CallStyle
.
container
.
avatar
.
maxSize
)
width
:
height
Text
{
...
...
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