mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-09-11 21:39:11 +00:00
Latest v3.0.0 rc4 fixes (#2490)
* Use the same font size for code blocks as we do for the rest of the chat text. * Add a conversation tray after discussion with Vincent and Andriy and gathering of feedback from some other users. This adds the reset context back as a recycle button and copy chat features back to the app for v3.0.0. Signed-off-by: Adam Treat <treat.adam@gmail.com>
This commit is contained in:
@@ -888,6 +888,7 @@ ChatViewTextProcessor::ChatViewTextProcessor(QObject *parent)
|
||||
, m_syntaxHighlighter(new SyntaxHighlighter(this))
|
||||
, m_isProcessingText(false)
|
||||
, m_shouldProcessText(true)
|
||||
, m_fontPixelSize(QGuiApplication::font().pointSizeF())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -933,6 +934,20 @@ void ChatViewTextProcessor::setShouldProcessText(bool b)
|
||||
handleTextChanged();
|
||||
}
|
||||
|
||||
qreal ChatViewTextProcessor::fontPixelSize() const
|
||||
{
|
||||
return m_fontPixelSize;
|
||||
}
|
||||
|
||||
void ChatViewTextProcessor::setFontPixelSize(qreal sz)
|
||||
{
|
||||
if (m_fontPixelSize == sz)
|
||||
return;
|
||||
m_fontPixelSize = sz;
|
||||
emit fontPixelSizeChanged();
|
||||
handleTextChanged();
|
||||
}
|
||||
|
||||
void traverseDocument(QTextDocument *doc, QTextFrame *frame)
|
||||
{
|
||||
QTextFrame *rootFrame = frame ? frame : doc->rootFrame();
|
||||
@@ -1126,7 +1141,7 @@ void ChatViewTextProcessor::handleCodeBlocks()
|
||||
codeBlockCharFormat.setForeground(defaultColor);
|
||||
|
||||
QFont monospaceFont("Courier");
|
||||
monospaceFont.setPointSize(QGuiApplication::font().pointSize() + 2);
|
||||
monospaceFont.setPointSize(m_fontPixelSize);
|
||||
if (monospaceFont.family() != "Courier") {
|
||||
monospaceFont.setFamily("Monospace"); // Fallback if Courier isn't available
|
||||
}
|
||||
|
Reference in New Issue
Block a user