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
3e6d15f5
Commit
3e6d15f5
authored
Feb 21, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/modules/Common/Form/SearchBox): add a specific component for GNU/Linux
parent
66662eeb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
141 additions
and
1 deletion
+141
-1
resources.qrc
linphone-desktop/resources.qrc
+1
-0
SearchBox.qml
linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml
+140
-0
SearchBox.qml
linphone-desktop/ui/modules/Common/Form/SearchBox.qml
+0
-1
No files found.
linphone-desktop/resources.qrc
View file @
3e6d15f5
...
...
@@ -185,6 +185,7 @@
<file>
ui/modules/Common/Form/Fields/NumericField.qml
</file>
<file>
ui/modules/Common/Form/Fields/TextAreaField.qml
</file>
<file>
ui/modules/Common/Form/Fields/TextField.qml
</file>
<file>
ui/modules/Common/Form/+linux/SearchBox.qml
</file>
<file>
ui/modules/Common/Form/ListForm.qml
</file>
<file>
ui/modules/Common/Form/Placements/FormEmptyLine.qml
</file>
<file>
ui/modules/Common/Form/Placements/FormEntry.qml
</file>
...
...
linphone-desktop/ui/modules/Common/Form/+linux/SearchBox.qml
0 → 100644
View file @
3e6d15f5
import
QtQuick
2.7
import
Common
1.0
import
Utils
1.0
// =============================================================================
// Specific GNU/Linux version of `SearchBox` component.
// =============================================================================
Item
{
id
:
searchBox
// ---------------------------------------------------------------------------
readonly
property
alias
filter
:
searchField
.
text
property
alias
delegate
:
list
.
delegate
property
alias
header
:
list
.
header
property
alias
entryHeight
:
menu
.
entryHeight
property
alias
maxMenuHeight
:
menu
.
maxMenuHeight
property
alias
model
:
list
.
model
property
alias
placeholderText
:
searchField
.
placeholderText
property
bool
_isOpen
:
false
// ---------------------------------------------------------------------------
signal
menuClosed
signal
menuOpened
signal
enterPressed
// ---------------------------------------------------------------------------
function
hideMenu
()
{
if
(
!
_isOpen
)
{
return
}
_isOpen
=
false
}
function
showMenu
()
{
if
(
_isOpen
)
{
return
}
_isOpen
=
true
}
function
_filter
(
text
)
{
Utils
.
assert
(
model
.
setFilter
!=
null
,
'
`model.setFilter` must be defined.
'
)
model
.
setFilter
(
text
)
}
// ---------------------------------------------------------------------------
implicitHeight
:
searchField
.
height
Item
{
implicitHeight
:
searchField
.
height
+
menu
.
height
width
:
parent
.
width
TextField
{
id
:
searchField
icon
:
'
search
'
width
:
parent
.
width
Keys.onEscapePressed
:
searchBox
.
hideMenu
()
Keys.onReturnPressed
:
{
searchBox
.
hideMenu
()
searchBox
.
enterPressed
()
}
onActiveFocusChanged
:
activeFocus
&&
searchBox
.
showMenu
()
onTextChanged
:
_filter
(
text
)
}
// -------------------------------------------------------------------------
DropDownDynamicMenu
{
id
:
menu
launcher
:
searchField
relativeTo
:
searchField
relativeY
:
searchField
.
height
width
:
searchField
.
width
// If the menu is focused, the main window loses the active status.
// So It's necessary to map the keys events.
Keys.forwardTo
:
searchField
onMenuClosed
:
searchBox
.
hideMenu
()
ScrollableListView
{
id
:
list
anchors.fill
:
parent
headerPositioning
:
header
?
ListView
.
OverlayHeader
:
ListView
.
InlineFooter
}
}
}
// ---------------------------------------------------------------------------
states
:
State
{
name
:
'
opened
'
when
:
_isOpen
}
transitions
:
[
Transition
{
from
:
''
to
:
'
opened
'
ScriptAction
{
script
:
{
menu
.
showMenu
()
menuOpened
()
}
}
},
Transition
{
from
:
'
opened
'
to
:
''
ScriptAction
{
script
:
{
menu
.
hideMenu
()
searchField
.
focus
=
false
menuClosed
()
}
}
}
]
}
linphone-desktop/ui/modules/Common/Form/SearchBox.qml
View file @
3e6d15f5
...
...
@@ -2,7 +2,6 @@ import QtQuick 2.7
import
QtQuick
.
Window
2.2
import
Common
1.0
import
Common
.
Styles
1.0
import
Utils
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