Skip to content

Commit

Permalink
fix: The preview image of the screensaver can shown menu
Browse files Browse the repository at this point in the history
add enableContextMenu property to control

pms: BUG-305817
  • Loading branch information
mhduiy authored and deepin-bot[bot] committed Feb 28, 2025
1 parent 768e59e commit 017d9e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/plugin-personalization/qml/ScreenSaverPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ DccObject {
page: WallpaperSelectView {
model: dccData.model.picScreenSaverModel
currentItem: dccData.model.currentScreenSaverPicMode
enableContextMenu: false
onWallpaperSelected: (url, isDark, isLock) => {
// 防止调用两次
if (isLock) {
Expand All @@ -195,6 +196,7 @@ DccObject {
page: WallpaperSelectView {
model: dccData.model.screenSaverModel
currentItem: dccData.model.currentScreenSaver
enableContextMenu: false
onWallpaperSelected: (url, isDark, isLock) => {
// 防止调用两次
if (isLock) {
Expand Down
3 changes: 2 additions & 1 deletion src/plugin-personalization/qml/WallpaperSelectView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ ColumnLayout {
property var currentItem
property string firstItemImgSource: ""
property bool firstItemVisible: firstItemImgSource !== ""
property bool enableContextMenu: true

signal wallpaperSelected(var url, bool isDark, var option)
signal firstItemClicked()
Expand Down Expand Up @@ -223,7 +224,7 @@ ColumnLayout {
onClicked: {
if (mouse.button === Qt.LeftButton) {
wallpaperItem.requestSetWallpaper(PersonalizationExport.Option_All)
} else if (mouse.button === Qt.RightButton) {
} else if (mouse.button === Qt.RightButton && root.enableContextMenu) {
contextMenu.x = mouse.x
contextMenu.y = mouse.y
contextMenu.open()
Expand Down

0 comments on commit 017d9e8

Please sign in to comment.