some thoughts about fonts, lastInteraction and label into keyDelegate

This commit is contained in:
Blue 2023-01-11 23:45:38 +03:00
parent 2aed8a1209
commit 15fb4bbd62
Signed by untrusted user: blue
GPG key ID: 9B203B252A63EE38
15 changed files with 166 additions and 171 deletions

View file

@ -18,11 +18,18 @@
#include "preview.h"
#include <QFontDatabase>
constexpr int margin = 6;
constexpr int maxAttachmentHeight = 500;
QFont Preview::font;
QFont getFont () {
QFont font = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
font.setBold(true);
return font;
}
QFont Preview::font = getFont();
QFontMetrics Preview::metrics(Preview::font);
Preview::Preview(const QString& pPath, const QSize& pMaxSize, const QPoint& pos, QWidget* pParent):
@ -38,20 +45,12 @@ Preview::Preview(const QString& pPath, const QSize& pMaxSize, const QPoint& pos,
fileReachable(true),
actualPreview(false)
{
initializeElements();
if (fileReachable) {
positionElements();
}
}
void Preview::initializeFont(const QFont& newFont)
{
font = newFont;
font.setBold(true);
metrics = QFontMetrics(font);
}
Preview::~Preview()
{
clean();