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
88135d80
Commit
88135d80
authored
Mar 14, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/modules/Common/Form/ComboBox): supports `iconRole` property
parent
ad64e750
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
6 deletions
+74
-6
ComboBox.qml
linphone-desktop/ui/modules/Common/Form/ComboBox.qml
+57
-6
ComboBoxStyle.qml
...e-desktop/ui/modules/Common/Styles/Form/ComboBoxStyle.qml
+17
-0
No files found.
linphone-desktop/ui/modules/Common/Form/ComboBox.qml
View file @
88135d80
import
QtQuick
2.7
import
QtQuick
2.7
import
QtQuick
.
Controls
2.0
import
QtQuick
.
Controls
2.0
import
QtQuick
.
Layouts
1.3
import
Common
1.0
import
Common
1.0
import
Common
.
Styles
1.0
import
Common
.
Styles
1.0
...
@@ -11,6 +12,10 @@ ComboBox {
...
@@ -11,6 +12,10 @@ ComboBox {
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
string
iconRole
:
''
// ---------------------------------------------------------------------------
background
:
Rectangle
{
background
:
Rectangle
{
border
{
border
{
color
:
ComboBoxStyle
.
background
.
border
.
color
color
:
ComboBoxStyle
.
background
.
border
.
color
...
@@ -24,6 +29,22 @@ ComboBox {
...
@@ -24,6 +29,22 @@ ComboBox {
implicitWidth
:
ComboBoxStyle
.
background
.
width
implicitWidth
:
ComboBoxStyle
.
background
.
width
}
}
// ---------------------------------------------------------------------------
contentItem
:
Text
{
color
:
ComboBoxStyle
.
contentItem
.
text
.
color
elide
:
Text
.
ElideRight
font.pointSize
:
ComboBoxStyle
.
contentItem
.
text
.
fontSize
rightPadding
:
comboBox
.
indicator
.
width
+
comboBox
.
spacing
verticalAlignment
:
Text
.
AlignVCenter
text
:
comboBox
.
displayText
}
// ---------------------------------------------------------------------------
indicator
:
Icon
{
indicator
:
Icon
{
icon
:
'
drop_down
'
icon
:
'
drop_down
'
iconSize
:
ComboBoxStyle
.
background
.
iconSize
iconSize
:
ComboBoxStyle
.
background
.
iconSize
...
@@ -37,6 +58,12 @@ ComboBox {
...
@@ -37,6 +58,12 @@ ComboBox {
delegate
:
ItemDelegate
{
delegate
:
ItemDelegate
{
id
:
item
id
:
item
readonly
property
var
flattenedModel
:
textRole
.
length
&&
(
typeof
modelData
!==
'
undefined
'
?
modelData
:
model
)
hoverEnabled
:
true
width
:
comboBox
.
width
background
:
Rectangle
{
background
:
Rectangle
{
color
:
item
.
hovered
color
:
item
.
hovered
?
ComboBoxStyle
.
delegate
.
color
.
hovered
?
ComboBoxStyle
.
delegate
.
color
.
hovered
...
@@ -63,11 +90,35 @@ ComboBox {
...
@@ -63,11 +90,35 @@ ComboBox {
}
}
}
}
font.bold
:
comboBox
.
currentIndex
===
index
contentItem
:
RowLayout
{
hoverEnabled
:
true
spacing
:
ComboBoxStyle
.
delegate
.
contentItem
.
spacing
text
:
textRole
.
length
width
:
item
.
width
?
(
typeof
modelData
!==
'
undefined
'
?
modelData
[
textRole
]
:
model
[
textRole
])
:
modelData
Icon
{
width
:
comboBox
.
width
Layout.alignment
:
Qt
.
AlignVCenter
icon
:
{
var
iconRole
=
comboBox
.
iconRole
return
(
iconRole
.
length
&&
item
.
flattenedModel
[
iconRole
])
||
''
}
iconSize
:
ComboBoxStyle
.
delegate
.
contentItem
.
iconSize
visible
:
icon
.
length
>
0
}
Text
{
Layout.fillWidth
:
true
color
:
ComboBoxStyle
.
delegate
.
contentItem
.
text
.
color
elide
:
Text
.
ElideRight
font
{
bold
:
comboBox
.
currentIndex
===
index
pointSize
:
ComboBoxStyle
.
delegate
.
contentItem
.
text
.
fontSize
}
text
:
item
.
flattenedModel
[
textRole
]
||
modelData
}
}
}
}
}
}
linphone-desktop/ui/modules/Common/Styles/Form/ComboBoxStyle.qml
View file @
88135d80
...
@@ -19,12 +19,29 @@ QtObject {
...
@@ -19,12 +19,29 @@ QtObject {
}
}
}
}
property
QtObject
contentItem
:
QtObject
{
property
QtObject
text
:
QtObject
{
property
color
color
:
Colors
.
d
property
int
fontSize
:
10
}
}
property
QtObject
delegate
:
QtObject
{
property
QtObject
delegate
:
QtObject
{
property
QtObject
color
:
QtObject
{
property
QtObject
color
:
QtObject
{
property
color
hovered
:
Colors
.
y
property
color
hovered
:
Colors
.
y
property
color
normal
:
Colors
.
k
property
color
normal
:
Colors
.
k
}
}
property
QtObject
contentItem
:
QtObject
{
property
int
iconSize
:
20
property
int
spacing
:
5
property
QtObject
text
:
QtObject
{
property
color
color
:
Colors
.
d
property
int
fontSize
:
10
}
}
property
QtObject
indicator
:
QtObject
{
property
QtObject
indicator
:
QtObject
{
property
color
color
:
Colors
.
i
property
color
color
:
Colors
.
i
property
int
width
:
5
property
int
width
:
5
...
...
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