Repository navigation
feat: add dock spotlight cursor tracking #1764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wjyrich
wants to merge
1
commit into
linuxdeepin:master
Choose a base branch
from
wjyrich:feat-spotlight
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| // SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd. | ||
| // | ||
| // SPDX-License-Identifier: GPL-3.0-or-later | ||
|
|
||
| import QtQuick | ||
|
|
||
| Item { | ||
| id: spotlight | ||
| property bool containsMouse: false | ||
| property point cursorPosition: Qt.point(0, 0) | ||
| property real itemSize: 48 | ||
| property bool darkTheme: false | ||
| readonly property real baseRadius: Math.max(0, Math.min(itemSize * 3.0, height * 3.0, width * 0.18)) | ||
| readonly property real coreRadius: baseRadius * 0.35 | ||
|
|
||
| clip: true | ||
| enabled: false | ||
| visible: opacity > 0 | ||
| opacity: containsMouse ? 1 : 0 | ||
|
|
||
| Behavior on opacity { | ||
| NumberAnimation { duration: 90; easing.type: Easing.OutQuad } | ||
| } | ||
|
|
||
| // Move a single transform instead of evaluating both images' coordinates | ||
| // on every pointer event. Both layers share the same cached 256px texture. | ||
| Item { | ||
| x: Math.max(0, Math.min(spotlight.cursorPosition.x, spotlight.width)) | ||
| y: Math.max(0, Math.min(spotlight.cursorPosition.y, spotlight.height)) | ||
|
|
||
| Image { | ||
| objectName: "spotlightImage" | ||
| width: spotlight.baseRadius * 2 | ||
| height: spotlight.baseRadius * 2.6 | ||
| x: -width / 2 | ||
| y: -height / 2 | ||
| source: "SpotlightGradient.png" | ||
|
wjyrich marked this conversation as resolved.
|
||
| fillMode: Image.Stretch | ||
| smooth: true | ||
| opacity: spotlight.darkTheme ? 0.14 : 0.2 | ||
| } | ||
|
|
||
| Image { | ||
| objectName: "spotlightCoreImage" | ||
| width: spotlight.coreRadius * 2 | ||
| height: width | ||
| x: -width / 2 | ||
| y: -height / 2 | ||
| source: "SpotlightGradient.png" | ||
| fillMode: Image.Stretch | ||
| smooth: true | ||
| opacity: spotlight.darkTheme ? 0.23 : 0.32 | ||
| } | ||
| } | ||
| } | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.