Add media.openExternallyOnClick setting
Makes clicking on image open them externally and middle-clicking open them in the mirage image viewer, the reverse of the default behavior.
This commit is contained in:
parent
0f1d0f336e
commit
d00b29f076
|
@ -284,6 +284,7 @@ class UISettings(JSONDataFile):
|
||||||
"autoPlayGIF": True,
|
"autoPlayGIF": True,
|
||||||
"autoHideOSDAfterMsec": 3000,
|
"autoHideOSDAfterMsec": 3000,
|
||||||
"defaultVolume": 100,
|
"defaultVolume": 100,
|
||||||
|
"openExternallyOnClick": False,
|
||||||
"startMuted": False,
|
"startMuted": False,
|
||||||
},
|
},
|
||||||
"keys": {
|
"keys": {
|
||||||
|
|
|
@ -42,6 +42,19 @@ HMxcImage {
|
||||||
Math.max(maxHeight, theme.chat.message.thumbnailMinSize.height),
|
Math.max(maxHeight, theme.chat.message.thumbnailMinSize.height),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
function openInternally() {
|
||||||
|
eventList.openImageViewer(
|
||||||
|
singleMediaInfo,
|
||||||
|
loader.mediaUrl.startsWith("mxc://") ? "" : loader.mediaUrl,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function openExternally() {
|
||||||
|
loader.isMedia ?
|
||||||
|
eventList.openMediaExternally(singleMediaInfo) :
|
||||||
|
Qt.openUrlExternally(loader.mediaUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
width: fitSize.width
|
width: fitSize.width
|
||||||
height: fitSize.height
|
height: fitSize.height
|
||||||
|
@ -78,10 +91,9 @@ HMxcImage {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
eventList.openImageViewer(
|
window.settings.media.openExternallyOnClick ?
|
||||||
singleMediaInfo,
|
image.openExternally() :
|
||||||
loader.mediaUrl.startsWith("mxc://") ? "" : loader.mediaUrl,
|
image.openInternally()
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,11 +101,10 @@ HMxcImage {
|
||||||
acceptedButtons: Qt.MiddleButton
|
acceptedButtons: Qt.MiddleButton
|
||||||
acceptedModifiers: Qt.NoModifier
|
acceptedModifiers: Qt.NoModifier
|
||||||
gesturePolicy: TapHandler.ReleaseWithinBounds
|
gesturePolicy: TapHandler.ReleaseWithinBounds
|
||||||
onTapped: {
|
onTapped:
|
||||||
loader.isMedia ?
|
window.settings.media.openExternallyOnClick ?
|
||||||
eventList.openMediaExternally(singleMediaInfo) :
|
image.openInternally() :
|
||||||
Qt.openUrlExternally(loader.mediaUrl)
|
image.openExternally()
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user