mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/profile: make the fonts 25% smaller
This will seem too small to many - it's pushing it, but it leads to a significantly less cluttered profile, and we now have the zoom capability for readability. I think this is a nice improvement. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
140d552e6d
commit
1eb8f7cbaa
1 changed files with 4 additions and 2 deletions
|
@ -8,6 +8,8 @@
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
|
|
||||||
|
const double fontScale = 0.6; // profile looks less cluttered with smaller font
|
||||||
|
|
||||||
QMLProfile::QMLProfile(QQuickItem *parent) :
|
QMLProfile::QMLProfile(QQuickItem *parent) :
|
||||||
QQuickPaintedItem(parent),
|
QQuickPaintedItem(parent),
|
||||||
m_devicePixelRatio(1.0),
|
m_devicePixelRatio(1.0),
|
||||||
|
@ -20,7 +22,7 @@ QMLProfile::QMLProfile(QQuickItem *parent) :
|
||||||
setFlags(QQuickItem::ItemClipsChildrenToShape | QQuickItem::ItemHasContents );
|
setFlags(QQuickItem::ItemClipsChildrenToShape | QQuickItem::ItemHasContents );
|
||||||
m_profileWidget->setProfileState();
|
m_profileWidget->setProfileState();
|
||||||
m_profileWidget->setPrintMode(true);
|
m_profileWidget->setPrintMode(true);
|
||||||
m_profileWidget->setFontPrintScale(0.8);
|
m_profileWidget->setFontPrintScale(fontScale);
|
||||||
connect(QMLManager::instance(), &QMLManager::sendScreenChanged, this, &QMLProfile::screenChanged);
|
connect(QMLManager::instance(), &QMLManager::sendScreenChanged, this, &QMLProfile::screenChanged);
|
||||||
setDevicePixelRatio(QMLManager::instance()->lastDevicePixelRatio());
|
setDevicePixelRatio(QMLManager::instance()->lastDevicePixelRatio());
|
||||||
}
|
}
|
||||||
|
@ -122,7 +124,7 @@ void QMLProfile::setDevicePixelRatio(qreal dpr)
|
||||||
{
|
{
|
||||||
if (dpr != m_devicePixelRatio) {
|
if (dpr != m_devicePixelRatio) {
|
||||||
m_devicePixelRatio = dpr;
|
m_devicePixelRatio = dpr;
|
||||||
m_profileWidget->setFontPrintScale(0.8 * dpr);
|
m_profileWidget->setFontPrintScale(fontScale * dpr);
|
||||||
updateDevicePixelRatio(dpr);
|
updateDevicePixelRatio(dpr);
|
||||||
emit devicePixelRatioChanged();
|
emit devicePixelRatioChanged();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue