diff --git a/app/SimplePreview.cpp b/app/SimplePreview.cpp index 714b0db..e220582 100644 --- a/app/SimplePreview.cpp +++ b/app/SimplePreview.cpp @@ -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 ); diff --git a/app/SimplePreview.h b/app/SimplePreview.h index 55402a1..ce49132 100644 --- a/app/SimplePreview.h +++ b/app/SimplePreview.h @@ -48,6 +48,7 @@ namespace gLabels void drawLabel( double x, double y, const QPainterPath &path ); QGraphicsScene *mScene; + double mScale; }; diff --git a/app/ui/NewLabelDialog.ui b/app/ui/NewLabelDialog.ui index cdc7c36..ba6c6f6 100644 --- a/app/ui/NewLabelDialog.ui +++ b/app/ui/NewLabelDialog.ui @@ -6,7 +6,7 @@ 0 0 - 860 + 1012 777 @@ -138,7 +138,7 @@ - 0 + 1 @@ -185,159 +185,147 @@ 12 - - - Selection + + + + 0 + 0 + + + + + 250 + 350 + - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + Qt::AlignCenter - - - - - - 0 - 0 - - - - - 250 - 350 - - - - Qt::AlignCenter - - - - - - - - - Vendor: - - - - - - - TextLabel - - - - - - - Part #: - - - - - - - TextLabel - - - - - - - Description: - - - - - - - TextLabel - - - - - - - Page size: - - - - - - - TextLabel - - - - - - - Label size: - - - - - - - TextLabel - - - - - - - Layout: - - - - - - - TextLabel - - - - - - - Similar to: - - - - - - - - 0 - 0 - - - - - 150 - 16777215 - - - - false - - - false - - - QFrame::NoFrame - - - false - - - - - - + + + + + + Vendor: + + + + + + + TextLabel + + + + + + + Part #: + + + + + + + TextLabel + + + + + + + Description: + + + + + + + TextLabel + + + + + + + Page size: + + + + + + + TextLabel + + + + + + + Label size: + + + + + + + TextLabel + + + + + + + Layout: + + + + + + + TextLabel + + + + + + + Similar to: + + + + + + + + 0 + 0 + + + + + 150 + 16777215 + + + + false + + + false + + + QFrame::NoFrame + + + false + + + + +