Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Datovka projects
mobile Datovka
Commits
24651587
Commit
24651587
authored
Oct 12, 2017
by
Martin Straka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated DataboxList qml for send message
parent
df31ea63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
14 deletions
+46
-14
qml/components/DataboxList.qml
qml/components/DataboxList.qml
+46
-14
No files found.
qml/components/DataboxList.qml
View file @
24651587
...
...
@@ -29,8 +29,14 @@ import QtQuick.Controls 2.1
ListView
{
id
:
root
/* These signals should be captured to implement databox interaction. */
signal
dbClicked
(
string
dbID
,
string
dbType
,
string
dbName
,
string
dbAddress
,
string
dbEffectiveOvm
)
/* These properties must be set by caller. */
// sendMsgRecipientListModel holds recipient list from send message page (can be NULL)
property
var
sendMsgRecipientListModel
:
null
// isSendMsgAddRecipent says that we can add a databox to sendMsgRecipientListModel
property
bool
isSendMsgAddRecipent
:
false
/* This signal should be captured to implement find databox or add to recipient. */
signal
dbClicked
(
string
dbType
,
string
dbID
,
string
dbName
,
string
dbAddress
,
string
dbIc
,
string
dbEffectiveOvm
,
string
dbSendOption
)
delegate
:
Rectangle
{
id
:
dbItem
...
...
@@ -42,7 +48,7 @@ ListView {
anchors.fill
:
parent
anchors.margins
:
defaultMargin
GridLayout
{
id
:
grid
id
:
grid
SearchDatabox
columns
:
2
rows
:
3
rowSpacing
:
defaultMargin
*
0.6
...
...
@@ -75,7 +81,7 @@ ListView {
Text
{
id
:
r3c2
font.pointSize
:
textFontSizeSmall
text
:
(
rDbIc
==
""
)
?
rDbIc
:
"
IČ:
"
+
rDbIc
text
:
(
rDbIc
==
""
)
?
rDbIc
:
"
IČ:
"
+
rDbIc
}
Text
{
id
:
hiddenText
...
...
@@ -83,8 +89,15 @@ ListView {
font.pointSize
:
textFontSizeSmall
text
:
rDbEffectiveOvm
}
}
}
// GridLayout
}
// Item
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
dbItem
.
color
=
readBgColor
root
.
dbClicked
(
rDbType
,
rDbID
,
rDbName
,
rDbAddress
,
rDbIc
,
rDbEffectiveOvm
,
rDbSendOption
)
}
}
Rectangle
{
id
:
next
anchors.verticalCenter
:
parent
.
verticalCenter
...
...
@@ -97,21 +110,40 @@ ListView {
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.right
:
parent
.
right
anchors.rightMargin
:
defaultMargin
sourceSize.height
:
navImgHeight
source
:
"
qrc:/ui/next.svg
"
}
sourceSize.height
:
(
sendMsgRecipientListModel
==
null
)
?
navImgHeight
:
imgHeight
source
:
{
// set icon based on the databox list operation
if
(
sendMsgRecipientListModel
==
null
)
{
// we can view databox detail only
"
qrc:/ui/next.svg
"
}
else
if
(
isSendMsgAddRecipent
)
{
// we can add databox into send message recipient list
"
qrc:/ui/add.svg
"
}
else
{
// we can remove databox from send message recipient list
"
qrc:/ui/remove.svg
"
}
}
}
// Image
ColorOverlay
{
anchors.fill
:
nextImage
source
:
nextImage
color
:
datovkaPalette
.
windowText
}
MouseArea
{
// visible only if model is sendMsgRecipientListModel
visible
:
((
sendMsgRecipientListModel
!=
null
)
&&
!
isSendMsgAddRecipent
)
anchors.fill
:
parent
onClicked
:
{
// if sendMsgRecipientListModel is set and
// we don't add new databox into send recipient list,
// we must allow remove exist recipients from model.
if
((
sendMsgRecipientListModel
!=
null
)
&&
!
isSendMsgAddRecipent
)
{
sendMsgRecipientListModel
.
remove
(
index
)
}
}
}
// MouseArea
}
// Rectangle
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
root
.
dbClicked
(
rDbID
,
rDbType
,
rDbName
,
rDbAddress
,
rDbEffectiveOvm
)
}
}
Rectangle
{
anchors.top
:
parent
.
bottom
height
:
1
...
...
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