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
a1f33b42
Commit
a1f33b42
authored
Oct 27, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(SearchBox): change text input style
parent
b7a48f73
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
21 deletions
+68
-21
SearchBox.qml
tests/ui/modules/Common/SearchBox.qml
+58
-18
PopupStyle.qml
tests/ui/modules/Common/Styles/PopupStyle.qml
+2
-2
SearchBoxStyle.qml
tests/ui/modules/Common/Styles/SearchBoxStyle.qml
+8
-1
No files found.
tests/ui/modules/Common/SearchBox.qml
View file @
a1f33b42
...
...
@@ -9,7 +9,7 @@ import Common.Styles 1.0
// ===================================================================
Item
{
id
:
item
id
:
searchBox
property
alias
delegate
:
list
.
delegate
property
alias
entryHeight
:
menu
.
entryHeight
...
...
@@ -26,23 +26,26 @@ Item {
signal
menuClosed
signal
menuOpened
// -----------------------------------------------------------------
function
hideMenu
()
{
menu
.
hideMenu
()
shadow
.
visible
=
false
searchField
.
focus
=
false
desktopPopup
.
hide
()
if
(
!
_isOpen
)
{
return
}
menuClosed
()
_isOpen
=
false
}
function
showMenu
()
{
menu
.
showMenu
()
shadow
.
visible
=
true
desktopPopup
.
show
()
if
(
_isOpen
)
{
return
}
menuOpened
()
_isOpen
=
true
}
// -----------------------------------------------------------------
implicitHeight
:
searchField
.
height
Item
{
...
...
@@ -61,6 +64,11 @@ Item {
onActiveFocusChanged
:
activeFocus
&&
searchBox
.
showMenu
()
onTextChanged
:
{
console
.
assert
(
model
.
setFilterFixedString
!=
null
,
'
`model.setFilterFixedString` must be defined.
'
)
model
.
setFilterFixedString
(
text
)
if
(
model
.
invalidate
)
{
...
...
@@ -69,17 +77,11 @@ Item {
}
}
PopupShadow
{
id
:
shadow
anchors.fill
:
searchField
source
:
searchField
visible
:
false
}
// Wrap the search box menu in a window.
DesktopPopup
{
id
:
desktopPopup
// The menu is always below the search field.
property
point
coords
:
{
var
point
=
searchBox
.
mapToItem
(
null
,
0
,
searchBox
.
height
)
point
.
x
+=
window
.
x
...
...
@@ -109,4 +111,42 @@ Item {
}
}
}
// -----------------------------------------------------------------
states
:
State
{
name
:
'
opened
'
when
:
_isOpen
}
transitions
:
[
Transition
{
from
:
''
to
:
'
opened
'
ScriptAction
{
script
:
{
menu
.
showMenu
()
desktopPopup
.
show
()
menuOpened
()
}
}
},
Transition
{
from
:
'
opened
'
to
:
''
ScriptAction
{
script
:
{
menu
.
hideMenu
()
searchField
.
focus
=
false
desktopPopup
.
hide
()
menuClosed
()
}
}
}
]
}
tests/ui/modules/Common/Styles/PopupStyle.qml
View file @
a1f33b42
...
...
@@ -15,9 +15,9 @@ QtObject {
property
QtObject
shadow
:
QtObject
{
property
color
color
:
Colors
.
f
property
int
horizontalOffset
:
2
property
int
horizontalOffset
:
4
property
int
radius
:
8
property
int
samples
:
15
property
int
verticalOffset
:
2
property
int
verticalOffset
:
4
}
}
tests/ui/modules/Common/Styles/SearchBoxStyle.qml
View file @
a1f33b42
...
...
@@ -9,7 +9,14 @@ QtObject {
property
color
shadowColor
:
Colors
.
f
property
Rectangle
searchFieldBackground
:
Rectangle
{
implicitHeight
:
30
implicitHeight
:
40
border
{
color
:
'
#CBCBCB
'
width
:
1
}
radius
:
4
}
property
QtObject
text
:
QtObject
{
...
...
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