Skip to content

Commit

Permalink
improve text size for Notes
Browse files Browse the repository at this point in the history
On Windows and macOS Qt applications use different font sizes for
different classes of widgets. This is even more noticeable on Windows
with display scaling over 100%, which is common. As a result, the Notes
text size is rather small, which can be bothersome with any non-short
text length. This change makes the text size the same as what appears in
the menus, which looks better.

Also, changed the tab size to use a non-deprecated method and use a
character that does not contract with kerning.
  • Loading branch information
ddennedy committed Mar 19, 2022
1 parent 5e1c326 commit dae7974
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/docks/notesdock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <QAction>
#include <QIcon>
#include <QTextEdit>
#include <QApplication>

NotesDock::NotesDock(QWidget *parent) :
QDockWidget(tr("Notes"), parent),
Expand All @@ -35,8 +36,9 @@ NotesDock::NotesDock(QWidget *parent) :
toggleViewAction()->setIcon(windowIcon());

m_textEdit->setTabChangesFocus(false);
m_textEdit->setTabStopDistance(m_textEdit->fontMetrics().width(" ")); // Tabstop = 4 spaces
m_textEdit->setTabStopDistance(m_textEdit->fontMetrics().horizontalAdvance("XXXX")); // Tabstop = 4 spaces
m_textEdit->setAcceptRichText(false);
m_textEdit->setFontPointSize(QApplication::font("QMenu").pointSize());
QObject::connect(m_textEdit, SIGNAL(textChanged()), SLOT(onTextChanged()));
QDockWidget::setWidget(m_textEdit);

Expand Down

0 comments on commit dae7974

Please sign in to comment.