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
325bf7c0
Commit
325bf7c0
authored
Oct 05, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Paned): better closing
parent
bd392e5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
20 deletions
+48
-20
Paned.qml
tests/ui/modules/Linphone/Paned.qml
+48
-20
No files found.
tests/ui/modules/Linphone/Paned.qml
View file @
325bf7c0
...
...
@@ -72,6 +72,26 @@ Item {
}
}
function
_updateClosing
()
{
// Save state and close.
if
(
!
_isClosed
)
{
_isClosed
=
true
_savedContentAWidth
=
contentA
.
width
contentA
.
width
=
(
closingEdge
!==
Qt
.
LeftEdge
)
?
container
.
width
-
handle
.
width
:
0
return
}
// Restore old state.
_isClosed
=
false
contentA
.
width
=
_savedContentAWidth
_applyLimits
()
}
onWidthChanged
:
!
_isClosed
&&
_applyLimits
()
Component.onCompleted
:
{
...
...
@@ -98,28 +118,11 @@ Item {
hoverEnabled
:
true
width
:
PanedStyle
.
handle
.
width
onDoubleClicked
:
{
// Save state and close.
if
(
!
_isClosed
)
{
_isClosed
=
true
_savedContentAWidth
=
contentA
.
width
contentA
.
width
=
(
closingEdge
!==
Qt
.
LeftEdge
)
?
container
.
width
-
width
:
0
return
}
// Restore old state.
_isClosed
=
false
contentA
.
width
=
_savedContentAWidth
_applyLimits
()
}
onDoubleClicked
:
_updateClosing
()
onMouseXChanged
:
{
if
(
!
pressed
||
_isClosed
)
{
// Mouse is not pressed.
if
(
!
pressed
)
{
return
}
...
...
@@ -128,13 +131,38 @@ Item {
var
rightLimit
=
_getLimitValue
(
_rightLimit
)
var
leftLimit
=
_getLimitValue
(
_leftLimit
)
// One area is closed.
if
(
_isClosed
)
{
if
(
closingEdge
===
Qt
.
LeftEdge
)
{
if
(
offset
>
leftLimit
/
2
)
{
_updateClosing
()
}
}
else
{
if
(
-
offset
>
rightLimit
/
2
)
{
_updateClosing
()
}
}
return
}
// Check limits.
// width(B) < minimum width(B).
if
(
container
.
width
-
offset
-
contentA
.
width
-
width
<
rightLimit
)
{
contentA
.
width
=
container
.
width
-
width
-
rightLimit
if
(
closingEdge
===
Qt
.
RightEdge
&&
offset
>
rightLimit
/
2
)
{
_updateClosing
()
}
}
// width(A) < minimum width(A).
else
if
(
contentA
.
width
+
offset
<
leftLimit
)
{
contentA
.
width
=
leftLimit
if
(
closingEdge
===
Qt
.
LeftEdge
&&
-
offset
>
leftLimit
/
2
)
{
_updateClosing
()
}
}
// Resize A/B.
else
{
...
...
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