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,
|
||||
"autoHideOSDAfterMsec": 3000,
|
||||
"defaultVolume": 100,
|
||||
"openExternallyOnClick": False,
|
||||
"startMuted": False,
|
||||
},
|
||||
"keys": {
|
||||
|
|
|
@ -42,6 +42,19 @@ HMxcImage {
|
|||
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
|
||||
height: fitSize.height
|
||||
|
@ -78,10 +91,9 @@ HMxcImage {
|
|||
return
|
||||
}
|
||||
|
||||
eventList.openImageViewer(
|
||||
singleMediaInfo,
|
||||
loader.mediaUrl.startsWith("mxc://") ? "" : loader.mediaUrl,
|
||||
)
|
||||
window.settings.media.openExternallyOnClick ?
|
||||
image.openExternally() :
|
||||
image.openInternally()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,11 +101,10 @@ HMxcImage {
|
|||
acceptedButtons: Qt.MiddleButton
|
||||
acceptedModifiers: Qt.NoModifier
|
||||
gesturePolicy: TapHandler.ReleaseWithinBounds
|
||||
onTapped: {
|
||||
loader.isMedia ?
|
||||
eventList.openMediaExternally(singleMediaInfo) :
|
||||
Qt.openUrlExternally(loader.mediaUrl)
|
||||
}
|
||||
onTapped:
|
||||
window.settings.media.openExternallyOnClick ?
|
||||
image.openInternally() :
|
||||
image.openExternally()
|
||||
}
|
||||
|
||||
TapHandler {
|
||||
|
|
Loading…
Reference in New Issue
Block a user