Compare commits

...

1 Commits

Author SHA1 Message Date
Carl Schwan
278a1fc218 Allow to configure font for chat
Fix #416

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2023-02-17 17:11:26 +01:00
6 changed files with 41 additions and 5 deletions

View File

@@ -4,6 +4,7 @@
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="neochatrc" />
<include>Kirigami/PlatformTheme</include>
<group name="General">
<entry name="CollapsedSections" type="IntList">
<label>Collapsed sections in the room list</label>
@@ -102,6 +103,13 @@
<label>Show Fancy Effects</label>
<default>true</default>
</entry>
<entry name="defaultFont" type="Font">
<label>Default font</label>
<code>
Kirigami::PlatformTheme theme;
</code>
<default code="true">theme.defaultFont()</default>
</entry>
</group>
<group name="RoomDrawer">
<entry name="ShowAvatarInRoomDrawer" type="bool">

View File

@@ -80,7 +80,7 @@ a{
color: Kirigami.Theme.textColor
selectedTextColor: Kirigami.Theme.highlightedTextColor
selectionColor: Kirigami.Theme.highlightColor
font.pointSize: model.reply === undefined && isEmoji.test(model.display) ? Kirigami.Theme.defaultFont.pointSize * 4 : Kirigami.Theme.defaultFont.pointSize
font.pointSize: model.reply === undefined && isEmoji.test(model.display) ? Config.defaultFont.pointSize * 4 : Config.defaultFont.pointSize
selectByMouse: !Kirigami.Settings.isMobile
readOnly: true
wrapMode: Text.Wrap

View File

@@ -40,6 +40,7 @@ RowLayout {
id: label
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
font.pointSize: Config.defaultFont.pointSize
wrapMode: Text.WordWrap
textFormat: Text.RichText
onLinkActivated: linkClicked(link)

View File

@@ -92,6 +92,7 @@ QQC2.Control {
visible: columnLayout.folded
text: aggregateDisplay
font.pointSize: Config.defaultFont.pointSize
elide: Qt.ElideRight
textFormat: Text.RichText
wrapMode: Text.WordWrap

View File

@@ -213,7 +213,10 @@ ColumnLayout {
text: visible ? author.displayName : ""
textFormat: Text.PlainText
font.weight: Font.Bold
font {
weight: Font.Bold
pointSize: Config.defaultFont.pointSize
}
color: author.color
elide: Text.ElideRight
MouseArea {
@@ -234,6 +237,8 @@ ColumnLayout {
id: timeLabel
text: visible ? model.time.toLocaleTimeString(Qt.locale(), Locale.ShortFormat) : ""
font.pointSize: Config.defaultFont.pointSize
color: Kirigami.Theme.disabledTextColor
QQC2.ToolTip.visible: hoverHandler.hovered
QQC2.ToolTip.text: model.time.toLocaleString(Qt.locale(), Locale.LongFormat)

View File

@@ -4,6 +4,7 @@
import QtQuick 2.15
import QtQuick.Controls 2.15 as QQC2
import QtQuick.Dialogs 1.3
import QtQuick.Layouts 1.15
import org.kde.kirigami 2.15 as Kirigami
@@ -211,18 +212,38 @@ Kirigami.ScrollablePage {
Config.save();
}
}
MobileForm.FormDelegateSeparator { above: compactRoomListDelegate ; below: colorSchemeDelegate.item ; visible: colorSchemeDelegate.visible }
Loader {
id: colorSchemeDelegate
visible: item !== null && Qt.platform.os !== "android"
source: "qrc:/ColorScheme.qml"
Layout.fillWidth: true
}
MobileForm.FormDelegateSeparator { below: colorSchemeDelegate.visible ? colorSchemeDelegate.item : compactRoomListDelegate; above: fontSelector }
MobileForm.FormButtonDelegate {
id: fontSelector
text: i18n("Font in chat")
description: Config.defaultFont.family + " " + Config.defaultFont.pointSize + "pt"
onClicked: fontDialog.open()
FontDialog {
id: fontDialog
title: i18n("Please choose a font")
font: Config.defaultFont
monospacedFonts: false
onAccepted: {
Config.defaultFont = font;
Config.save();
}
}
}
}
}
MobileForm.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true