Implemented text auto shrink feature.

This commit is contained in:
Jim Evins
2018-07-08 20:39:14 -04:00
parent 0832acabf5
commit 12b02d2521
10 changed files with 451 additions and 282 deletions
+10
View File
@@ -61,6 +61,7 @@ namespace glabels
Qt::Alignment textVAlign,
QTextOption::WrapMode textWrapMode,
double textLineSpacing,
bool textAutoShrink,
const QMatrix& matrix = QMatrix(),
bool shadowState = false,
const Distance& shadowX = 0,
@@ -160,6 +161,13 @@ namespace glabels
void setTextLineSpacing( double value ) override;
//
// Text Property: textAutoShrink
//
bool textAutoShrink() const override;
void setTextAutoShrink( bool value ) override;
//
// Property: naturalSize
//
@@ -191,6 +199,7 @@ namespace glabels
void drawTextInEditor( QPainter* painter, const QColor& color ) const;
void drawText( QPainter* painter, const QColor&color, merge::Record* record ) const;
QString expandText( QString text, merge::Record* record ) const;
double autoShrinkFontSize( merge::Record* record ) const;
///////////////////////////////////////////////////////////////
@@ -208,6 +217,7 @@ namespace glabels
Qt::Alignment mTextVAlign;
QTextOption::WrapMode mTextWrapMode;
double mTextLineSpacing;
bool mTextAutoShrink;
QList<QTextLayout*> mEditorLayouts;
QPainterPath mHoverPath;