mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-09-10 07:16:06 -04:00
Fix monospace font
This commit is contained in:
@ -7,7 +7,6 @@ namespace QodeAssist::Chat {
|
|||||||
|
|
||||||
void ChatUtils::copyToClipboard(const QString &text)
|
void ChatUtils::copyToClipboard(const QString &text)
|
||||||
{
|
{
|
||||||
qDebug() << "call clipboard" << text;
|
|
||||||
QGuiApplication::clipboard()->setText(text);
|
QGuiApplication::clipboard()->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,19 @@ Rectangle {
|
|||||||
property string language: ""
|
property string language: ""
|
||||||
property color selectionColor
|
property color selectionColor
|
||||||
|
|
||||||
|
readonly property string monospaceFont: {
|
||||||
|
switch (Qt.platform.os) {
|
||||||
|
case "windows":
|
||||||
|
return "Consolas";
|
||||||
|
case "osx":
|
||||||
|
return "Menlo";
|
||||||
|
case "linux":
|
||||||
|
return "DejaVu Sans Mono";
|
||||||
|
default:
|
||||||
|
return "monospace";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
border.color: root.color.hslLightness > 0.5 ? Qt.darker(root.color, 1.3)
|
border.color: root.color.hslLightness > 0.5 ? Qt.darker(root.color, 1.3)
|
||||||
: Qt.lighter(root.color, 1.3)
|
: Qt.lighter(root.color, 1.3)
|
||||||
border.width: 2
|
border.width: 2
|
||||||
@ -48,7 +61,8 @@ Rectangle {
|
|||||||
text: root.code
|
text: root.code
|
||||||
readOnly: true
|
readOnly: true
|
||||||
selectByMouse: true
|
selectByMouse: true
|
||||||
font.family: "monospace"
|
font.family: monospaceFont
|
||||||
|
font.pointSize: 12
|
||||||
color: parent.color.hslLightness > 0.5 ? "black" : "white"
|
color: parent.color.hslLightness > 0.5 ? "black" : "white"
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
selectionColor: root.selectionColor
|
selectionColor: root.selectionColor
|
||||||
|
Reference in New Issue
Block a user