Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Mobile
Commits
5a4fdc5a
Commit
5a4fdc5a
authored
Oct 04, 2019
by
Marco Martin
Browse files
better looking shadow
parent
2dbb5e7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
containments/panel/package/contents/ui/SlidingPanel.qml
View file @
5a4fdc5a
...
...
@@ -32,10 +32,9 @@ NanoShell.FullScreenOverlay {
property
bool
userInteracting
:
false
readonly
property
bool
wideScreen
:
width
>
units
.
gridUnit
*
45
readonly
property
int
drawerWidth
:
wideScreen
?
units
.
gridUnit
*
25
:
width
readonly
property
int
drawerHeight
:
contentArea
.
height
+
headerHeight
property
int
drawerX
:
0
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.6
*
Math
.
min
(
1
,
offset
/
drawerH
eight
))
color
:
"
transparent
"
//
Qt.rgba(0, 0, 0, 0.6 * Math.min(1, offset/
contentArea.h
eight))
property
alias
contentItem
:
contentArea
.
contentItem
property
int
headerHeight
...
...
@@ -51,7 +50,6 @@ NanoShell.FullScreenOverlay {
closeAnim
.
running
=
true
;
}
function
updateState
()
{
print
(
"
SUKUNNU
"
+
offset
+
"
"
+
openThreshold
)
if
(
offset
<
openThreshold
)
{
close
();
}
else
{
...
...
@@ -75,6 +73,7 @@ NanoShell.FullScreenOverlay {
window
.
requestActivate
();
}
}
SequentialAnimation
{
id
:
closeAnim
PropertyAnimation
{
...
...
@@ -98,27 +97,68 @@ NanoShell.FullScreenOverlay {
easing.type
:
Easing
.
InOutQuad
properties
:
"
offset
"
from
:
window
.
offset
to
:
drawerH
eight
to
:
contentArea
.
h
eight
}
Rectangle
{
anchors
{
fill
:
parent
topMargin
:
headerHeight
}
color
:
"
black
"
opacity
:
0.6
*
Math
.
min
(
1
,
offset
/
contentArea
.
height
)
Rectangle
{
height
:
headerHeight
anchors
{
left
:
parent
.
left
right
:
parent
.
right
bottom
:
parent
.
top
}
color
:
"
black
"
opacity
:
0.2
}
Rectangle
{
height
:
units
.
smallSpacing
anchors
{
left
:
parent
.
left
right
:
parent
.
right
top
:
parent
.
top
}
gradient
:
Gradient
{
GradientStop
{
position
:
1.0
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.0
)
}
GradientStop
{
position
:
0.5
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.4
)
}
GradientStop
{
position
:
1.0
color
:
"
transparent
"
}
}
}
}
PlasmaCore.ColorScope
{
anchors.fill
:
parent
Flickable
{
id
:
mainFlickable
anchors.fill
:
parent
anchors
{
fill
:
parent
topMargin
:
headerHeight
}
Binding
{
target
:
mainFlickable
property
:
"
contentY
"
value
:
-
window
.
offset
+
drawerH
eight
value
:
-
window
.
offset
+
contentArea
.
h
eight
when
:
!
mainFlickable
.
moving
&&
!
mainFlickable
.
dragging
&&
!
mainFlickable
.
flicking
}
//no loop as those 2 values compute to exactly the same
onContentYChanged
:
{
window
.
offset
=
-
contentY
+
drawerHeight
/* if (contentY > drawerHeight) {
contentY = d;
}*/
window
.
offset
=
-
contentY
+
contentArea
.
height
}
contentWidth
:
window
.
width
contentHeight
:
window
.
height
*
2
...
...
@@ -140,7 +180,6 @@ NanoShell.FullScreenOverlay {
onClicked
:
window
.
close
();
PlasmaComponents.Control
{
id
:
contentArea
y
:
headerHeight
x
:
drawerX
width
:
drawerWidth
}
...
...
containments/panel/package/contents/ui/main.qml
View file @
5a4fdc5a
...
...
@@ -197,7 +197,7 @@ PlasmaCore.ColorScope {
slidingPanel
.
drawerX
=
Math
.
min
(
Math
.
max
(
0
,
mouse
.
x
-
slidingPanel
.
drawerWidth
/
2
),
slidingPanel
.
width
-
slidingPanel
.
drawerWidth
)
slidingPanel
.
userInteracting
=
true
;
oldMouseY
=
mouse
.
y
;
slidingPanel
.
offset
=
units
.
gridUnit
*
2
;
slidingPanel
.
offset
=
0
//
units.gridUnit * 2;
slidingPanel
.
showFullScreen
();
}
onPositionChanged
:
{
...
...
Write
Preview
Supports
Markdown
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