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
eaafc4b0
Commit
eaafc4b0
authored
Sep 27, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Popup): use style file
parent
885c16f9
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
372 additions
and
363 deletions
+372
-363
DropDownMenu.qml
tests/ui/modules/Linphone/Popup/DropDownMenu.qml
+33
-142
PopupShadow.qml
tests/ui/modules/Linphone/Popup/PopupShadow.qml
+5
-5
SearchBox.qml
tests/ui/modules/Linphone/SearchBox.qml
+59
-48
PopupStyle.qml
tests/ui/modules/Linphone/Styles/PopupStyle.qml
+9
-7
MainWindow.qml
tests/ui/views/MainWindow/MainWindow.qml
+266
-161
No files found.
tests/ui/modules/Linphone/Popup/DropDownMenu.qml
View file @
eaafc4b0
import
QtGraphicalEffects
1.0
import
QtQuick
2.7
import
QtQuick
2.7
import
QtQuick
.
Controls
2.0
import
Linphone
1.0
import
Linphone
.
Styles
1.0
import
Linphone
.
Styles
1.0
Rectangle
{
// ===================================================================
readonly
property
int
entryHeight
:
50
// Low component to display a list/menu in a popup.
// ===================================================================
property
int
maxMenuHeight
implicitHeight
:
{
var
height
=
model
.
count
*
entryHeight
return
height
>
maxMenuHeight
?
maxMenuHeight
:
height
}
visible
:
false
function
show
()
{
visible
=
true
}
function
hide
()
{
visible
=
false
}
Rectangle
{
anchors.fill
:
parent
id
:
listContainer
ScrollableListView
{
anchors.fill
:
parent
id
:
list
height
:
console
.
log
(
model
.
count
)
||
count
// TODO: Remove, use C++ model instead.
Rectangle
{
model
:
ListModel
{
default
property
alias
content
:
content
.
data
id
:
model
property
int
entryHeight
property
int
maxMenuHeight
ListElement
{
$presence
:
'
connected
'
// Ugly. Just ugly.
$sipAddress
:
'
jim.williams.zzzz.yyyy.kkkk.sip.linphone.org
'
// `model` is a reference on a unknown component!
$username
:
'
Toto
'
// See usage with SearchBox.
}
implicitHeight
:
{
ListElement
{
var
height
=
model
.
count
*
entryHeight
$presence
:
'
connected
'
return
height
>
maxMenuHeight
?
maxMenuHeight
:
height
$sipAddress
:
'
toto.lala.sip.linphone.org
'
}
$username
:
'
Toto
'
visible
:
false
}
ListElement
{
function
show
()
{
$presence
:
'
disconnected
'
visible
=
true
$sipAddress
:
'
machin.truc.sip.linphone.org
'
}
$username
:
'
Toto
'
}
function
hide
()
{
ListElement
{
visible
=
false
$presence
:
'
absent
'
}
$sipAddress
:
'
hey.listen.sip.linphone.org
'
$username
:
'
Toto
'
Rectangle
{
}
id
:
content
ListElement
{
$presence
:
'
do_not_disturb
'
anchors.fill
:
parent
$sipAddress
:
'
valentin.cognito.sip.linphone.org
'
color
:
PopupStyle
.
backgroundColor
$username
:
'
Toto
'
layer.enabled
:
true
}
layer.effect
:
PopupShadow
{
}
ListElement
{
}
$presence
:
'
do_not_disturb
'
$sipAddress
:
'
charles.henri.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
disconnected
'
$sipAddress
:
'
yesyes.nono.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
connected
'
$sipAddress
:
'
nsa.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
connected
'
$sipAddress
:
'
jim.williams.zzzz.yyyy.kkkk.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
connected
'
$sipAddress
:
'
toto.lala.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
disconnected
'
$sipAddress
:
'
machin.truc.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
absent
'
$sipAddress
:
'
hey.listen.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
do_not_disturb
'
$sipAddress
:
'
valentin.cognito.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
do_not_disturb
'
$sipAddress
:
'
charles.henri.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
disconnected
'
$sipAddress
:
'
yesyes.nono.sip.linphone.org
'
$username
:
'
Toto
'
}
ListElement
{
$presence
:
'
connected
'
$sipAddress
:
'
nsa.sip.linphone.org
'
$username
:
'
Toto
'
}
}
delegate
:
Contact
{
presence
:
$presence
sipAddress
:
$sipAddress
username
:
$username
width
:
parent
.
width
actions
:
[
ActionButton
{
icon
:
'
call
'
onClicked
:
console
.
log
(
'
clicked
'
)
},
ActionButton
{
icon
:
'
cam
'
onClicked
:
console
.
log
(
'
cam clicked
'
)
}
]
}
}
}
PopupShadow
{
anchors.fill
:
listContainer
source
:
listContainer
visible
:
true
}
}
}
tests/ui/modules/Linphone/Popup/PopupShadow.qml
View file @
eaafc4b0
...
@@ -5,9 +5,9 @@ import Linphone.Styles 1.0
...
@@ -5,9 +5,9 @@ import Linphone.Styles 1.0
// ===================================================================
// ===================================================================
DropShadow
{
DropShadow
{
color
:
PopupStyle
.
shadow
.
color
color
:
PopupStyle
.
shadow
.
color
horizontalOffset
:
PopupStyle
.
shadow
.
horizontalOffset
horizontalOffset
:
PopupStyle
.
shadow
.
horizontalOffset
radius
:
PopupStyle
.
shadow
.
radius
radius
:
PopupStyle
.
shadow
.
radius
samples
:
PopupStyle
.
shadow
.
samples
samples
:
PopupStyle
.
shadow
.
samples
verticalOffset
:
PopupStyle
.
shadow
.
verticalOffset
verticalOffset
:
PopupStyle
.
shadow
.
verticalOffset
}
}
tests/ui/modules/Linphone/SearchBox.qml
View file @
eaafc4b0
...
@@ -7,71 +7,82 @@ import Linphone.Styles 1.0
...
@@ -7,71 +7,82 @@ import Linphone.Styles 1.0
// ===================================================================
// ===================================================================
Item
{
Item
{
property
alias
placeholderText
:
searchField
.
placeholderText
id
:
item
property
alias
maxMenuHeight
:
menu
.
maxMenuHeight
signal
menuClosed
()
property
alias
delegate
:
list
.
delegate
signal
menuOpened
()
property
alias
entryHeight
:
menu
.
entryHeight
signal
searchTextChanged
(
string
text
)
property
alias
maxMenuHeight
:
menu
.
maxMenuHeight
property
alias
model
:
list
.
model
property
alias
placeholderText
:
searchField
.
placeholderText
function
_hideMenu
()
{
signal
menuClosed
()
menu
.
hide
()
signal
menuOpened
()
shadow
.
visible
=
false
signal
searchTextChanged
(
string
text
)
searchField
.
focus
=
false
menuClosed
()
function
_hideMenu
()
{
}
menu
.
hide
()
shadow
.
visible
=
false
searchField
.
focus
=
false
function
_showMenu
()
{
menuClosed
()
menu
.
show
()
}
shadow
.
visible
=
true
menuOpened
()
function
_showMenu
()
{
}
menu
.
show
()
shadow
.
visible
=
true
menuOpened
()
}
implicitHeight
:
searchField
.
height
implicitHeight
:
searchField
.
height
Item
{
implicitHeight
:
searchField
.
height
+
menu
.
height
width
:
parent
.
width
Item
{
TextField
{
implicitHeight
:
searchField
.
height
+
menu
.
height
id
:
searchField
width
:
parent
.
width
TextField
{
background
:
SearchBoxStyle
.
searchFieldBackground
id
:
searchField
width
:
parent
.
width
background
:
SearchBoxStyle
.
searchFieldBackground
Keys.onEscapePressed
:
_hideMenu
()
width
:
parent
.
width
Keys.onEscapePressed
:
_hideMenu
()
onActiveFocusChanged
:
activeFocus
&&
_showMenu
()
onTextChanged
:
searchTextChanged
(
text
)
}
DropDownMenu
{
id
:
menu
onActiveFocusChanged
:
activeFocus
&&
_showMenu
()
anchors.top
:
searchField
.
bottom
onTextChanged
:
searchTextChanged
(
text
)
width
:
searchField
.
width
}
z
:
Constants
.
zPopup
DropDownMenu
{
Keys.onEscapePressed
:
_hideMenu
()
id
:
menu
anchors.top
:
searchField
.
bottom
ScrollableListView
{
width
:
searchField
.
width
id
:
list
z
:
Constants
.
zPopup
Keys.onEscapePressed
:
_hideMenu
()
anchors.fill
:
parent
}
}
}
InvertedMouseArea
{
InvertedMouseArea
{
enabled
:
menu
.
visible
enabled
:
menu
.
visible
height
:
parent
.
height
height
:
parent
.
height
parent
:
parent
parent
:
parent
width
:
parent
.
width
width
:
parent
.
width
onPressed
:
_hideMenu
()
onPressed
:
_hideMenu
()
}
}
PopupShadow
{
PopupShadow
{
id
:
shadow
id
:
shadow
anchors.fill
:
searchField
anchors.fill
:
searchField
source
:
searchField
source
:
searchField
visible
:
false
visible
:
false
}
}
}
}
}
}
tests/ui/modules/Linphone/Styles/PopupStyle.qml
View file @
eaafc4b0
...
@@ -4,13 +4,15 @@ import QtQuick 2.7
...
@@ -4,13 +4,15 @@ import QtQuick 2.7
import
Linphone
1.0
import
Linphone
1.0
QtObject
{
QtObject
{
property
QtObject
shadow
:
QtObject
{
property
string
backgroundColor
:
Colors
.
k
property
double
radius
:
8.0
property
int
horizontalOffset
:
0
property
QtObject
shadow
:
QtObject
{
property
int
samples
:
15
property
double
radius
:
8.0
property
int
verticalOffset
:
2
property
string
color
:
Colors
.
f
property
int
horizontalOffset
:
0
}
property
int
samples
:
15
property
int
verticalOffset
:
2
property
string
color
:
Colors
.
f
}
}
}
tests/ui/views/MainWindow/MainWindow.qml
View file @
eaafc4b0
This diff is collapsed.
Click to expand it.
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