diff --git a/src/app/neochatconfig.kcfg b/src/app/neochatconfig.kcfg index a9a2c2fe6..c408dff45 100644 --- a/src/app/neochatconfig.kcfg +++ b/src/app/neochatconfig.kcfg @@ -66,6 +66,10 @@ + + + 1.0 + true diff --git a/src/app/qml/CodeMaximizeComponent.qml b/src/app/qml/CodeMaximizeComponent.qml index f415e78dc..e59f39d4f 100644 --- a/src/app/qml/CodeMaximizeComponent.qml +++ b/src/app/qml/CodeMaximizeComponent.qml @@ -91,6 +91,7 @@ Components.AbstractMaximizeComponent { color: Kirigami.Theme.textColor font.family: "monospace" + font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale Kirigami.SpellCheck.enabled: false diff --git a/src/chatbar/ChatBar.qml b/src/chatbar/ChatBar.qml index b74e6d4e3..2ef63afad 100644 --- a/src/chatbar/ChatBar.qml +++ b/src/chatbar/ChatBar.qml @@ -263,6 +263,7 @@ QQC2.Control { wrapMode: TextEdit.Wrap // This has to stay PlainText or else formatting starts breaking in strange ways textFormat: TextEdit.PlainText + font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale Accessible.description: placeholderText diff --git a/src/chatbar/EmojiDelegate.qml b/src/chatbar/EmojiDelegate.qml index a38c1b4a2..0322e2f36 100644 --- a/src/chatbar/EmojiDelegate.qml +++ b/src/chatbar/EmojiDelegate.qml @@ -4,6 +4,7 @@ import QtQuick import QtQuick.Controls as QQC2 import org.kde.kirigami as Kirigami +import org.kde.neochat QQC2.ItemDelegate { id: root @@ -29,6 +30,7 @@ QQC2.ItemDelegate { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter font.family: "emoji" + font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale Kirigami.Icon { width: Kirigami.Units.gridUnit * 0.5 diff --git a/src/messagecontent/CodeComponent.qml b/src/messagecontent/CodeComponent.qml index 77c53234e..73e448240 100644 --- a/src/messagecontent/CodeComponent.qml +++ b/src/messagecontent/CodeComponent.qml @@ -77,6 +77,7 @@ QQC2.Control { color: Kirigami.Theme.textColor font.family: "monospace" + font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale Kirigami.SpellCheck.enabled: false diff --git a/src/messagecontent/QuoteComponent.qml b/src/messagecontent/QuoteComponent.qml index d83a1746f..c4c3271a6 100644 --- a/src/messagecontent/QuoteComponent.qml +++ b/src/messagecontent/QuoteComponent.qml @@ -58,6 +58,7 @@ QQC2.Control { selectionColor: Kirigami.Theme.highlightColor font.italic: true + font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale onSelectedTextChanged: root.selectedTextChanged(selectedText) diff --git a/src/messagecontent/ReactionComponent.qml b/src/messagecontent/ReactionComponent.qml index 2b42efa53..dab47c53a 100644 --- a/src/messagecontent/ReactionComponent.qml +++ b/src/messagecontent/ReactionComponent.qml @@ -51,6 +51,7 @@ Flow { horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter text: reactionDelegate.textContent + font.pointSize: Kirigami.Theme.defaultFont.pointSize * NeoChatConfig.fontScale background: null wrapMode: TextEdit.NoWrap textFormat: Text.RichText diff --git a/src/messagecontent/TextComponent.qml b/src/messagecontent/TextComponent.qml index 0dc0b74cb..d1a7fdc8f 100644 --- a/src/messagecontent/TextComponent.qml +++ b/src/messagecontent/TextComponent.qml @@ -67,7 +67,9 @@ TextEdit { selectedTextColor: Kirigami.Theme.highlightedTextColor selectionColor: Kirigami.Theme.highlightColor 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 } selectByMouse: !Kirigami.Settings.isMobile diff --git a/src/settings/AppearanceSettingsPage.qml b/src/settings/AppearanceSettingsPage.qml index 572791e3d..ef6ae2a61 100644 --- a/src/settings/AppearanceSettingsPage.qml +++ b/src/settings/AppearanceSettingsPage.qml @@ -43,6 +43,40 @@ FormCard.FormCardPage { 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 {