Skip to content
Permalink
Browse files

Slightly improved guide appearance

  • Loading branch information
nyalldawson committed Jul 25, 2017
1 parent e718f92 commit 6138b979b2c3a7e44bbc2f5387ced3958f1a67d8
Showing with 14 additions and 3 deletions.
  1. +1 −1 src/core/layout/qgslayoutguidecollection.cpp
  2. +13 −2 src/gui/layout/qgslayoutruler.cpp
@@ -31,7 +31,7 @@ QgsLayoutGuide::QgsLayoutGuide( Orientation orientation, const QgsLayoutMeasurem
{
mLineItem->hide();
mLineItem->setZValue( QgsLayout::ZGuide );
QPen linePen( Qt::SolidLine );
QPen linePen( Qt::DotLine );
linePen.setColor( Qt::red );
// use a pen width of 0, since this activates a cosmetic pen
// which doesn't scale with the composer and keeps a constant size
@@ -265,8 +265,8 @@ void QgsLayoutRuler::createTemporaryGuideItem()
mGuideItem.reset( new QGraphicsLineItem() );

mGuideItem->setZValue( QgsLayout::ZGuide );
QPen linePen( Qt::DashLine );
linePen.setColor( Qt::red );
QPen linePen( Qt::DotLine );
linePen.setColor( QColor( 255, 0, 0, 150 ) );
linePen.setWidthF( 0 );
mGuideItem->setPen( linePen );

@@ -456,6 +456,17 @@ void QgsLayoutRuler::mouseMoveEvent( QMouseEvent *event )
QgsLayout *layout = mView->currentLayout();
int pageNo = layout->pageCollection()->pageNumberForPoint( displayPos );
QgsLayoutItemPage *page = layout->pageCollection()->page( pageNo );
QPen linePen = mGuideItem->pen();
// if guide preview is outside a page draw it a lot fainter, to indicate it's invalid
if ( !layout->pageCollection()->pageAtPoint( displayPos ) )
{
linePen.setColor( QColor( 255, 0, 0, 150 ) );
}
else
{
linePen.setColor( QColor( 255, 0, 0, 225 ) );
}
mGuideItem->setPen( linePen );

switch ( mOrientation )
{

0 comments on commit 6138b97

Please sign in to comment.
You can’t perform that action at this time.