feat: add font size scaling setting
Adds an option in Appearance Settings to adjust font size scaling, improving accessibility and user customization.
This commit is contained in:
@@ -66,6 +66,10 @@
|
|||||||
</entry>
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
<group name="Timeline">
|
<group name="Timeline">
|
||||||
|
<entry name="FontScale" type="double">
|
||||||
|
<label>Scaling factor for font sizes</label>
|
||||||
|
<default>1.0</default>
|
||||||
|
</entry>
|
||||||
<entry name="ShowAvatarInTimeline" type="bool">
|
<entry name="ShowAvatarInTimeline" type="bool">
|
||||||
<label>Show avatar in the timeline</label>
|
<label>Show avatar in the timeline</label>
|
||||||
<default>true</default>
|
<default>true</default>
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ Components.AbstractMaximizeComponent {
|
|||||||
color: Kirigami.Theme.textColor
|
color: Kirigami.Theme.textColor
|
||||||
|
|
||||||
font.family: "monospace"
|
font.family: "monospace"
|
||||||
|
font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale
|
||||||
|
|
||||||
Kirigami.SpellCheck.enabled: false
|
Kirigami.SpellCheck.enabled: false
|
||||||
|
|
||||||
|
|||||||
@@ -263,6 +263,7 @@ QQC2.Control {
|
|||||||
wrapMode: TextEdit.Wrap
|
wrapMode: TextEdit.Wrap
|
||||||
// This has to stay PlainText or else formatting starts breaking in strange ways
|
// This has to stay PlainText or else formatting starts breaking in strange ways
|
||||||
textFormat: TextEdit.PlainText
|
textFormat: TextEdit.PlainText
|
||||||
|
font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale
|
||||||
|
|
||||||
Accessible.description: placeholderText
|
Accessible.description: placeholderText
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls as QQC2
|
import QtQuick.Controls as QQC2
|
||||||
import org.kde.kirigami as Kirigami
|
import org.kde.kirigami as Kirigami
|
||||||
|
import org.kde.neochat
|
||||||
|
|
||||||
QQC2.ItemDelegate {
|
QQC2.ItemDelegate {
|
||||||
id: root
|
id: root
|
||||||
@@ -29,6 +30,7 @@ QQC2.ItemDelegate {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
font.family: "emoji"
|
font.family: "emoji"
|
||||||
|
font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale
|
||||||
|
|
||||||
Kirigami.Icon {
|
Kirigami.Icon {
|
||||||
width: Kirigami.Units.gridUnit * 0.5
|
width: Kirigami.Units.gridUnit * 0.5
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ QQC2.Control {
|
|||||||
color: Kirigami.Theme.textColor
|
color: Kirigami.Theme.textColor
|
||||||
|
|
||||||
font.family: "monospace"
|
font.family: "monospace"
|
||||||
|
font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale
|
||||||
|
|
||||||
Kirigami.SpellCheck.enabled: false
|
Kirigami.SpellCheck.enabled: false
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ QQC2.Control {
|
|||||||
selectionColor: Kirigami.Theme.highlightColor
|
selectionColor: Kirigami.Theme.highlightColor
|
||||||
|
|
||||||
font.italic: true
|
font.italic: true
|
||||||
|
font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale
|
||||||
|
|
||||||
onSelectedTextChanged: root.selectedTextChanged(selectedText)
|
onSelectedTextChanged: root.selectedTextChanged(selectedText)
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ Flow {
|
|||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
text: reactionDelegate.textContent
|
text: reactionDelegate.textContent
|
||||||
|
font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale
|
||||||
background: null
|
background: null
|
||||||
wrapMode: TextEdit.NoWrap
|
wrapMode: TextEdit.NoWrap
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ TextEdit {
|
|||||||
selectedTextColor: Kirigami.Theme.highlightedTextColor
|
selectedTextColor: Kirigami.Theme.highlightedTextColor
|
||||||
selectionColor: Kirigami.Theme.highlightColor
|
selectionColor: Kirigami.Theme.highlightColor
|
||||||
font {
|
font {
|
||||||
pointSize: !root.isReply && QmlUtils.isEmoji(display) ? Kirigami.Theme.defaultFont.pointSize * 4 : Kirigami.Theme.defaultFont.pointSize
|
pointSize: !root.isReply && QmlUtils.isEmoji(display)
|
||||||
|
? Kirigami.Theme.defaultFont.pointSize * 4 * NeoChatConfig.fontScale
|
||||||
|
: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale
|
||||||
family: QmlUtils.isEmoji(display) ? 'emoji' : Kirigami.Theme.defaultFont.family
|
family: QmlUtils.isEmoji(display) ? 'emoji' : Kirigami.Theme.defaultFont.family
|
||||||
}
|
}
|
||||||
selectByMouse: !Kirigami.Settings.isMobile
|
selectByMouse: !Kirigami.Settings.isMobile
|
||||||
|
|||||||
@@ -43,6 +43,40 @@ FormCard.FormCardPage {
|
|||||||
NeoChatConfig.save();
|
NeoChatConfig.save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FormCard.FormDelegateSeparator {
|
||||||
|
above: fontScaleSliderDelegate
|
||||||
|
below: compactRoomListDelegate
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Font scale setting allows user to adjust the font size used in the app.
|
||||||
|
*/
|
||||||
|
FormCard.AbstractFormDelegate {
|
||||||
|
id: fontScaleSliderDelegate
|
||||||
|
background: Item {}
|
||||||
|
contentItem: ColumnLayout {
|
||||||
|
QQC2.Label {
|
||||||
|
text: i18nc("@label Font size for text in the chat pane", "Chat font scaling")
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
QQC2.Label {
|
||||||
|
text: i18nc("@label:slider Current font scale percentage. %1 is the numeric percentage value, the second % is the symbol e.g. 120%", "%1%", Math.round(NeoChatConfig.fontScale * 100))
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
QQC2.Slider {
|
||||||
|
from: 0.5
|
||||||
|
to: 3.0
|
||||||
|
stepSize: 0.1
|
||||||
|
value: NeoChatConfig.fontScale
|
||||||
|
onMoved: {
|
||||||
|
NeoChatConfig.fontScale = value;
|
||||||
|
NeoChatConfig.save();
|
||||||
|
}
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FormCard.FormHeader {
|
FormCard.FormHeader {
|
||||||
|
|||||||
Reference in New Issue
Block a user