From 47d93078ba276b43c369850bfcbb1c224f26d469 Mon Sep 17 00:00:00 2001 From: Duncan Runnacles Date: Tue, 22 Dec 2015 19:13:25 +0000 Subject: [PATCH] Added placement margin to decoration items and updated dialogs. - North arrow, scalebar, and copyright label updated to include a margin option on placement. - All qgsdecorationitem type dialogs amended so that all widgets sit within a checkable group box for activating/deactivating the item. --- src/app/qgsdecorationcopyright.cpp | 32 +- src/app/qgsdecorationcopyright.h | 3 + src/app/qgsdecorationcopyrightdialog.cpp | 8 +- src/app/qgsdecorationgriddialog.cpp | 6 +- src/app/qgsdecorationnortharrow.cpp | 24 +- src/app/qgsdecorationnortharrow.h | 3 + src/app/qgsdecorationnortharrowdialog.cpp | 8 +- src/app/qgsdecorationscalebar.cpp | 37 +- src/app/qgsdecorationscalebar.h | 3 + src/app/qgsdecorationscalebardialog.cpp | 8 +- src/ui/qgsdecorationcopyrightdialog.ui | 379 +++++++++----- src/ui/qgsdecorationgriddialog.ui | 582 +++++++++++----------- src/ui/qgsdecorationnortharrowdialog.ui | 380 ++++++++------ src/ui/qgsdecorationscalebardialog.ui | 555 ++++++++++++++------- 14 files changed, 1242 insertions(+), 786 deletions(-) diff --git a/src/app/qgsdecorationcopyright.cpp b/src/app/qgsdecorationcopyright.cpp index e0cc2868627..db97940f084 100644 --- a/src/app/qgsdecorationcopyright.cpp +++ b/src/app/qgsdecorationcopyright.cpp @@ -46,6 +46,8 @@ QgsDecorationCopyright::QgsDecorationCopyright( QObject* parent ) { mPlacementLabels << tr( "Bottom Left" ) << tr( "Top Left" ) << tr( "Top Right" ) << tr( "Bottom Right" ); + mMarginHorizontal = 0; + mMarginVertical = 0; setName( "Copyright Label" ); // initialise default values in the gui @@ -68,6 +70,8 @@ void QgsDecorationCopyright::projectRead() QgsProject* prj = QgsProject::instance(); mLabelQString = prj->readEntry( mNameConfig, "/Label", defString ); mPlacementIndex = prj->readNumEntry( mNameConfig, "/Placement", 3 ); + mMarginHorizontal = QgsProject::instance()->readNumEntry( mNameConfig, "/MarginH", 0 ); + mMarginVertical = QgsProject::instance()->readNumEntry( mNameConfig, "/MarginV", 0 ); mLabelQColor.setNamedColor( prj->readEntry( mNameConfig, "/Color", "#000000" ) ); // default color is black } @@ -80,6 +84,8 @@ void QgsDecorationCopyright::saveToProject() prj->writeEntry( mNameConfig, "/Label", mLabelQString ); prj->writeEntry( mNameConfig, "/Color", mLabelQColor.name() ); prj->writeEntry( mNameConfig, "/Placement", mPlacementIndex ); + prj->writeEntry( mNameConfig, "/MarginH", mMarginHorizontal ); + prj->writeEntry( mNameConfig, "/MarginV", mMarginVertical ); } // Slot called when the buffer menu item is activated @@ -112,28 +118,26 @@ void QgsDecorationCopyright::render( QPainter * theQPainter ) QSizeF size = text.size(); float myXOffset( 0 ), myYOffset( 0 ); + + myXOffset = int(( float( myWidth - size.width() ) + / 100. ) * float( mMarginHorizontal ) ); + myYOffset = int(( float( myHeight - size.height() ) + / 100. ) * float( mMarginVertical ) ); //Determine placement of label from form combo box switch ( mPlacementIndex ) { - case 0: // Bottom Left - //Define bottom left hand corner start point - myYOffset = myHeight - ( size.height() + 5 ); - myXOffset = 5; + case 0: // Bottom Left. myXOffset is set above + myYOffset = myHeight - myYOffset - size.height(); break; - case 1: // Top left - //Define top left hand corner start point - myYOffset = 0; - myXOffset = 5; + case 1: // Top left. Already setup above break; - case 2: // Top Right - //Define top right hand corner start point - myYOffset = 0; - myXOffset = myWidth - ( size.width() + 5 ); + case 2: // Top Right. myYOffset is set above + myXOffset = myWidth - myXOffset - size.width(); break; case 3: // Bottom Right //Define bottom right hand corner start point - myYOffset = myHeight - ( size.height() + 5 ); - myXOffset = myWidth - ( size.width() + 5 ); + myYOffset = myHeight - myYOffset - size.height(); + myXOffset = myWidth - myXOffset - size.width(); break; default: QgsDebugMsg( QString( "Unknown placement index of %1" ).arg( mPlacementIndex ) ); diff --git a/src/app/qgsdecorationcopyright.h b/src/app/qgsdecorationcopyright.h index f11d586d250..27a81eba968 100644 --- a/src/app/qgsdecorationcopyright.h +++ b/src/app/qgsdecorationcopyright.h @@ -60,6 +60,9 @@ class APP_EXPORT QgsDecorationCopyright : public QgsDecorationItem //! Placement of the copyright label - index and translated label names int mPlacementIndex; QStringList mPlacementLabels; + //! enable or disable use of position percentage for placement + int mMarginHorizontal; + int mMarginVertical; friend class QgsDecorationCopyrightDialog; }; diff --git a/src/app/qgsdecorationcopyrightdialog.cpp b/src/app/qgsdecorationcopyrightdialog.cpp index 109acf22792..fd1fd160208 100644 --- a/src/app/qgsdecorationcopyrightdialog.cpp +++ b/src/app/qgsdecorationcopyrightdialog.cpp @@ -33,13 +33,15 @@ QgsDecorationCopyrightDialog::QgsDecorationCopyrightDialog( QgsDecorationCopyrig cboOrientation->hide(); textLabel15->hide(); - cboxEnabled->setChecked( mDeco.enabled() ); + grpEnable->setChecked( mDeco.enabled() ); // text txtCopyrightText->setPlainText( mDeco.mLabelQString ); // placement cboPlacement->clear(); cboPlacement->addItems( mDeco.mPlacementLabels ); cboPlacement->setCurrentIndex( mDeco.mPlacementIndex ); + spnHorizontal->setValue( mDeco.mMarginHorizontal ); + spnVertical->setValue( mDeco.mMarginVertical ); // color pbnColorChooser->setColor( mDeco.mLabelQColor ); pbnColorChooser->setContext( "gui" ); @@ -63,7 +65,9 @@ void QgsDecorationCopyrightDialog::on_buttonBox_accepted() mDeco.mLabelQString = txtCopyrightText->toPlainText(); mDeco.mLabelQColor = pbnColorChooser->color(); mDeco.mPlacementIndex = cboPlacement->currentIndex(); - mDeco.setEnabled( cboxEnabled->isChecked() ); + mDeco.mMarginHorizontal = spnHorizontal->value(); + mDeco.mMarginVertical = spnVertical->value(); + mDeco.setEnabled( grpEnable->isChecked() ); accept(); } diff --git a/src/app/qgsdecorationgriddialog.cpp b/src/app/qgsdecorationgriddialog.cpp index e255a3fabba..e840bde5a03 100644 --- a/src/app/qgsdecorationgriddialog.cpp +++ b/src/app/qgsdecorationgriddialog.cpp @@ -37,7 +37,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid& deco, QWidg QSettings settings; // restoreGeometry( settings.value( "/Windows/DecorationGrid/geometry" ).toByteArray() ); - chkEnable->setChecked( mDeco.enabled() ); + grpEnable->setChecked( mDeco.enabled() ); // mXMinLineEdit->setValidator( new QDoubleValidator( mXMinLineEdit ) ); @@ -67,7 +67,7 @@ void QgsDecorationGridDialog::updateGuiElements() { // blockAllSignals( true ); - chkEnable->setChecked( mDeco.enabled() ); + grpEnable->setChecked( mDeco.enabled() ); mIntervalXEdit->setText( QString::number( mDeco.gridIntervalX() ) ); mIntervalYEdit->setText( QString::number( mDeco.gridIntervalY() ) ); @@ -109,7 +109,7 @@ void QgsDecorationGridDialog::updateGuiElements() void QgsDecorationGridDialog::updateDecoFromGui() { mDeco.setDirty( false ); - mDeco.setEnabled( chkEnable->isChecked() ); + mDeco.setEnabled( grpEnable->isChecked() ); mDeco.setGridIntervalX( mIntervalXEdit->text().toDouble() ); mDeco.setGridIntervalY( mIntervalYEdit->text().toDouble() ); diff --git a/src/app/qgsdecorationnortharrow.cpp b/src/app/qgsdecorationnortharrow.cpp index ed4a6162256..80e9a5eba78 100644 --- a/src/app/qgsdecorationnortharrow.cpp +++ b/src/app/qgsdecorationnortharrow.cpp @@ -61,6 +61,8 @@ QgsDecorationNorthArrow::QgsDecorationNorthArrow( QObject* parent ) mAutomatic = true; mPlacementLabels << tr( "Bottom Left" ) << tr( "Top Left" ) << tr( "Top Right" ) << tr( "Bottom Right" ); + mMarginHorizontal = 0; + mMarginVertical = 0; setName( "North Arrow" ); projectRead(); @@ -76,6 +78,8 @@ void QgsDecorationNorthArrow::projectRead() mRotationInt = QgsProject::instance()->readNumEntry( mNameConfig, "/Rotation", 0 ); mPlacementIndex = QgsProject::instance()->readNumEntry( mNameConfig, "/Placement", 0 ); mAutomatic = QgsProject::instance()->readBoolEntry( mNameConfig, "/Automatic", true ); + mMarginHorizontal = QgsProject::instance()->readNumEntry( mNameConfig, "/MarginH", 0 ); + mMarginVertical = QgsProject::instance()->readNumEntry( mNameConfig, "/MarginV", 0 ); } void QgsDecorationNorthArrow::saveToProject() @@ -84,6 +88,8 @@ void QgsDecorationNorthArrow::saveToProject() QgsProject::instance()->writeEntry( mNameConfig, "/Rotation", mRotationInt ); QgsProject::instance()->writeEntry( mNameConfig, "/Placement", mPlacementIndex ); QgsProject::instance()->writeEntry( mNameConfig, "/Automatic", mAutomatic ); + QgsProject::instance()->writeEntry( mNameConfig, "/MarginH", mMarginHorizontal ); + QgsProject::instance()->writeEntry( mNameConfig, "/MarginV", mMarginVertical ); } // Slot called when the buffer menu item is activated @@ -140,28 +146,34 @@ void QgsDecorationNorthArrow::render( QPainter * theQPainter ) //QgsDebugMsg("Rendering north arrow at " + mPlacementLabels.at(mPlacementIndex)); + // Calculate the margin percentage values + int myPercentageWidth = int((( float( myWidth ) - float( myQPixmap.width() ) ) + / 100. ) * float( mMarginHorizontal ) ); + int myPercentageHeight = int((( float( myHeight ) - float( myQPixmap.height() ) ) + / 100. ) * float( mMarginVertical ) ); + //Determine placement of label from form combo box switch ( mPlacementIndex ) { case 0: // Bottom Left - theQPainter->translate( 0, myHeight - myQPixmap.height() ); + theQPainter->translate( myPercentageWidth, myHeight - myPercentageHeight - myQPixmap.height() ); break; case 1: // Top Left - //no need to translate for TL corner because we're already at the origin - theQPainter->translate( 0, 0 ); + theQPainter->translate( myPercentageWidth, myPercentageHeight ); break; case 2: // Top Right - theQPainter->translate( myWidth - myQPixmap.width(), 0 ); + theQPainter->translate( myWidth - myPercentageWidth - myQPixmap.width(), myPercentageHeight ); break; case 3: // Bottom Right - theQPainter->translate( myWidth - myQPixmap.width(), - myHeight - myQPixmap.height() ); + theQPainter->translate( myWidth - myPercentageWidth - myQPixmap.width(), + myHeight - myPercentageHeight - myQPixmap.height() ); break; default: { //QgsDebugMsg("Unable to determine where to put north arrow so defaulting to top left"); } } + //rotate the canvas by the north arrow rotation amount theQPainter->rotate( mRotationInt ); //Now we can actually do the drawing, and draw a smooth north arrow even when rotated diff --git a/src/app/qgsdecorationnortharrow.h b/src/app/qgsdecorationnortharrow.h index 671f5900e95..0e7dc90eaf8 100644 --- a/src/app/qgsdecorationnortharrow.h +++ b/src/app/qgsdecorationnortharrow.h @@ -68,6 +68,9 @@ class APP_EXPORT QgsDecorationNorthArrow: public QgsDecorationItem // The placement index and translated text int mPlacementIndex; QStringList mPlacementLabels; + //! margin values + int mMarginHorizontal; + int mMarginVertical; friend class QgsDecorationNorthArrowDialog; }; diff --git a/src/app/qgsdecorationnortharrowdialog.cpp b/src/app/qgsdecorationnortharrowdialog.cpp index 620e8e8cd08..43d2b1c877d 100644 --- a/src/app/qgsdecorationnortharrowdialog.cpp +++ b/src/app/qgsdecorationnortharrowdialog.cpp @@ -39,9 +39,11 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth cboPlacement->clear(); cboPlacement->addItems( mDeco.mPlacementLabels ); cboPlacement->setCurrentIndex( mDeco.mPlacementIndex ); + spinHorizontal->setValue( mDeco.mMarginHorizontal ); + spinVertical->setValue( mDeco.mMarginVertical ); // enabled - cboxShow->setChecked( mDeco.enabled() ); + grpEnable->setChecked( mDeco.enabled() ); // automatic cboxAutomatic->setChecked( mDeco.mAutomatic ); @@ -62,8 +64,10 @@ void QgsDecorationNorthArrowDialog::on_buttonBox_accepted() { mDeco.mRotationInt = sliderRotation->value(); mDeco.mPlacementIndex = cboPlacement->currentIndex(); - mDeco.setEnabled( cboxShow->isChecked() ); + mDeco.setEnabled( grpEnable->isChecked() ); mDeco.mAutomatic = cboxAutomatic->isChecked(); + mDeco.mMarginHorizontal = spinHorizontal->value(); + mDeco.mMarginVertical = spinVertical->value(); accept(); } diff --git a/src/app/qgsdecorationscalebar.cpp b/src/app/qgsdecorationscalebar.cpp index 740c4b9601e..782c46f29b7 100644 --- a/src/app/qgsdecorationscalebar.cpp +++ b/src/app/qgsdecorationscalebar.cpp @@ -57,6 +57,8 @@ QgsDecorationScaleBar::QgsDecorationScaleBar( QObject* parent ) mPlacementIndex = 1; mStyleLabels << tr( "Tick Down" ) << tr( "Tick Up" ) << tr( "Bar" ) << tr( "Box" ); + mMarginHorizontal = 0; + mMarginVertical = 0; setName( "Scale Bar" ); projectRead(); @@ -79,6 +81,8 @@ void QgsDecorationScaleBar::projectRead() int myGreenInt = QgsProject::instance()->readNumEntry( mNameConfig, "/ColorGreenPart", 0 ); int myBlueInt = QgsProject::instance()->readNumEntry( mNameConfig, "/ColorBluePart", 0 ); mColor = QColor( myRedInt, myGreenInt, myBlueInt ); + mMarginHorizontal = QgsProject::instance()->readNumEntry( mNameConfig, "/MarginH", 0 ); + mMarginVertical = QgsProject::instance()->readNumEntry( mNameConfig, "/MarginV", 0 ); } void QgsDecorationScaleBar::saveToProject() @@ -92,6 +96,8 @@ void QgsDecorationScaleBar::saveToProject() QgsProject::instance()->writeEntry( mNameConfig, "/ColorRedPart", mColor.red() ); QgsProject::instance()->writeEntry( mNameConfig, "/ColorGreenPart", mColor.green() ); QgsProject::instance()->writeEntry( mNameConfig, "/ColorBluePart", mColor.blue() ); + QgsProject::instance()->writeEntry( mNameConfig, "/MarginH", mMarginHorizontal ); + QgsProject::instance()->writeEntry( mNameConfig, "/MarginV", mMarginVertical ); } @@ -133,7 +139,6 @@ void QgsDecorationScaleBar::render( QPainter * theQPainter ) // Hard coded sizes int myMajorTickSize = 8; int myTextOffsetX = 3; - int myMargin = 20; QSettings settings; QGis::UnitType myPreferredUnits = QGis::fromLiteral( settings.value( "/qgis/measure/displayunits", QGis::toLiteral( QGis::Meters ) ).toString() ); @@ -252,26 +257,34 @@ void QgsDecorationScaleBar::render( QPainter * theQPainter ) //Calculate total width of scale bar and label double myTotalScaleBarWidth = myScaleBarWidth + myFontWidth; - //determine the origin of scale bar depending on placement selected - int myOriginX = myMargin; - int myOriginY = myMargin; + //Calculate percentage page width for use in placing item + int myMarginW = 10; + int myMarginH = 20; + float myMarginDoubledW = float( myMarginW * 2 ); + float myMarginDoubledH = float( myMarginH * 2 ); + int myOriginX = int((( float( myCanvasWidth - myMarginDoubledW ) - myTotalScaleBarWidth ) + / 100. ) * float( mMarginHorizontal ) ); + int myOriginY = int((( float( myCanvasHeight - myMarginDoubledH ) ) + / 100. ) * float( mMarginVertical ) ); + + //Determine the origin of scale bar depending on placement selected switch ( mPlacementIndex ) { case 0: // Bottom Left - myOriginX = myMargin; - myOriginY = myCanvasHeight - myMargin; + myOriginX += myMarginW; + myOriginY = myCanvasHeight - myOriginY - myMarginH; break; case 1: // Top Left - myOriginX = myMargin; - myOriginY = myMargin; + myOriginX += myMarginW; + myOriginY += myMarginH; break; case 2: // Top Right - myOriginX = myCanvasWidth - (( int ) myTotalScaleBarWidth ) - myMargin; - myOriginY = myMargin; + myOriginX = myCanvasWidth - myOriginX - myMarginW - (( int ) myTotalScaleBarWidth ); + myOriginY += myMarginH; break; case 3: // Bottom Right - myOriginX = myCanvasWidth - (( int ) myTotalScaleBarWidth ) - myMargin; - myOriginY = myCanvasHeight - myMargin; + myOriginX = myCanvasWidth - myOriginX - myMarginW - (( int ) myTotalScaleBarWidth ); + myOriginY = myCanvasHeight - myOriginY - myMarginH; break; default: QgsDebugMsg( "Unable to determine where to put scale bar so defaulting to top left" ); diff --git a/src/app/qgsdecorationscalebar.h b/src/app/qgsdecorationscalebar.h index c4f043f46dc..1f3793822e8 100644 --- a/src/app/qgsdecorationscalebar.h +++ b/src/app/qgsdecorationscalebar.h @@ -62,6 +62,9 @@ class APP_EXPORT QgsDecorationScaleBar: public QgsDecorationItem QStringList mStyleLabels; //! The scale bar color QColor mColor; + //! Margin percentage values + int mMarginHorizontal; + int mMarginVertical; friend class QgsDecorationScaleBarDialog; }; diff --git a/src/app/qgsdecorationscalebardialog.cpp b/src/app/qgsdecorationscalebardialog.cpp index 595e215996c..49fc452da49 100644 --- a/src/app/qgsdecorationscalebardialog.cpp +++ b/src/app/qgsdecorationscalebardialog.cpp @@ -50,8 +50,10 @@ QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar& cboPlacement->clear(); cboPlacement->addItems( mDeco.mPlacementLabels ); cboPlacement->setCurrentIndex( mDeco.mPlacementIndex ); + spnHorizontal->setValue( mDeco.mMarginHorizontal ); + spnVertical->setValue( mDeco.mMarginVertical ); - chkEnable->setChecked( mDeco.enabled() ); + grpEnable->setChecked( mDeco.enabled() ); cboStyle->clear(); cboStyle->addItems( mDeco.mStyleLabels ); @@ -77,9 +79,11 @@ void QgsDecorationScaleBarDialog::on_buttonBox_helpRequested() void QgsDecorationScaleBarDialog::on_buttonBox_accepted() { mDeco.mPlacementIndex = cboPlacement->currentIndex(); + mDeco.mMarginHorizontal = spnHorizontal->value(); + mDeco.mMarginVertical = spnVertical->value(); mDeco.mPreferredSize = spnSize->value(); mDeco.mSnapping = chkSnapping->isChecked(); - mDeco.setEnabled( chkEnable->isChecked() ); + mDeco.setEnabled( grpEnable->isChecked() ); mDeco.mStyleIndex = cboStyle->currentIndex(); mDeco.mColor = pbnChangeColor->color(); diff --git a/src/ui/qgsdecorationcopyrightdialog.ui b/src/ui/qgsdecorationcopyrightdialog.ui index 5cd8cd3e7a5..81649b5d8c9 100644 --- a/src/ui/qgsdecorationcopyrightdialog.ui +++ b/src/ui/qgsdecorationcopyrightdialog.ui @@ -6,8 +6,8 @@ 0 0 - 397 - 326 + 526 + 291 @@ -19,139 +19,259 @@ - - - + + + + + 0 + 240 + + + Enable copyright label - + true - - - - - - &Enter your copyright label here: + + false - - txtCopyrightText - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + + + Top Left + + + + + Top Right + + + + + Bottom Left + + + + + Bottom Right + + + + + + + + + 155 + 0 + + + + Margin from edge (%) + + + + + + + Horizontal + + + + + + + + 90 + 0 + + + + + 16777215 + 16777215 + + + + 0 + + + 100 + + + + + + + Vertical + + + + + + + + 90 + 0 + + + + + 16777215 + 16777215 + + + + 100 + + + + + + + + 100 + 16777215 + + + + &Orientation + + + cboOrientation + + + + + + + &Enter your copyright label here: + + + txtCopyrightText + + + + + + + + 100 + 16777215 + + + + &Placement + + + cboPlacement + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Verdana'; font-size:10pt;">© QGIS 2013</span></p></body></html> - + + + + + + + + + + 150 + 0 + + + + + Horizontal + + + + + Vertical + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 100 + 16777215 + + + + Color + + + + + + + + + + 150 + 0 + + + + + 120 + 16777215 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + - - - - &Placement - - - cboPlacement - - - - - - - - Bottom Left - - - - - Top Left - - - - - Bottom Right - - - - - Top Right - - - - - - - - &Orientation - - - cboOrientation - - - - - - - - Horizontal - - - - - Vertical - - - - - - - - Color - - - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - + Qt::Horizontal @@ -171,13 +291,20 @@ p, li { white-space: pre-wrap; }
qgscolorbuttonv2.h
1 + + QgsSpinBox + QSpinBox +
qgsspinbox.h
+
- cboxEnabled + grpEnable txtCopyrightText cboPlacement - cboOrientation + spnHorizontal + spnVertical pbnColorChooser + cboOrientation buttonBox diff --git a/src/ui/qgsdecorationgriddialog.ui b/src/ui/qgsdecorationgriddialog.ui index 3edaacbd984..6ce69e7f8e9 100644 --- a/src/ui/qgsdecorationgriddialog.ui +++ b/src/ui/qgsdecorationgriddialog.ui @@ -18,292 +18,302 @@ QLayout::SetMinimumSize
- - - - - - 0 - 0 - - - - Qt::LeftToRight - - - Enable grid - - - true - - - - - - - Interval X - - - true - - - - - - - Interval Y - - - true - - - - - - - Qt::Horizontal - - - - - - - - - - Grid type - - - true - - - - - - - Line symbol - - - true - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - - - - false - - - - 0 - 0 - - - - - 100 - 0 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - - - - Draw annotation - - - false - - - true - - - false - - - - QLayout::SetMinimumSize + + + Enable grid + + + true + + + false + + + + + + Draw annotation - - - - QFrame::NoFrame - - - Annotation direction - - - true - - - - - - - - - - Font... - - - - - - - Distance to map frame - - - true - - - - - - - - - - Coordinate precision - - - true - - - - - - - - - - - - - Marker symbol - - - - - - - false - - - - 0 - 0 - - - - - 100 - 0 - - - - - - - - - - - Qt::Horizontal - - - - - - - Offset X - - - true - - - - - - - Offset Y - - - true - - - - - - - Update Interval / Offset from - - - - - - Canvas Extents - - - - - - - Active Raster Layer - - - - - - - - - - - - - - - - - - - + + false + + + true + + + false + + + + QLayout::SetMinimumSize + + + + + QFrame::NoFrame + + + Annotation direction + + + true + + + + + + + + + + Font... + + + + + + + Distance to map frame + + + true + + + + + + + + + + Coordinate precision + + + true + + + + + + + +
+
+ + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + + + + + + Interval Y + + + true + + + + + + + + + + Qt::Horizontal + + + + + + + + + + Grid type + + + true + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + + + + Line symbol + + + true + + + + + + + false + + + + 0 + 0 + + + + + 100 + 0 + + + + + + + + + + + Marker symbol + + + + + + + false + + + + 0 + 0 + + + + + 100 + 0 + + + + + + + + + + + Qt::Horizontal + + + + + + + Offset X + + + true + + + + + + + + + + Update Interval / Offset from + + + + + + Canvas Extents + + + + + + + Active Raster Layer + + + + + + + + + + Offset Y + + + true + + + + + + + + + + + + + Interval X + + + true + + + + + mOffsetYEdit + mOffsetXEdit + mDrawAnnotationCheckBox + mLineSymbolLabel + groupBox + mLineSymbolButton + mMarkerSymbolButton + mMarkerSymbolLabel + mIntervalXEdit + line_2 + line_3 + mIntervalYEdit + mIntervalXLabel + mOffsetXLabel + mGridTypeComboBox + mGridTypeLabel + mIntervalYLabel + mOffsetYLabel +
@@ -318,7 +328,7 @@ - chkEnable + grpEnable mIntervalXEdit mIntervalYEdit mGridTypeComboBox diff --git a/src/ui/qgsdecorationnortharrowdialog.ui b/src/ui/qgsdecorationnortharrowdialog.ui index 81cda8d9535..4c14eda41f2 100644 --- a/src/ui/qgsdecorationnortharrowdialog.ui +++ b/src/ui/qgsdecorationnortharrowdialog.ui @@ -6,8 +6,8 @@ 0 0 - 382 - 193 + 549 + 234 @@ -20,152 +20,243 @@ - - - Qt::Horizontal + + + Enable north arrow - - - - 0 - 0 - - - - Preview of north arrow - - - QFrame::StyledPanel - - - false - - - Qt::AlignCenter - - - - - - + + true + + + false + + + + + + 360 + + + 1 + + + 0 + + + + + + + + + + 360 + + + 1 + + + 10 + + + Qt::Horizontal + + + + + + + Placement on screen + + - Angle + Top Left - - sliderRotation - - - - - - - - - - 360 - - - 1 - - - 10 - - - Qt::Horizontal - - - - - - - 360 - - - 1 - - - 0 - - - - - + + - Placement + Top Right - - cboPlacement - - - - - - - Placement on screen - - - - Top Left - - - - - Top Right - - - - - Bottom Left - - - - - Bottom Right - - - - - - + + - Enable North Arrow - - - true - - - - - - - - - - + Bottom Left + + - Set direction automatically + Bottom Right - - true - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - + + + + + + + Horizontal + + + + + + + Vertical + + + + + + + + 90 + 0 + + + + + + + 0 + + + 100 + + + 0 + + + + + + + + 90 + 0 + + + + + + + 0 + + + 100 + + + 0 + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + Angle + + + sliderRotation + + + + + + + Placement + + + cboPlacement + + + + + + + Qt::Vertical + + + + 20 + 7 + + + + + + + + + 155 + 0 + + + + Margin from edge (%) + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + + + + + + Set direction automatically + + + true + + + + + + + + 0 + 0 + + + + Preview of north arrow + + + QFrame::StyledPanel + + + false + + + Qt::AlignCenter + + + + @@ -181,11 +272,20 @@ + + + QgsSpinBox + QSpinBox +
qgsspinbox.h
+
+
+ grpEnable sliderRotation spinAngle cboPlacement - cboxShow + spinHorizontal + spinVertical cboxAutomatic buttonBox diff --git a/src/ui/qgsdecorationscalebardialog.ui b/src/ui/qgsdecorationscalebardialog.ui index 70a24eaaaa3..1156a896ab6 100644 --- a/src/ui/qgsdecorationscalebardialog.ui +++ b/src/ui/qgsdecorationscalebardialog.ui @@ -6,8 +6,8 @@ 0 0 - 356 - 255 + 537 + 271 @@ -15,213 +15,375 @@ - - + ../../../../../.designer/backup../../../../../.designer/backup - - + + 0 0 - - Placement + + + 0 + 220 + - - cboPlacement - - - - - - - - 0 - 0 - - - - - Top Left - - - - - Top Right - - - - - Bottom Left - - - - - Bottom Right - - - - - - - - - 0 - 0 - - - - Scale bar style - - - cboStyle - - - - - - - - 0 - 0 - - - - Select the style of the scale bar - - - - Tick Down - - - - - Tick Up - - - - - Box - - - - - Bar - - - - - - - - - 0 - 0 - - - - Color of bar - - - - - - - - - - 120 - 0 - - - - - 120 - 16777215 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 0 - 0 - - - - Size of bar - - - spnSize - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - + Enable scale bar - + true - - - - - - - 0 - 0 - - - - Automatically snap to round number on resize - - true + false + + + 0 + + + 6 + + + 0 + + + 6 + + + 6 + + + + + + 0 + 0 + + + + Location + + + cboPlacement + + + + + + + + 155 + 0 + + + + Margin from edge (%) + + + + + + + + 0 + 0 + + + + Color of bar + + + + + + + + 0 + 0 + + + + Automatically snap to round number on resize + + + true + + + + + + + + 0 + 0 + + + + Scale bar style + + + cboStyle + + + + + + + + 0 + 0 + + + + Size of bar + + + spnSize + + + + + + + + 0 + 0 + + + + + 338 + 0 + + + + + Top Left + + + + + Top Right + + + + + Bottom Left + + + + + Bottom Right + + + + + + + + + 0 + 0 + + + + + 338 + 0 + + + + Select the style of the scale bar + + + + Tick Down + + + + + Tick Up + + + + + Box + + + + + Bar + + + + + + + + + 338 + 0 + + + + + 16777215 + 16777215 + + + + + + + + + + + + 0 + 0 + + + + + 338 + 0 + + + + + + + + 10 + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + + 70 + 0 + + + + + 60 + 16777215 + + + + Horizontal + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + + 90 + 16777215 + + + + 0 + + + 100 + + + + + + + + 0 + 0 + + + + + 60 + 16777215 + + + + Vertical + + + + + + + + 0 + 0 + + + + + 90 + 0 + + + + + 90 + 16777215 + + + + 100 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + - + Qt::Horizontal @@ -241,13 +403,20 @@
qgscolorbuttonv2.h
1 + + QgsSpinBox + QSpinBox +
qgsspinbox.h
+
+ grpEnable cboPlacement + spnHorizontal + spnVertical cboStyle pbnChangeColor spnSize - chkEnable chkSnapping buttonBox