Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-qt-ui-qml
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
libdap-qt-ui-qml
Commits
241533f1
Commit
241533f1
authored
5 years ago
by
Kirill Anisimov
Browse files
Options
Downloads
Patches
Plain Diff
Added DapScrollView element.
parent
a4c2dcf4
No related branches found
No related tags found
1 merge request
!18
Features 2923
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libdap-qt-ui-qml.qrc
+2
-0
2 additions, 0 deletions
libdap-qt-ui-qml.qrc
widgets/DapScrollView.qml
+109
-0
109 additions, 0 deletions
widgets/DapScrollView.qml
widgets/DapScrollViewForm.ui.qml
+37
-0
37 additions, 0 deletions
widgets/DapScrollViewForm.ui.qml
with
148 additions
and
0 deletions
libdap-qt-ui-qml.qrc
+
2
−
0
View file @
241533f1
...
...
@@ -20,5 +20,7 @@
<file>Device.qml</file>
<file>widgets/DapRadioButton.qml</file>
<file>widgets/DapRadioButtonForm.ui.qml</file>
<file>widgets/DapScrollView.qml</file>
<file>widgets/DapScrollViewForm.ui.qml</file>
</qresource>
</RCC>
This diff is collapsed.
Click to expand it.
widgets/DapScrollView.qml
0 → 100644
+
109
−
0
View file @
241533f1
import
QtQuick
2.4
DapScrollViewForm
{
property
var
contentPos
:
0.0
viewData.onContentYChanged
:
{
if
(
viewData
.
atYBeginning
)
{
scrollButton
.
state
=
"
goUp
"
}
else
if
(
viewData
.
atYEnd
)
{
scrollButton
.
state
=
"
goDown
"
}
else
if
(
contentPos
<
viewData
.
contentItem
.
y
)
{
scrollButton
.
state
=
"
goUp
"
}
else
{
scrollButton
.
state
=
"
goDown
"
}
}
onEntered
:
{
scrollButton
.
visible
=
true
;
}
onExited
:
{
scrollButton
.
visible
=
false
;
}
scrollButton.onEntered
:
{
if
(
scrollButton
.
state
===
"
goUp
"
)
{
scrollButton
.
imageSource
=
"
qrc:/res/icons/ic_scroll-down_hover.png
"
}
else
if
(
scrollButton
.
state
===
"
goDown
"
)
{
scrollButton
.
imageSource
=
"
qrc:/res/icons/ic_scroll-up_hover.png
"
}
}
scrollButton.onExited
:
{
if
(
scrollButton
.
state
===
"
goUp
"
)
{
scrollButton
.
imageSource
=
"
qrc:/res/icons/ic_scroll-down.png
"
}
else
if
(
scrollButton
.
state
===
"
goDown
"
)
{
scrollButton
.
imageSource
=
"
qrc:/res/icons/ic_scroll-up.png
"
}
}
scrollButton.onClicked
:
{
if
(
scrollButton
.
state
===
"
goUp
"
)
{
viewData
.
positionViewAtEnd
();
scrollButton
.
state
=
"
goDown
"
;
}
else
if
(
scrollButton
.
state
===
"
goDown
"
)
{
viewData
.
positionViewAtBeginning
();
scrollButton
.
state
=
"
goUp
"
;
}
}
scrollButton.states
:
[
State
{
name
:
"
goDown
"
PropertyChanges
{
target
:
scrollButton
onStateChanged
:
{
scrollButton
.
anchors
.
top
=
undefined
scrollButton
.
anchors
.
bottom
=
parent
.
bottom
scrollButton
.
exited
()
}
}
},
State
{
name
:
"
goUp
"
PropertyChanges
{
target
:
scrollButton
onStateChanged
:
{
scrollButton
.
anchors
.
bottom
=
undefined
scrollButton
.
anchors
.
top
=
parent
.
top
scrollButton
.
exited
()
}
}
}
]
scrollButton.state
:
"
goUp
"
}
This diff is collapsed.
Click to expand it.
widgets/DapScrollViewForm.ui.qml
0 → 100644
+
37
−
0
View file @
241533f1
import
QtQuick
2.4
MouseArea
{
id
:
dapScrollMouseArea
////@ ListView to attach the ScrollButton
property
ListView
viewData
:
ListView
{}
property
alias
scrollMouseArea
:
dapScrollMouseArea
property
alias
scrollButton
:
dapScrollButton
anchors.fill
:
parent
hoverEnabled
:
true
MouseArea
{
id
:
dapScrollButton
property
string
imageSource
:
"
qrc:/res/icons/ic_scroll-down.png
"
width
:
36
*
pt
height
:
width
anchors.right
:
parent
.
right
anchors.bottom
:
parent
.
bottom
anchors.bottomMargin
:
10
*
pt
anchors.topMargin
:
10
*
pt
anchors.rightMargin
:
10
*
pt
hoverEnabled
:
true
visible
:
false
Image
{
anchors.fill
:
parent
fillMode
:
Image
.
PreserveAspectFit
source
:
dapScrollButton
.
imageSource
sourceSize.height
:
parent
.
height
sourceSize.width
:
parent
.
width
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment