mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 00:09:11 +02:00
use a monospace font on all platforms
This commit is contained in:
parent
1705eb8f80
commit
7bbaf026f3
3 changed files with 11 additions and 3 deletions
|
@ -239,8 +239,8 @@ Hifi.Stats {
|
||||||
x: 4; y: 4
|
x: 4; y: 4
|
||||||
id: perfText
|
id: perfText
|
||||||
color: root.fontColor
|
color: root.fontColor
|
||||||
font.family: "Lucida Console"
|
font.family: root.monospaceFont
|
||||||
text: "-------------------------------------------------------- Function " +
|
text: "-------------------------------------------------------- Function " +
|
||||||
"------------------------------------------------------- --msecs- -calls--\n" +
|
"------------------------------------------------------- --msecs- -calls--\n" +
|
||||||
root.timingStats;
|
root.timingStats;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "Stats.h"
|
#include "Stats.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <QFontDatabase>
|
||||||
|
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/gtx/component_wise.hpp>
|
#include <glm/gtx/component_wise.hpp>
|
||||||
|
@ -50,6 +51,8 @@ Stats* Stats::getInstance() {
|
||||||
|
|
||||||
Stats::Stats(QQuickItem* parent) : QQuickItem(parent) {
|
Stats::Stats(QQuickItem* parent) : QQuickItem(parent) {
|
||||||
INSTANCE = this;
|
INSTANCE = this;
|
||||||
|
const QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
|
||||||
|
_monospaceFont = font.family();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Stats::includeTimingRecord(const QString& name) {
|
bool Stats::includeTimingRecord(const QString& name) {
|
||||||
|
|
|
@ -32,6 +32,8 @@ class Stats : public QQuickItem {
|
||||||
HIFI_QML_DECL
|
HIFI_QML_DECL
|
||||||
Q_PROPERTY(bool expanded READ isExpanded WRITE setExpanded NOTIFY expandedChanged)
|
Q_PROPERTY(bool expanded READ isExpanded WRITE setExpanded NOTIFY expandedChanged)
|
||||||
Q_PROPERTY(bool timingExpanded READ isTimingExpanded NOTIFY timingExpandedChanged)
|
Q_PROPERTY(bool timingExpanded READ isTimingExpanded NOTIFY timingExpandedChanged)
|
||||||
|
Q_PROPERTY(QString monospaceFont READ monospaceFont)
|
||||||
|
|
||||||
STATS_PROPERTY(int, serverCount, 0)
|
STATS_PROPERTY(int, serverCount, 0)
|
||||||
STATS_PROPERTY(int, framerate, 0)
|
STATS_PROPERTY(int, framerate, 0)
|
||||||
STATS_PROPERTY(int, avatarCount, 0)
|
STATS_PROPERTY(int, avatarCount, 0)
|
||||||
|
@ -79,7 +81,9 @@ public:
|
||||||
Stats(QQuickItem* parent = nullptr);
|
Stats(QQuickItem* parent = nullptr);
|
||||||
bool includeTimingRecord(const QString& name);
|
bool includeTimingRecord(const QString& name);
|
||||||
void setRenderDetails(const RenderDetails& details);
|
void setRenderDetails(const RenderDetails& details);
|
||||||
|
const QString& monospaceFont() {
|
||||||
|
return _monospaceFont;
|
||||||
|
}
|
||||||
void updateStats();
|
void updateStats();
|
||||||
|
|
||||||
bool isExpanded() { return _expanded; }
|
bool isExpanded() { return _expanded; }
|
||||||
|
@ -141,6 +145,7 @@ private:
|
||||||
bool _resetRecentMaxPacketsSoon{ true };
|
bool _resetRecentMaxPacketsSoon{ true };
|
||||||
bool _expanded{ false };
|
bool _expanded{ false };
|
||||||
bool _timingExpanded{ false };
|
bool _timingExpanded{ false };
|
||||||
|
QString _monospaceFont;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Stats_h
|
#endif // hifi_Stats_h
|
||||||
|
|
Loading…
Reference in a new issue