Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mobile Datovka
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
12
Issues
12
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Datovka projects
mobile Datovka
Commits
d2c5359e
Commit
d2c5359e
authored
Jan 16, 2018
by
Karel Slaný
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created FilterBar component.
parent
bf8870eb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
143 additions
and
131 deletions
+143
-131
qml/components/FilterBar.qml
qml/components/FilterBar.qml
+82
-0
qml/pages/PageContactList.qml
qml/pages/PageContactList.qml
+19
-43
qml/pages/PageDataboxSearch.qml
qml/pages/PageDataboxSearch.qml
+19
-43
qml/pages/PageMessageList.qml
qml/pages/PageMessageList.qml
+21
-45
res/qml.qrc
res/qml.qrc
+1
-0
src/main.cpp
src/main.cpp
+1
-0
No files found.
qml/components/FilterBar.qml
0 → 100644
View file @
d2c5359e
/*
* Copyright (C) 2014-2018 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
import
QtQuick
2.7
import
QtQuick
.
Controls
2.1
/*
* Filter bar component.
*/
Rectangle
{
id
:
root
/* These properties must be set by caller. */
property
string
placeholderText
:
""
property
real
fontPointSize
:
1.0
property
int
buttonImageHeight
:
1
property
string
buttonAccessibleName
:
""
signal
textChanged
(
string
text
)
signal
clearClicked
()
property
alias
filterField
:
filterField
TextField
{
id
:
filterField
anchors.top
:
parent
.
top
width
:
parent
.
width
-
clearFilterButton
.
width
placeholderText
:
root
.
placeholderText
font.pointSize
:
root
.
fontPointSize
inputMethodHints
:
Qt
.
ImhNoPredictiveText
/*
* Using explicit top, left, ... padding because plain padding
* does not centre the text properly.
*/
topPadding
:
8.0
bottomPadding
:
8.0
leftPadding
:
8.0
rightPadding
:
8.0
/* TODO - remove background if used materials */
background
:
Rectangle
{
anchors.fill
:
parent
color
:
"
transparent
"
border.color
:
"
transparent
"
}
onTextChanged
:
{
root
.
textChanged
(
filterField
.
text
)
}
}
AccessibleImageButton
{
id
:
clearFilterButton
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
sourceSize.height
:
buttonImageHeight
source
:
"
qrc:/ui/remove.svg
"
accessibleName
:
buttonAccessibleName
onClicked
:
{
filterField
.
clear
()
root
.
clearClicked
()
}
}
}
qml/pages/PageContactList.qml
View file @
d2c5359e
...
...
@@ -90,62 +90,38 @@ Item {
onClicked
:
{
databoxList
.
anchors
.
top
=
filterBar
.
bottom
filterBar
.
visible
=
true
filter
.
forceActiveFocus
()
filter
Bar
.
filterField
.
forceActiveFocus
()
Qt
.
inputMethod
.
show
()
}
}
}
}
// PageHeader
Rectangle
{
FilterBar
{
id
:
filterBar
visible
:
false
z
:
1
anchors.top
:
headerBar
.
bottom
width
:
parent
.
width
height
:
filter
.
height
color
:
(
filter
.
text
.
length
==
0
)
?
datovkaPalette
.
alternateBase
:
height
:
filter
Field
.
height
color
:
(
filter
Field
.
text
.
length
==
0
)
?
datovkaPalette
.
alternateBase
:
(
databoxList
.
count
>
0
)
?
"
#afffaf
"
:
"
#ffafaf
"
border.color
:
filter
.
activeFocus
?
"
#0066ff
"
:
"
#bdbebf
"
TextField
{
id
:
filter
anchors.top
:
parent
.
top
width
:
parent
.
width
-
close
.
width
placeholderText
:
qsTr
(
"
Set filter
"
)
font.pointSize
:
defaultTextFont
.
font
.
pointSize
inputMethodHints
:
Qt
.
ImhNoPredictiveText
/*
* Using explicit top, left, ... padding because plain padding
* does not centre the text properly.
*/
topPadding
:
8.0
bottomPadding
:
8.0
leftPadding
:
8.0
rightPadding
:
8.0
/* TODO - remove background if used materials */
background
:
Rectangle
{
anchors.fill
:
parent
color
:
"
transparent
"
border.color
:
"
transparent
"
}
onTextChanged
:
{
proxyDataboxModel
.
setFilterRegExpStr
(
filter
.
text
)
}
border.color
:
filterField
.
activeFocus
?
"
#0066ff
"
:
"
#bdbebf
"
placeholderText
:
qsTr
(
"
Set filter
"
)
fontPointSize
:
defaultTextFont
.
font
.
pointSize
buttonImageHeight
:
imgHeight
buttonAccessibleName
:
qsTr
(
"
Clear and hide filter field
"
)
onTextChanged
:
{
proxyDataboxModel
.
setFilterRegExpStr
(
text
)
}
AccessibleImageButton
{
id
:
close
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
sourceSize.height
:
imgHeight
source
:
"
qrc:/ui/remove.svg
"
accessibleName
:
qsTr
(
"
Clear and hide filter field.
"
)
onClicked
:
{
filterBar
.
visible
=
false
filter
.
clear
()
databoxList
.
anchors
.
top
=
headerBar
.
bottom
Qt
.
inputMethod
.
hide
()
}
onClearClicked
:
{
filterBar
.
visible
=
false
databoxList
.
anchors
.
top
=
headerBar
.
bottom
Qt
.
inputMethod
.
hide
()
}
}
// Rectangle
}
AccessibleText
{
id
:
emptyList
visible
:
false
...
...
qml/pages/PageDataboxSearch.qml
View file @
d2c5359e
...
...
@@ -96,7 +96,7 @@ Item {
onClicked
:
{
databoxList
.
anchors
.
top
=
filterBar
.
bottom
filterBar
.
visible
=
true
filter
.
forceActiveFocus
()
filter
Bar
.
filterField
.
forceActiveFocus
()
Qt
.
inputMethod
.
show
()
}
}
...
...
@@ -301,56 +301,32 @@ Item {
}
// Item
}
// Column
}
// Pane
Rectangle
{
FilterBar
{
id
:
filterBar
visible
:
false
z
:
1
anchors.top
:
searchPanel
.
bottom
width
:
parent
.
width
height
:
filter
.
height
color
:
(
filter
.
text
.
length
==
0
)
?
datovkaPalette
.
alternateBase
:
height
:
filter
Field
.
height
color
:
(
filter
Field
.
text
.
length
==
0
)
?
datovkaPalette
.
alternateBase
:
(
databoxList
.
count
>
0
)
?
"
#afffaf
"
:
"
#ffafaf
"
border.color
:
filter
.
activeFocus
?
"
#0066ff
"
:
"
#bdbebf
"
TextField
{
id
:
filter
anchors.top
:
parent
.
top
width
:
parent
.
width
-
closeFilterButton
.
width
placeholderText
:
qsTr
(
"
Set filter
"
)
font.pointSize
:
defaultTextFont
.
font
.
pointSize
inputMethodHints
:
Qt
.
ImhNoPredictiveText
/*
* Using explicit top, left, ... padding because plain padding
* does not centre the text properly.
*/
topPadding
:
8.0
bottomPadding
:
8.0
leftPadding
:
8.0
rightPadding
:
8.0
/* TODO - remove background if used materials */
background
:
Rectangle
{
anchors.fill
:
parent
color
:
"
transparent
"
border.color
:
"
transparent
"
}
onTextChanged
:
{
proxyDataboxModel
.
setFilterRegExpStr
(
filter
.
text
)
}
border.color
:
filterField
.
activeFocus
?
"
#0066ff
"
:
"
#bdbebf
"
placeholderText
:
qsTr
(
"
Set filter
"
)
fontPointSize
:
defaultTextFont
.
font
.
pointSize
buttonImageHeight
:
imgHeight
buttonAccessibleName
:
qsTr
(
"
Clear and hide filter field
"
)
onTextChanged
:
{
proxyDataboxModel
.
setFilterRegExpStr
(
text
)
}
AccessibleImageButton
{
id
:
closeFilterButton
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
sourceSize.height
:
imgHeight
source
:
"
qrc:/ui/remove.svg
"
accessibleName
:
qsTr
(
"
Clear and hide filter field.
"
)
onClicked
:
{
filterBar
.
visible
=
false
filter
.
clear
()
databoxList
.
anchors
.
top
=
searchPanel
.
bottom
Qt
.
inputMethod
.
hide
()
}
onClearClicked
:
{
filterBar
.
visible
=
false
databoxList
.
anchors
.
top
=
searchPanel
.
bottom
Qt
.
inputMethod
.
hide
()
}
}
// Rectangle
}
AccessibleText
{
id
:
emptyList
visible
:
false
...
...
qml/pages/PageMessageList.qml
View file @
d2c5359e
...
...
@@ -103,7 +103,7 @@ Component {
onClicked
:
{
messageList
.
anchors
.
top
=
filterBar
.
bottom
filterBar
.
visible
=
true
filter
.
forceActiveFocus
()
filter
Bar
.
filterField
.
forceActiveFocus
()
Qt
.
inputMethod
.
show
()
}
}
...
...
@@ -128,56 +128,32 @@ Component {
}
}
}
Rectangle
{
FilterBar
{
id
:
filterBar
visible
:
false
z
:
1
anchors.top
:
headerBar
.
bottom
width
:
parent
.
width
height
:
filter
.
height
color
:
(
filter
.
text
.
length
==
0
)
?
datovkaPalette
.
alternateBase
:
height
:
filter
Field
.
height
color
:
(
filter
Field
.
text
.
length
==
0
)
?
datovkaPalette
.
alternateBase
:
(
messageList
.
count
>
0
)
?
"
#afffaf
"
:
"
#ffafaf
"
border.color
:
filter
.
activeFocus
?
"
#0066ff
"
:
"
#bdbebf
"
TextField
{
id
:
filter
anchors.top
:
parent
.
top
width
:
parent
.
width
-
closeFilterButton
.
width
placeholderText
:
qsTr
(
"
Set filter
"
)
font.pointSize
:
defaultTextFont
.
font
.
pointSize
inputMethodHints
:
Qt
.
ImhNoPredictiveText
/*
* Using explicit top, left, ... padding because plain padding
* does not centre the text properly.
*/
topPadding
:
8.0
bottomPadding
:
8.0
leftPadding
:
8.0
rightPadding
:
8.0
/* TODO - remove background if used materials */
background
:
Rectangle
{
anchors.fill
:
parent
color
:
"
transparent
"
border.color
:
"
transparent
"
}
onTextChanged
:
{
proxyMessageModel
.
setFilterRegExpStr
(
filter
.
text
)
}
border.color
:
filterField
.
activeFocus
?
"
#0066ff
"
:
"
#bdbebf
"
placeholderText
:
qsTr
(
"
Set filter
"
)
fontPointSize
:
defaultTextFont
.
font
.
pointSize
buttonImageHeight
:
imgHeight
buttonAccessibleName
:
qsTr
(
"
Clear and hide filter field
"
)
onTextChanged
:
{
proxyMessageModel
.
setFilterRegExpStr
(
text
)
}
AccessibleImageButton
{
id
:
closeFilterButton
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
sourceSize.height
:
imgHeight
source
:
"
qrc:/ui/remove.svg
"
accessibleName
:
qsTr
(
"
Clear and hide filter field.
"
)
onClicked
:
{
filterBar
.
visible
=
false
filter
.
clear
()
messageList
.
anchors
.
top
=
headerBar
.
bottom
Qt
.
inputMethod
.
hide
()
}
onClearClicked
:
{
filterBar
.
visible
=
false
messageList
.
anchors
.
top
=
headerBar
.
bottom
Qt
.
inputMethod
.
hide
()
}
}
// Rectangle
}
AccessibleText
{
id
:
emptyList
visible
:
false
...
...
@@ -186,9 +162,9 @@ Component {
width
:
parent
.
width
horizontalAlignment
:
Text
.
AlignHCenter
wrapMode
:
Text
.
Wrap
text
:
(
filter
.
text
.
length
==
0
)
?
text
:
(
filter
Bar
.
filterField
.
text
.
length
==
0
)
?
qsTr
(
"
No messages or have not been downloaded yet.
"
)
:
qsTr
(
"
No message found that matches filter text '%1'.
"
).
arg
(
filter
.
text
)
qsTr
(
"
No message found that matches filter text '%1'.
"
).
arg
(
filter
Bar
.
filterField
.
text
)
}
MessageList
{
id
:
messageList
...
...
res/qml.qrc
View file @
d2c5359e
...
...
@@ -107,6 +107,7 @@
<file>../qml/components/AccessibleText.qml</file>
<file>../qml/components/AccessibleTextButton.qml</file>
<file>../qml/components/DataboxList.qml</file>
<file>../qml/components/FilterBar.qml</file>
<file>../qml/components/InputLineMenu.qml</file>
<file>../qml/components/MessageList.qml</file>
<file>../qml/components/OverlaidImage.qml</file>
...
...
src/main.cpp
View file @
d2c5359e
...
...
@@ -130,6 +130,7 @@ const struct QmlTypeEntry qmlComponents[] = {
{
"AccessibleText"
,
1
,
0
},
{
"AccessibleTextButton"
,
1
,
0
},
{
"DataboxList"
,
1
,
0
},
{
"FilterBar"
,
1
,
0
},
{
"InputLineMenu"
,
1
,
0
},
{
"MessageList"
,
1
,
0
},
{
"OverlaidImage"
,
1
,
0
},
...
...
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