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
bd392e5b
Commit
bd392e5b
authored
Oct 05, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Paned): supports a closing action on handle
parent
9fe2129e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
4 deletions
+29
-4
Paned.qml
tests/ui/modules/Linphone/Paned.qml
+28
-3
PanedStyle.qml
tests/ui/modules/Linphone/Styles/PanedStyle.qml
+1
-1
No files found.
tests/ui/modules/Linphone/Paned.qml
View file @
bd392e5b
...
...
@@ -23,11 +23,15 @@ Item {
property
alias
childA
:
contentA
.
data
property
alias
childB
:
contentB
.
data
property
int
closingEdge
:
Qt
.
LeftEdge
// User limits: string or int values.
property
var
leftLimit
:
0
property
var
rightLimit
:
0
property
bool
_isClosed
property
int
_savedContentAWidth
// Internal limits.
property
var
_leftLimit
property
var
_rightLimit
...
...
@@ -53,7 +57,7 @@ Item {
}
}
onWidthChanged
:
{
function
_applyLimits
()
{
var
rightLimit
=
_getLimitValue
(
_rightLimit
)
var
leftLimit
=
_getLimitValue
(
_leftLimit
)
...
...
@@ -68,6 +72,8 @@ Item {
}
}
onWidthChanged
:
!
_isClosed
&&
_applyLimits
()
Component.onCompleted
:
{
_leftLimit
=
_parseLimit
(
leftLimit
)
_rightLimit
=
_parseLimit
(
rightLimit
)
...
...
@@ -92,9 +98,28 @@ 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
()
}
onMouseXChanged
:
{
// Necessary because `hoverEnabled` is used.
if
(
!
pressed
)
{
if
(
!
pressed
||
_isClosed
)
{
return
}
...
...
tests/ui/modules/Linphone/Styles/PanedStyle.qml
View file @
bd392e5b
...
...
@@ -5,7 +5,7 @@ import Linphone 1.0
QtObject
{
property
QtObject
handle
:
QtObject
{
property
int
width
:
8
property
int
width
:
10
property
QtObject
color
:
QtObject
{
property
color
hovered
:
Colors
.
h
...
...
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