Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qtquickcontrols-nemo
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
NemoMobile
qtquickcontrols-nemo
Commits
7cdef75f
Commit
7cdef75f
authored
Jul 01, 2017
by
eekkelund
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new component: InverseMouseArea.qml
parent
3858cd52
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
292 additions
and
2 deletions
+292
-2
.gitignore
.gitignore
+2
-1
COPYING.APACHE
COPYING.APACHE
+202
-0
InverseMouseArea.qml
src/controls/InverseMouseArea.qml
+85
-0
controls.pro
src/controls/controls.pro
+2
-1
qmldir
src/controls/qmldir
+1
-0
No files found.
.gitignore
View file @
7cdef75f
...
@@ -12,4 +12,5 @@ documentation.list
...
@@ -12,4 +12,5 @@ documentation.list
examples/touch/glacier-components
examples/touch/glacier-components
Makefile
Makefile
installroot/
installroot/
RPMS/
RPMS/
\ No newline at end of file
debug*.list
COPYING.APACHE
0 → 100644
View file @
7cdef75f
This diff is collapsed.
Click to expand it.
src/controls/InverseMouseArea.qml
0 → 100644
View file @
7cdef75f
/**
Author : Ben Lau (@benlau)
License: Apache
*/
import
QtQuick
2.6
Item
{
id
:
component
property
Item
sensingArea
:
null
signal
pressed
property
var
_mouseArea
:
null
function
_setupMouseArea
()
{
if
(
!
_mouseArea
)
{
_mouseArea
=
mouseAreaBuilder
.
createObject
(
component
);
}
var
p
=
sensingArea
;
if
(
!
p
)
p
=
_topMostItem
();
_mouseArea
.
parent
=
p
;
}
function
_destroyMouseArea
()
{
if
(
_mouseArea
)
{
_mouseArea
.
destroy
();
_mouseArea
=
null
;
}
}
function
_inBound
(
pt
)
{
var
ret
=
false
;
if
(
pt
.
x
>=
component
.
x
&&
pt
.
y
>=
component
.
y
&&
pt
.
x
<=
component
.
x
+
component
.
width
&&
pt
.
y
<=
component
.
y
+
component
.
height
)
{
ret
=
true
;
}
return
ret
;
}
function
_topMostItem
()
{
var
p
=
component
;
while
(
p
.
parent
)
{
p
=
p
.
parent
;
}
return
p
;
}
Component
{
id
:
mouseAreaBuilder
MouseArea
{
propagateComposedEvents
:
true
anchors.fill
:
parent
z
:
200000000
onPressed
:
{
mouse
.
accepted
=
false
;
var
pt
=
mapToItem
(
component
.
parent
,
mouse
.
x
,
mouse
.
y
)
if
(
!
_inBound
(
pt
))
component
.
pressed
();
}
}
}
onEnabledChanged
:
{
_destroyMouseArea
();
if
(
enabled
)
{
_setupMouseArea
();
}
}
Component
.
onCompleted
:
{
if
(
enabled
)
_setupMouseArea
();
}
Component
.
onDestruction
:
{
_destroyMouseArea
();
}
}
src/controls/controls.pro
View file @
7cdef75f
...
@@ -21,7 +21,8 @@ QML_FILES += \
...
@@ -21,7 +21,8 @@ QML_FILES += \
ListView
.
qml
\
ListView
.
qml
\
ListViewItemWithActions
.
qml
\
ListViewItemWithActions
.
qml
\
GlacierRoller
.
qml
\
GlacierRoller
.
qml
\
GlacierRollerItem
.
qml
GlacierRollerItem
.
qml
\
InverseMouseArea
.
qml
OTHER_FILES
+=
qmldir
\
OTHER_FILES
+=
qmldir
\
$$
QML_FILES
$$
QML_FILES
...
...
src/controls/qmldir
View file @
7cdef75f
...
@@ -23,6 +23,7 @@ ListView 1.0 ListView.qml
...
@@ -23,6 +23,7 @@ ListView 1.0 ListView.qml
ListViewItemWithActions 1.0 ListViewItemWithActions.qml
ListViewItemWithActions 1.0 ListViewItemWithActions.qml
GlacierRoller 1.0 GlacierRoller.qml
GlacierRoller 1.0 GlacierRoller.qml
GlacierRollerItem 1.0 GlacierRollerItem.qml
GlacierRollerItem 1.0 GlacierRollerItem.qml
InverseMouseArea 1.0 InverseMouseArea.qml
# MIRRORED CONTROLS:
# MIRRORED CONTROLS:
# These are the controls that we take directly from official QQC.
# These are the controls that we take directly from official QQC.
...
...
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