Prettied up SimplePreview.
This commit is contained in:
+13
-6
@@ -29,13 +29,15 @@ namespace
|
||||
{
|
||||
const QColor paperColor( 255, 255, 255 );
|
||||
const QColor paperOutlineColor( 0, 0, 0 );
|
||||
const double paperOutlineWidthPixels = 1;
|
||||
|
||||
const QColor shadowColor( 64, 64, 64 );
|
||||
const double shadowOffset = 3;
|
||||
const double shadowRadius = 12;
|
||||
const double shadowOffsetPixels = 3;
|
||||
const double shadowRadiusPixels = 12;
|
||||
|
||||
const QColor labelColor( 242, 242, 242 );
|
||||
const QColor labelOutlineColor( 64, 64, 64 );
|
||||
const QColor labelColor( 255, 255, 255 );
|
||||
const QColor labelOutlineColor( 128, 128, 255 );
|
||||
const double labelOutlineWidthPixels = 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +53,7 @@ namespace gLabels
|
||||
viewport()->setAutoFillBackground(false);
|
||||
|
||||
setFrameStyle( QFrame::NoFrame );
|
||||
setRenderHints( QPainter::Antialiasing );
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +72,8 @@ namespace gLabels
|
||||
mScene->setSceneRect( x, y, w, h );
|
||||
fitInView( x, y, w, h, Qt::KeepAspectRatio );
|
||||
|
||||
mScale = matrix().m11();
|
||||
|
||||
drawPaper( tmplate->pageWidth(), tmplate->pageHeight() );
|
||||
drawLabels( tmplate );
|
||||
}
|
||||
@@ -89,11 +94,12 @@ namespace gLabels
|
||||
{
|
||||
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
||||
shadowEffect->setColor( shadowColor );
|
||||
shadowEffect->setOffset( shadowOffset );
|
||||
shadowEffect->setBlurRadius( shadowRadius );
|
||||
shadowEffect->setOffset( shadowOffsetPixels );
|
||||
shadowEffect->setBlurRadius( shadowRadiusPixels );
|
||||
|
||||
QBrush brush( paperColor );
|
||||
QPen pen( paperOutlineColor );
|
||||
pen.setWidthF( paperOutlineWidthPixels / mScale );
|
||||
|
||||
QGraphicsRectItem *pageItem = new QGraphicsRectItem( 0, 0, pw, ph );
|
||||
pageItem->setBrush( brush );
|
||||
@@ -119,6 +125,7 @@ namespace gLabels
|
||||
{
|
||||
QBrush brush( labelColor );
|
||||
QPen pen( labelOutlineColor );
|
||||
pen.setWidthF( labelOutlineWidthPixels / mScale );
|
||||
|
||||
QGraphicsPathItem *labelItem = new QGraphicsPathItem( path );
|
||||
labelItem->setBrush( brush );
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace gLabels
|
||||
void drawLabel( double x, double y, const QPainterPath &path );
|
||||
|
||||
QGraphicsScene *mScene;
|
||||
double mScale;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>860</width>
|
||||
<width>1012</width>
|
||||
<height>777</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -138,7 +138,7 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
@@ -184,15 +184,6 @@
|
||||
<property name="leftMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="selectionInfoGroup">
|
||||
<property name="title">
|
||||
<string>Selection</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="gLabels::SimplePreview" name="simplePreview">
|
||||
<property name="sizePolicy">
|
||||
@@ -335,9 +326,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
|
||||
Reference in New Issue
Block a user