Use new PCN format for settings config file
This commit is contained in:
@@ -51,7 +51,7 @@ Item {
|
||||
onReadyChanged: longLoading = false
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.leaveRoom
|
||||
sequences: window.settings.Keys.Chat.leave
|
||||
active: userInfo && userInfo.presence !== "offline"
|
||||
onActivated: window.makePopup(
|
||||
"Popups/LeaveRoomPopup.qml",
|
||||
@@ -60,7 +60,7 @@ Item {
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.forgetRoom
|
||||
sequences: window.settings.Keys.Chat.forget
|
||||
active: userInfo && userInfo.presence !== "offline"
|
||||
onActivated: window.makePopup(
|
||||
"Popups/ForgetRoomPopup.qml",
|
||||
|
@@ -21,7 +21,7 @@ HTextArea {
|
||||
|
||||
readonly property var usableAliases: {
|
||||
const obj = {}
|
||||
const aliases = window.settings.writeAliases
|
||||
const aliases = window.settings.Chat.Composer.aliases
|
||||
|
||||
// Get accounts that are members of this room with permission to talk
|
||||
for (const [id, alias] of Object.entries(aliases)) {
|
||||
|
@@ -21,7 +21,7 @@ HButton {
|
||||
onClicked: sendFilePicker.dialog.open()
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.sendFileFromPathInClipboard
|
||||
sequences: window.settings.Keys.Chat.send_clipboard_path
|
||||
onActivated: window.makePopup(
|
||||
"Popups/ConfirmUploadPopup.qml",
|
||||
{
|
||||
@@ -43,7 +43,7 @@ HButton {
|
||||
onReplied: chat.clearReplyTo()
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.sendFile
|
||||
sequences: window.settings.Keys.Chat.send_file
|
||||
onActivated: sendFilePicker.dialog.open()
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ Rectangle {
|
||||
(chat.roomPane.collapse || chat.roomPane.forceCollapse)
|
||||
|
||||
readonly property bool center:
|
||||
showLeftButton || window.settings.alwaysCenterRoomHeader
|
||||
showLeftButton || window.settings.Chat.always_center_header
|
||||
|
||||
|
||||
implicitHeight: theme.baseElementsHeight
|
||||
|
@@ -139,7 +139,9 @@ HColumnLayout {
|
||||
stackView.currentItem.currentIndex = -1
|
||||
|
||||
roomPane.toggleFocus()
|
||||
if (window.settings.clearMemberFilterOnEscape) text = ""
|
||||
|
||||
if (window.settings.RoomList.escape_clears_filter)
|
||||
text = ""
|
||||
}
|
||||
|
||||
Behavior on opacity { HNumberAnimation {} }
|
||||
@@ -174,7 +176,7 @@ HColumnLayout {
|
||||
Layout.preferredHeight: filterField.implicitHeight
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.inviteToRoom
|
||||
sequences: window.settings.Keys.Chat.invite
|
||||
onActivated:
|
||||
if (inviteButton.enabled) inviteButton.clicked()
|
||||
}
|
||||
|
@@ -105,12 +105,12 @@ MultiviewPane {
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.toggleFocusRoomPane
|
||||
sequences: window.settings.Keys.Chat.focus_room_pane
|
||||
onActivated: roomPane.toggleFocus()
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.toggleHideRoomPane
|
||||
sequences: window.settings.Keys.Chat.hide_room_pane
|
||||
onActivated: roomPane.forceCollapse = ! roomPane.forceCollapse
|
||||
}
|
||||
}
|
||||
|
@@ -75,11 +75,11 @@ HRowLayout {
|
||||
readonly property int maxMessageWidth:
|
||||
contentText.includes("<pre>") || contentText.includes("<table>") ?
|
||||
-1 :
|
||||
window.settings.maxMessageCharactersPerLine < 0 ?
|
||||
window.settings.Chat.max_messages_line_length < 0 ?
|
||||
-1 :
|
||||
Math.ceil(
|
||||
mainUI.fontMetrics.averageCharacterWidth *
|
||||
window.settings.maxMessageCharactersPerLine
|
||||
window.settings.Chat.max_messages_line_length
|
||||
)
|
||||
|
||||
readonly property alias selectedText: contentLabel.selectedPlainText
|
||||
|
@@ -17,7 +17,7 @@ HColumnLayout {
|
||||
readonly property var nextModel: eventList.model.get(model.index - 1)
|
||||
readonly property QtObject currentModel: model
|
||||
|
||||
readonly property bool compact: window.settings.compactMode
|
||||
readonly property bool compact: window.settings.General.compact
|
||||
readonly property bool checked: model.id in eventList.checked
|
||||
readonly property bool isOwn: chat.userId === model.sender_id
|
||||
readonly property bool isRedacted: model.event_type === "RedactedEvent"
|
||||
|
@@ -17,7 +17,12 @@ HTile {
|
||||
width: Math.min(
|
||||
eventDelegate.width,
|
||||
eventContent.maxMessageWidth,
|
||||
Math.max(theme.chat.message.fileMinWidth, implicitWidth),
|
||||
Math.max(
|
||||
window.settings.Chat.Files.min_file_width *
|
||||
window.settings.General.zoom,
|
||||
|
||||
implicitWidth,
|
||||
),
|
||||
)
|
||||
height: Math.max(theme.chat.message.avatarSize, implicitHeight)
|
||||
|
||||
|
@@ -10,13 +10,16 @@ HMxcImage {
|
||||
|
||||
property EventMediaLoader loader
|
||||
|
||||
readonly property real zoom: window.settings.General.zoom
|
||||
|
||||
readonly property real maxHeight:
|
||||
eventList.height * theme.chat.message.thumbnailMaxHeightRatio
|
||||
eventList.height *
|
||||
window.settings.Chat.Files.max_thumbnail_height_ratio * zoom
|
||||
|
||||
readonly property size fitSize: utils.fitSize(
|
||||
// Minimum display size
|
||||
theme.chat.message.thumbnailMinSize.width,
|
||||
theme.chat.message.thumbnailMinSize.height,
|
||||
window.settings.Chat.Files.min_thumbnail_size[0] * zoom,
|
||||
window.settings.Chat.Files.min_thumbnail_size[1] * zoom,
|
||||
|
||||
// Real size
|
||||
(
|
||||
@@ -35,12 +38,18 @@ HMxcImage {
|
||||
|
||||
// Maximum display size
|
||||
Math.min(
|
||||
Math.max(maxHeight, theme.chat.message.thumbnailMinSize.width),
|
||||
Math.max(
|
||||
maxHeight,
|
||||
window.settings.Chat.Files.min_thumbnail_size[0] * zoom,
|
||||
),
|
||||
pureMedia ? Infinity : eventContent.maxMessageWidth,
|
||||
eventDelegate.width - eventContent.spacing - avatarWrapper.width -
|
||||
eventContent.spacing * 2, // padding
|
||||
),
|
||||
Math.max(maxHeight, theme.chat.message.thumbnailMinSize.height),
|
||||
Math.max(
|
||||
maxHeight,
|
||||
window.settings.Chat.Files.min_thumbnail_size[1] * zoom,
|
||||
),
|
||||
)
|
||||
|
||||
readonly property bool hovered: hover.hovered
|
||||
@@ -92,7 +101,7 @@ HMxcImage {
|
||||
return
|
||||
}
|
||||
|
||||
window.settings.media.openExternallyOnClick ?
|
||||
window.settings.Chat.Files.click_opens_externally ?
|
||||
image.openExternally() :
|
||||
image.openInternally()
|
||||
}
|
||||
@@ -103,7 +112,7 @@ HMxcImage {
|
||||
acceptedModifiers: Qt.NoModifier
|
||||
gesturePolicy: TapHandler.ReleaseWithinBounds
|
||||
onTapped:
|
||||
window.settings.media.openExternallyOnClick ?
|
||||
window.settings.Chat.Files.click_opens_externally ?
|
||||
image.openInternally() :
|
||||
image.openExternally()
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ Rectangle {
|
||||
color: theme.chat.eventList.background
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.unfocusOrDeselectAllMessages
|
||||
sequences: window.settings.Keys.Messages.unfocus_or_deselect
|
||||
onActivated: {
|
||||
eventList.selectedCount ?
|
||||
eventList.checked = {} :
|
||||
@@ -30,24 +30,24 @@ Rectangle {
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.focusPreviousMessage
|
||||
sequences: window.settings.Keys.Messages.previous
|
||||
onActivated: eventList.focusPreviousMessage()
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.focusNextMessage
|
||||
sequences: window.settings.Keys.Messages.next
|
||||
onActivated: eventList.focusNextMessage()
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
active: eventList.currentItem
|
||||
sequences: window.settings.keys.toggleSelectMessage
|
||||
sequences: window.settings.Keys.Messages.select
|
||||
onActivated: eventList.toggleCheck(eventList.currentIndex)
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
active: eventList.currentItem
|
||||
sequences: window.settings.keys.selectMessagesUntilHere
|
||||
sequences: window.settings.Keys.Messages.select_until_here
|
||||
onActivated:
|
||||
eventList.checkFromLastToHere(eventList.currentIndex)
|
||||
}
|
||||
@@ -75,7 +75,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
enabled: (events && events.length > 0) || events === null
|
||||
sequences: window.settings.keys.removeFocusedOrSelectedMessages
|
||||
sequences: window.settings.Keys.Messages.remove
|
||||
onActivated: window.makePopup(
|
||||
"Popups/RedactPopup.qml",
|
||||
{
|
||||
@@ -98,7 +98,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.replyToFocusedOrLastMessage
|
||||
sequences: window.settings.Keys.Messages.reply
|
||||
onActivated: {
|
||||
let event = eventList.model.get(0)
|
||||
|
||||
@@ -132,7 +132,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.openMessagesLinksOrFiles
|
||||
sequences: window.settings.Keys.Messages.open_links_files
|
||||
onActivated: {
|
||||
const indice =
|
||||
eventList.getFocusedOrSelectedOrLastMediaEvents(true)
|
||||
@@ -158,7 +158,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.openMessagesLinksOrFilesExternally
|
||||
sequences: window.settings.Keys.Messages.open_links_files_externally
|
||||
onActivated: {
|
||||
const indice =
|
||||
eventList.getFocusedOrSelectedOrLastMediaEvents(true)
|
||||
@@ -178,7 +178,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.copyFilesLocalPath
|
||||
sequences: window.settings.Keys.Messages.copy_files_path
|
||||
onActivated: {
|
||||
const paths = []
|
||||
const indice =
|
||||
@@ -199,14 +199,14 @@ Rectangle {
|
||||
|
||||
HShortcut {
|
||||
active: eventList.currentItem
|
||||
sequences: window.settings.keys.debugFocusedMessage
|
||||
sequences: window.settings.Keys.Messages.debug
|
||||
onActivated: mainUI.debugConsole.toggle(
|
||||
eventList.currentItem.eventContent, "t.parent.json()",
|
||||
)
|
||||
}
|
||||
|
||||
HShortcut {
|
||||
sequences: window.settings.keys.clearRoomMessages
|
||||
sequences: window.settings.Keys.Messages.clear_all
|
||||
onActivated: window.makePopup(
|
||||
"Popups/ClearMessagesPopup.qml",
|
||||
{
|
||||
@@ -231,9 +231,10 @@ Rectangle {
|
||||
property bool moreToLoad: true
|
||||
|
||||
property bool ownEventsOnLeft:
|
||||
window.settings.ownMessagesOnLeftAboveWidth < 0 ?
|
||||
window.settings.Chat.own_messages_on_left_above < 0 ?
|
||||
false :
|
||||
width > window.settings.ownMessagesOnLeftAboveWidth * theme.uiScale
|
||||
width >
|
||||
window.settings.Chat.own_messages_on_left_above * theme.uiScale
|
||||
|
||||
property string delegateWithSelectedText: ""
|
||||
property string selectedText: ""
|
||||
@@ -616,7 +617,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: Math.max(100, window.settings.markRoomReadMsecDelay)
|
||||
interval: Math.max(100, window.settings.Chat.mark_read_delay * 1000)
|
||||
|
||||
running:
|
||||
! eventList.updateMarkerFutureId &&
|
||||
|
Reference in New Issue
Block a user