Add maxMessageCharactersPerLine setting
Can be set to -1 for no maximum width.
This commit is contained in:
parent
315237b411
commit
60ad7416d9
|
@ -238,6 +238,7 @@ class UISettings(JSONDataFile):
|
||||||
"hideProfileChangeEvents": True,
|
"hideProfileChangeEvents": True,
|
||||||
"hideMembershipEvents": False,
|
"hideMembershipEvents": False,
|
||||||
"hideUnknownEvents": False,
|
"hideUnknownEvents": False,
|
||||||
|
"maxMessageCharactersPerLine": 65,
|
||||||
"theme": "Midnight.qpl",
|
"theme": "Midnight.qpl",
|
||||||
"writeAliases": {},
|
"writeAliases": {},
|
||||||
"media": {
|
"media": {
|
||||||
|
|
|
@ -62,8 +62,13 @@ HRowLayout {
|
||||||
) :
|
) :
|
||||||
0
|
0
|
||||||
|
|
||||||
// ~600px max with a 16px font
|
readonly property int maxMessageWidth:
|
||||||
readonly property int maxMessageWidth: theme.fontSize.normal * 0.5 * 75
|
window.settings.maxMessageCharactersPerLine < 0 ?
|
||||||
|
-1 :
|
||||||
|
Math.ceil(
|
||||||
|
mainUI.fontMetrics.averageCharacterWidth *
|
||||||
|
window.settings.maxMessageCharactersPerLine
|
||||||
|
)
|
||||||
|
|
||||||
readonly property alias selectedText: contentLabel.selectedText
|
readonly property alias selectedText: contentLabel.selectedText
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ Item {
|
||||||
readonly property alias mainPane: mainPane
|
readonly property alias mainPane: mainPane
|
||||||
readonly property alias pageLoader: pageLoader
|
readonly property alias pageLoader: pageLoader
|
||||||
readonly property alias pressAnimation: pressAnimation
|
readonly property alias pressAnimation: pressAnimation
|
||||||
|
readonly property alias fontMetrics: fontMetrics
|
||||||
|
|
||||||
|
|
||||||
function reloadSettings() {
|
function reloadSettings() {
|
||||||
|
@ -82,6 +83,13 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FontMetrics {
|
||||||
|
id: fontMetrics
|
||||||
|
font.family: theme.fontFamily.sans
|
||||||
|
font.pixelSize: theme.fontSize.normal
|
||||||
|
font.pointSize: -1
|
||||||
|
}
|
||||||
|
|
||||||
DebugConsole {
|
DebugConsole {
|
||||||
id: debugConsole
|
id: debugConsole
|
||||||
target: mainUI
|
target: mainUI
|
||||||
|
|
Loading…
Reference in New Issue
Block a user