Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Discover
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Discover
Commits
4b67e59d
Commit
4b67e59d
authored
Jan 23, 2018
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an effect to show that the whole view isn't visible
parent
3877cb7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
24 deletions
+42
-24
discover/qml/ApplicationScreenshots.qml
discover/qml/ApplicationScreenshots.qml
+42
-24
No files found.
discover/qml/ApplicationScreenshots.qml
View file @
4b67e59d
...
...
@@ -29,9 +29,6 @@ ListView {
id
:
root
property
alias
resource
:
screenshotsModel
.
application
property
QtObject
page
property
int
currentIndex
:
-
1
readonly
property
Item
currentItem
:
root
.
currentIndex
>=
0
?
rep
.
itemAt
(
root
.
currentIndex
)
:
null
readonly
property
alias
count
:
screenshotsModel
.
count
spacing
:
Kirigami
.
Units
.
largeSpacing
focus
:
overlay
.
visible
...
...
@@ -84,7 +81,7 @@ ListView {
iconName
:
"
arrow-left
"
enabled
:
overlay
.
visible
&&
visible
visible
:
root
.
currentIndex
>=
1
onTriggered
:
root
.
currentIndex
-=
1
onTriggered
:
root
.
decrementCurrentIndex
()
}
Kirigami.Action
{
...
...
@@ -92,7 +89,7 @@ ListView {
iconName
:
"
arrow-right
"
enabled
:
overlay
.
visible
&&
visible
visible
:
root
.
currentIndex
<
(
root
.
count
-
1
)
onTriggered
:
root
.
currentIndex
+=
1
onTriggered
:
root
.
incrementCurrentIndex
()
}
}
...
...
@@ -102,11 +99,12 @@ ListView {
delegate
:
Item
{
readonly
property
url
imageSource
:
large_image_url
readonly
property
real
proportion
:
overlayImage
.
sourceSize
.
height
/
overlayImage
.
sourceSize
.
width
height
:
parent
.
height
width
:
Math
.
max
(
thumbnail
.
width
,
50
)
width
:
height
/
proportion
DropShadow
{
source
:
thumbnail
anchors.fill
:
thumbnail
anchors.fill
:
parent
verticalOffset
:
3
horizontalOffset
:
0
radius
:
12.0
...
...
@@ -114,31 +112,51 @@ ListView {
color
:
Kirigami
.
Theme
.
disabledTextColor
cached
:
true
}
opacity
:
mouse
.
containsMouse
?
0.5
:
1
MouseArea
{
id
:
mouse
anchors.fill
:
parent
hoverEnabled
:
true
onClicked
:
{
root
.
currentIndex
=
index
overlay
.
open
()
}
}
BusyIndicator
{
visible
:
running
running
:
parent
.
status
==
Image
.
Loading
anchors.centerIn
:
thumbnail
}
Image
{
id
:
thumbnail
source
:
small_image_url
height
:
parent
.
height
fillMode
:
Image
.
PreserveAspectFit
smooth
:
true
opacity
:
mouse
.
containsMouse
?
0.5
:
1
Behavior
on
opacity
{
NumberAnimation
{
easing.type
:
Easing
.
OutQuad
;
duration
:
200
}
}
}
BusyIndicator
{
visible
:
running
running
:
parent
.
status
==
Image
.
Loading
anchors.centerIn
:
thumbnail
}
}
MouseArea
{
id
:
mouse
anchors.fill
:
parent
hoverEnabled
:
true
onClicked
:
{
root
.
currentIndex
=
index
overlay
.
open
()
}
layer.enabled
:
true
// This item should be used as the 'mask'
layer.effect
:
ShaderEffect
{
property
var
colorSource
:
root
;
property
bool
atLeft
:
root
.
atXBeginning
;
property
bool
atRight
:
root
.
atXEnd
;
fragmentShader
:
"
uniform lowp bool atLeft;
uniform lowp bool atRight;
uniform lowp sampler2D colorSource;
uniform lowp float qt_Opacity;
varying highp vec2 qt_TexCoord0;
void main() {
gl_FragColor =
texture2D(colorSource, qt_TexCoord0)
* (atRight ? 1. : min(1.0, qt_TexCoord0.x * -20.0 + 20.))
* (atLeft ? 1. : min(1.0, qt_TexCoord0.x * 20.0))
* qt_Opacity;
}
}
"
}
}
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