forked from blue/squawk
some thoughts about fonts, lastInteraction and label into keyDelegate
This commit is contained in:
parent
2aed8a1209
commit
15fb4bbd62
15 changed files with 166 additions and 171 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue