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
P
Plasma Workspace
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
64
Merge Requests
64
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
Plasma Workspace
Commits
9923cde1
Commit
9923cde1
authored
Aug 02, 2017
by
Guo Yunhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wallpaper blur background filling effect feature
parent
2aa50434
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
0 deletions
+105
-0
wallpapers/image/imagepackage/contents/ui/WallpaperDelegate.qml
...pers/image/imagepackage/contents/ui/WallpaperDelegate.qml
+18
-0
wallpapers/image/imagepackage/contents/ui/config.qml
wallpapers/image/imagepackage/contents/ui/config.qml
+19
-0
wallpapers/image/imagepackage/contents/ui/main.qml
wallpapers/image/imagepackage/contents/ui/main.qml
+68
-0
No files found.
wallpapers/image/imagepackage/contents/ui/WallpaperDelegate.qml
View file @
9923cde1
...
...
@@ -19,6 +19,7 @@
import
QtQuick
2.0
import
QtQuick
.
Controls
.
Private
1.0
import
QtGraphicalEffects
1.0
import
org
.
kde
.
kquickcontrolsaddons
2.0
import
org
.
kde
.
plasma
.
components
2.0
as
PlasmaComponents
...
...
@@ -59,6 +60,23 @@ MouseArea {
icon
:
"
view-preview
"
visible
:
!
walliePreview
.
visible
}
QPixmapItem
{
id
:
blurBackgroundSource
visible
:
cfg_Blur
anchors.fill
:
parent
smooth
:
true
pixmap
:
model
.
screenshot
fillMode
:
QPixmapItem
.
PreserveAspectCrop
}
FastBlur
{
visible
:
cfg_Blur
anchors.fill
:
parent
source
:
blurBackgroundSource
radius
:
4
}
QPixmapItem
{
id
:
walliePreview
anchors.fill
:
parent
...
...
wallpapers/image/imagepackage/contents/ui/config.qml
View file @
9923cde1
...
...
@@ -34,6 +34,7 @@ ColumnLayout {
property
alias
cfg_Color
:
colorDialog
.
color
property
string
cfg_Image
property
int
cfg_FillMode
property
alias
cfg_Blur
:
blurCheckBox
.
checked
property
var
cfg_SlidePaths
:
""
property
int
cfg_SlideInterval
:
0
...
...
@@ -127,6 +128,24 @@ ColumnLayout {
}
}
Row
{
//x: formAlignment - positionLabel.paintedWidth
spacing
:
units
.
largeSpacing
/
2
QtControls.Label
{
id
:
blurLabel
width
:
formAlignment
-
units
.
largeSpacing
anchors
{
verticalCenter
:
blurCheckBox
.
verticalCenter
}
horizontalAlignment
:
Text
.
AlignRight
}
QtControls.CheckBox
{
id
:
blurCheckBox
text
:
i18nd
(
"
plasma_applet_org.kde.image
"
,
"
Use blur background filling
"
)
checked
:
true
}
}
QtDialogs.ColorDialog
{
id
:
colorDialog
modality
:
Qt
.
WindowModal
...
...
wallpapers/image/imagepackage/contents/ui/main.qml
View file @
9923cde1
...
...
@@ -19,6 +19,7 @@
*/
import
QtQuick
2.5
import
QtGraphicalEffects
1.0
import
org
.
kde
.
plasma
.
wallpapers
.
image
2.0
as
Wallpaper
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
...
...
@@ -28,7 +29,9 @@ Item {
readonly
property
string
configuredImage
:
wallpaper
.
configuration
.
Image
readonly
property
string
modelImage
:
imageWallpaper
.
wallpaperPath
property
Item
currentImage
:
imageB
property
Item
currentBlurBackground
:
blurBackgroundB
property
Item
otherImage
:
imageA
property
Item
otherBlurBackground
:
blurBackgroundA
readonly
property
int
fillMode
:
wallpaper
.
configuration
.
FillMode
property
bool
ready
:
false
...
...
@@ -63,6 +66,7 @@ Item {
// Prevent source size change when image has just been setup anyway
sourceSizeTimer
.
stop
()
currentImage
.
opacity
=
0
currentBlurBackground
.
opacity
=
0
otherImage
.
z
=
0
currentImage
.
z
=
1
...
...
@@ -84,6 +88,7 @@ Item {
sourceSizeTimer
.
stop
()
currentImage
.
source
=
modelImage
currentImage
.
opacity
=
0
currentBlurBackground
.
opacity
=
0
otherImage
.
z
=
0
currentImage
.
fillMode
=
fillMode
currentImage
.
z
=
1
...
...
@@ -107,6 +112,7 @@ Item {
swapImages
()
currentImage
.
sourceSize
=
Qt
.
size
(
root
.
width
,
root
.
height
)
currentImage
.
opacity
=
0
currentBlurBackground
.
opacity
=
0
currentImage
.
source
=
otherImage
.
source
otherImage
.
z
=
0
currentImage
.
z
=
1
...
...
@@ -126,10 +132,14 @@ Item {
function
swapImages
()
{
if
(
currentImage
==
imageA
)
{
currentImage
=
imageB
currentBlurBackground
=
blurBackgroundB
otherImage
=
imageA
otherBlurBackground
=
blurBackgroundA
}
else
{
currentImage
=
imageA
currentBlurBackground
=
blurBackgroundA
otherImage
=
imageB
otherBlurBackground
=
blurBackgroundB
}
}
...
...
@@ -173,6 +183,21 @@ Item {
running
:
false
ParallelAnimation
{
OpacityAnimator
{
target
:
currentBlurBackground
from
:
0
to
:
1
duration
:
fadeOtherAnimator
.
duration
}
OpacityAnimator
{
target
:
otherBlurBackground
from
:
1
// cannot disable an animation individually, so we just fade from 1 to 1
to
:
enabled
?
0
:
1
//use configured duration if animations are enabled
duration
:
units
.
longDuration
&&
wallpaper
.
configuration
.
TransitionAnimationDuration
}
OpacityAnimator
{
target
:
currentImage
from
:
0
...
...
@@ -209,6 +234,48 @@ Item {
}
}
Image
{
id
:
blurBackgroundSourceA
visible
:
wallpaper
.
configuration
.
Blur
anchors.fill
:
parent
asynchronous
:
true
cache
:
false
fillMode
:
Image
.
PreserveAspectCrop
source
:
imageA
.
source
z
:
-
1
}
GaussianBlur
{
id
:
blurBackgroundA
visible
:
wallpaper
.
configuration
.
Blur
anchors.fill
:
parent
source
:
blurBackgroundSourceA
radius
:
32
samples
:
65
z
:
imageA
.
z
}
Image
{
id
:
blurBackgroundSourceB
visible
:
wallpaper
.
configuration
.
Blur
anchors.fill
:
parent
asynchronous
:
true
cache
:
false
fillMode
:
Image
.
PreserveAspectCrop
source
:
imageB
.
source
z
:
-
1
}
GaussianBlur
{
id
:
blurBackgroundB
visible
:
wallpaper
.
configuration
.
Blur
anchors.fill
:
parent
source
:
blurBackgroundSourceB
radius
:
32
samples
:
65
z
:
imageB
.
z
}
Image
{
id
:
imageA
anchors.fill
:
parent
...
...
@@ -217,6 +284,7 @@ Item {
fillMode
:
wallpaper
.
configuration
.
FillMode
autoTransform
:
true
//new API in Qt 5.5, do not backport into Plasma 5.4.
}
Image
{
id
:
imageB
anchors.fill
:
parent
...
...
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