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
667970c7
Commit
667970c7
authored
Oct 24, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unstable
parent
88e0688e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
18 deletions
+68
-18
DropDownMenu.qml
tests/ui/modules/Common/Popup/DropDownMenu.qml
+25
-3
SearchBox.qml
tests/ui/modules/Common/SearchBox.qml
+3
-10
CallControls.qml
tests/ui/modules/Linphone/Call/CallControls.qml
+1
-2
utils.js
tests/ui/scripts/Utils/utils.js
+20
-3
utils.spec.qml
tests/ui/scripts/Utils/utils.spec.qml
+19
-0
No files found.
tests/ui/modules/Common/Popup/DropDownMenu.qml
View file @
667970c7
...
...
@@ -16,22 +16,35 @@ Rectangle {
default
property
alias
_content
:
content
.
data
function
show
()
{
signal
menuClosed
signal
menuOpened
function
showMenu
()
{
if
(
visible
)
{
return
}
if
(
drawOnRoot
)
{
this
.
x
=
relativeTo
.
mapToItem
(
null
,
relativeTo
.
width
,
0
).
x
this
.
y
=
relativeTo
.
mapToItem
(
null
,
relativeTo
.
width
,
0
).
y
}
visible
=
true
menuOpened
()
}
function
hide
()
{
function
hideMenu
()
{
if
(
!
visible
)
{
return
}
visible
=
false
menuClosed
()
}
function
_computeHeight
()
{
var
model
=
_content
[
0
].
model
if
(
model
==
null
)
{
if
(
model
==
null
||
!
Utils
.
qmlTypeof
(
model
,
'
QQmlListModel
'
)
)
{
return
content
.
height
}
...
...
@@ -45,6 +58,8 @@ Rectangle {
visible
:
false
z
:
Constants
.
zPopup
Keys.onEscapePressed
:
hideMenu
()
Component.onCompleted
:
{
if
(
drawOnRoot
)
{
parent
=
Utils
.
getTopParent
(
this
)
...
...
@@ -62,4 +77,11 @@ Rectangle {
effect
:
PopupShadow
{}
}
}
InvertedMouseArea
{
anchors.fill
:
parent
enabled
:
parent
.
visible
onPressed
:
hideMenu
()
}
}
tests/ui/modules/Common/SearchBox.qml
View file @
667970c7
...
...
@@ -25,7 +25,7 @@ Item {
signal
menuOpened
()
function
_hideMenu
()
{
menu
.
hide
()
menu
.
hide
Menu
()
shadow
.
visible
=
false
searchField
.
focus
=
false
...
...
@@ -33,7 +33,7 @@ Item {
}
function
_showMenu
()
{
menu
.
show
()
menu
.
show
Menu
()
shadow
.
visible
=
true
menuOpened
()
...
...
@@ -69,7 +69,7 @@ Item {
anchors.top
:
searchField
.
bottom
width
:
searchField
.
width
Keys.onEscapePres
sed
:
_hideMenu
()
onMenuClo
sed
:
_hideMenu
()
ScrollableListView
{
id
:
list
...
...
@@ -78,13 +78,6 @@ Item {
}
}
InvertedMouseArea
{
anchors.fill
:
parent
enabled
:
menu
.
visible
onPressed
:
_hideMenu
()
}
PopupShadow
{
id
:
shadow
...
...
tests/ui/modules/Linphone/Call/CallControls.qml
View file @
667970c7
...
...
@@ -44,7 +44,7 @@ RowLayout {
hoverEnabled
:
true
onClicked
:
{
menu
.
show
()
menu
.
show
Menu
()
}
}
}
...
...
@@ -56,7 +56,6 @@ RowLayout {
height
:
100
width
:
120
relativeTo
:
button
Keys.onEscapePressed
:
hide
()
Rectangle
{
color
:
'
red
'
...
...
tests/ui/scripts/Utils/utils.js
View file @
667970c7
...
...
@@ -106,9 +106,9 @@ function clearTimeout (timer) {
// -------------------------------------------------------------------
// Returns the top (root) parent of one
componen
t.
function
getTopParent
(
componen
t
)
{
var
parent
=
componen
t
.
parent
// Returns the top (root) parent of one
objec
t.
function
getTopParent
(
objec
t
)
{
var
parent
=
objec
t
.
parent
while
(
parent
.
parent
!=
null
)
{
parent
=
parent
.
parent
...
...
@@ -119,6 +119,23 @@ function getTopParent (component) {
// -------------------------------------------------------------------
// Test the type of a qml object.
// Warning: this function is probably not portable
// on new versions of Qt.
//
// So, if you want to use it on a specific `className`, please to add
// a test in `test_qmlTypeof_data` of `utils.spec.qml`.
function
qmlTypeof
(
object
,
className
)
{
var
str
=
object
.
toString
()
return
(
str
.
indexOf
(
className
+
'
(
'
)
==
0
||
str
.
indexOf
(
className
+
'
_QML
'
)
==
0
)
}
// -------------------------------------------------------------------
// Invoke a `cb` function with each value of the interval: `[0, n[`.
// Return a mapped array created with the returned values of `cb`.
function
times
(
n
,
cb
,
context
)
{
...
...
tests/ui/scripts/Utils/utils.spec.qml
View file @
667970c7
...
...
@@ -111,6 +111,25 @@ TestCase {
// -----------------------------------------------------------------
function
test_qmlTypeof_data
()
{
return
[
{
component
:
'
import QtQuick 2.7; ListModel {}
'
,
result
:
true
,
type
:
'
QQmlListModel
'
}
]
}
function
test_qmlTypeof
(
data
)
{
var
object
=
Qt
.
createQmlObject
(
data
.
component
,
testCase
)
verify
(
object
)
compare
(
Utils
.
qmlTypeof
(
object
,
data
.
type
),
data
.
result
)
}
// -----------------------------------------------------------------
function
test_times1_data
()
{
return
[
{
...
...
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