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
9976c543
Commit
9976c543
authored
Oct 27, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(MainWindow): main search bar can get out of the window
parent
2fa7c843
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
22 deletions
+81
-22
InvertedMouseArea.qml
tests/ui/modules/Common/InvertedMouseArea.qml
+5
-2
AbstractDropDownMenu.qml
tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml
+11
-12
DesktopPopup.qml
tests/ui/modules/Common/Popup/DesktopPopup.qml
+58
-2
utils.js
tests/ui/scripts/Utils/utils.js
+7
-6
No files found.
tests/ui/modules/Common/InvertedMouseArea.qml
View file @
9976c543
...
...
@@ -10,6 +10,7 @@ import Utils 1.0
Item
{
id
:
item
property
bool
_mouseAlwaysOutside
property
var
_mouseArea
// When emitted, returns a function to test if the click
...
...
@@ -21,7 +22,9 @@ Item {
_mouseArea
=
builder
.
createObject
()
}
_mouseArea
.
parent
=
Utils
.
getTopParent
(
item
)
_mouseArea
.
parent
=
Utils
.
getTopParent
(
item
,
true
)
_mouseAlwaysOutside
=
_mouseArea
.
parent
!==
Utils
.
getTopParent
(
item
)
}
function
_deleteMouseArea
()
{
...
...
@@ -59,7 +62,7 @@ Item {
positionEvent
.
accepted
=
false
// Click is outside or not.
if
(
!
Utils
.
pointIsInItem
(
this
,
item
,
positionEvent
))
{
if
(
_mouseAlwaysOutside
||
!
Utils
.
pointIsInItem
(
this
,
item
,
positionEvent
))
{
if
(
_timeout
!=
null
)
{
// Remove existing timeout to avoid the creation of
// many children.
...
...
tests/ui/modules/Common/Popup/AbstractDropDownMenu.qml
View file @
9976c543
...
...
@@ -115,9 +115,8 @@ Item {
PropertyChanges
{
focus
:
true
// Necessary to use `Keys.onEscapePressed`.
opacity
:
1
opacity
:
1
.0
target
:
menu
visible
:
true
}
}
...
...
@@ -126,6 +125,10 @@ Item {
from
:
''
to
:
'
opened
'
ScriptAction
{
script
:
menu
.
visible
=
true
}
NumberAnimation
{
duration
:
PopupStyle
.
animation
.
openingDuration
easing.type
:
Easing
.
InOutQuad
...
...
@@ -135,7 +138,7 @@ Item {
SequentialAnimation
{
PauseAnimation
{
duration
:
PopupStyle
.
animation
.
clos
ingDuration
duration
:
PopupStyle
.
animation
.
open
ingDuration
}
ScriptAction
{
...
...
@@ -148,17 +151,10 @@ Item {
from
:
'
opened
'
to
:
''
NumberAnimation
{
duration
:
PopupStyle
.
animation
.
openingDuration
easing.type
:
Easing
.
InOutQuad
property
:
'
opacity
'
target
:
menu
}
NumberAnimation
{
duration
:
PopupStyle
.
animation
.
closingDuration
easing.type
:
Easing
.
InOutQuad
property
:
'
visible
'
// Ugly, use `NumberAnimation` with a bool.
property
:
'
opacity
'
target
:
menu
}
...
...
@@ -168,7 +164,10 @@ Item {
}
ScriptAction
{
script
:
menuClosed
()
script
:
{
visible
=
false
menuClosed
()
}
}
}
}
...
...
tests/ui/modules/Common/Popup/DesktopPopup.qml
View file @
9976c543
import
QtQuick
2.7
import
QtQuick
.
Window
2.2
import
Common
.
Styles
1.0
// ===================================================================
Item
{
...
...
@@ -10,13 +12,14 @@ Item {
property
alias
popupY
:
popup
.
y
default
property
alias
_content
:
content
.
data
property
bool
_isOpen
:
false
function
show
()
{
popup
.
show
()
_isOpen
=
true
}
function
hide
()
{
popup
.
hide
()
_isOpen
=
false
}
// DO NOT TOUCH THIS PROPERTIES.
...
...
@@ -34,6 +37,7 @@ Item {
id
:
popup
flags
:
Qt
.
SplashScreen
opacity
:
0
height
:
_content
[
0
]
!=
null
?
_content
[
0
].
height
:
0
width
:
_content
[
0
]
!=
null
?
_content
[
0
].
width
:
0
...
...
@@ -44,4 +48,56 @@ Item {
property
var
$parent
:
wrapper
}
}
// -----------------------------------------------------------------
states
:
State
{
name
:
'
opened
'
when
:
_isOpen
PropertyChanges
{
opacity
:
1.0
target
:
popup
}
}
transitions
:
[
Transition
{
from
:
''
to
:
'
opened
'
ScriptAction
{
script
:
popup
.
show
()
}
NumberAnimation
{
duration
:
PopupStyle
.
animation
.
openingDuration
easing.type
:
Easing
.
InOutQuad
property
:
'
opacity
'
target
:
popup
}
},
Transition
{
from
:
'
opened
'
to
:
''
NumberAnimation
{
duration
:
PopupStyle
.
animation
.
closingDuration
easing.type
:
Easing
.
InOutQuad
property
:
'
opacity
'
target
:
popup
}
SequentialAnimation
{
PauseAnimation
{
duration
:
PopupStyle
.
animation
.
closingDuration
}
ScriptAction
{
script
:
popup
.
hide
()
}
}
}
]
}
tests/ui/scripts/Utils/utils.js
View file @
9976c543
...
...
@@ -107,15 +107,16 @@ function clearTimeout (timer) {
// -------------------------------------------------------------------
// Returns the top (root) parent of one object.
function
getTopParent
(
object
)
{
function
_getTopParent
(
object
)
{
return
object
.
$parent
||
object
.
parent
function
getTopParent
(
object
,
useFakeParent
)
{
function
_getTopParent
(
object
,
useFakeParent
)
{
return
(
useFakeParent
&&
object
.
$parent
)
||
object
.
parent
}
var
parent
=
_getTopParent
(
object
)
var
parent
=
_getTopParent
(
object
,
useFakeParent
)
var
p
while
(
_getTopParent
(
parent
)
!=
null
)
{
parent
=
_getTopParent
(
parent
)
while
(
(
p
=
_getTopParent
(
parent
,
useFakeParent
)
)
!=
null
)
{
parent
=
p
}
return
parent
...
...
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