Compare commits

...

6 Commits

Author SHA1 Message Date
Dietrich Göttlicher
7f7ec4cbc8
Merge a94f2b66ec722337a82a193ebe1e798ed2ffa6f7 into 08dd318614d21eb557a1311775b1a1dff509d3b4 2025-07-01 02:06:48 +02:00
goettlic
a94f2b66ec adjusting decoration scalebar fixing #15647 2025-06-07 16:32:43 +00:00
goettlic
c8bdd7cc75 adjusting decoration scalebar fixing #15647 2025-06-07 09:59:22 +00:00
goettlic
9443694558 adjusting decoration scalebar fixing #15647 2025-06-06 22:46:00 +00:00
goettlic
c44e5024a3 adjusting decoration scalebar fixing #15647 2025-06-06 20:32:27 +00:00
goettlic
900e5a4b2a adjusting decoration scalebar fixing #15647 2025-06-06 12:49:38 +00:00
5 changed files with 406 additions and 238 deletions

View File

@ -33,7 +33,6 @@ email : sbr00pwb@users.sourceforge.net
#include "qgspointxy.h" #include "qgspointxy.h"
#include "qgsproject.h" #include "qgsproject.h"
#include "qgsunittypes.h" #include "qgsunittypes.h"
#include "qgssettings.h"
#include "qgscolorutils.h" #include "qgscolorutils.h"
#include "qgsfillsymbollayer.h" #include "qgsfillsymbollayer.h"
#include "qgsfillsymbol.h" #include "qgsfillsymbol.h"
@ -60,7 +59,7 @@ email : sbr00pwb@users.sourceforge.net
QgsDecorationScaleBar::QgsDecorationScaleBar( QObject *parent ) QgsDecorationScaleBar::QgsDecorationScaleBar( QObject *parent )
: QgsDecorationItem( parent ) : QgsDecorationItem( parent )
{ {
mPlacement = TopLeft; mPlacement = BottomLeft;
mMarginUnit = Qgis::RenderUnit::Millimeters; mMarginUnit = Qgis::RenderUnit::Millimeters;
mStyleLabels << tr( "Tick Down" ) << tr( "Tick Up" ) mStyleLabels << tr( "Tick Down" ) << tr( "Tick Up" )
<< tr( "Bar" ) << tr( "Box" ); << tr( "Bar" ) << tr( "Box" );
@ -77,7 +76,8 @@ void QgsDecorationScaleBar::projectRead()
{ {
QgsDecorationItem::projectRead(); QgsDecorationItem::projectRead();
mPreferredSize = QgsProject::instance()->readNumEntry( mConfigurationName, QStringLiteral( "/PreferredSize" ), 30 ); mPreferredSize = QgsProject::instance()->readNumEntry( mConfigurationName, QStringLiteral( "/PreferredSize" ), 30 );
mStyleIndex = QgsProject::instance()->readNumEntry( mConfigurationName, QStringLiteral( "/Style" ), 0 ); mMaximumWidth = QgsProject::instance()->readNumEntry( mConfigurationName, QStringLiteral( "/MaxWidth" ), 33 );
mStyleIndex = QgsProject::instance()->readNumEntry( mConfigurationName, QStringLiteral( "/Style" ), 1 );
mSnapping = QgsProject::instance()->readBoolEntry( mConfigurationName, QStringLiteral( "/Snapping" ), true ); mSnapping = QgsProject::instance()->readBoolEntry( mConfigurationName, QStringLiteral( "/Snapping" ), true );
mColor = QgsColorUtils::colorFromString( QgsProject::instance()->readEntry( mConfigurationName, QStringLiteral( "/Color" ), QStringLiteral( "#000000" ) ) ); mColor = QgsColorUtils::colorFromString( QgsProject::instance()->readEntry( mConfigurationName, QStringLiteral( "/Color" ), QStringLiteral( "#000000" ) ) );
mOutlineColor = QgsColorUtils::colorFromString( QgsProject::instance()->readEntry( mConfigurationName, QStringLiteral( "/OutlineColor" ), QStringLiteral( "#FFFFFF" ) ) ); mOutlineColor = QgsColorUtils::colorFromString( QgsProject::instance()->readEntry( mConfigurationName, QStringLiteral( "/OutlineColor" ), QStringLiteral( "#FFFFFF" ) ) );
@ -120,6 +120,7 @@ void QgsDecorationScaleBar::saveToProject()
{ {
QgsDecorationItem::saveToProject(); QgsDecorationItem::saveToProject();
QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/PreferredSize" ), mPreferredSize ); QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/PreferredSize" ), mPreferredSize );
QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/MaxWidth" ), mMaximumWidth );
QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/Snapping" ), mSnapping ); QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/Snapping" ), mSnapping );
QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/Style" ), mStyleIndex ); QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/Style" ), mStyleIndex );
QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/Color" ), QgsColorUtils::colorToString( mColor ) ); QgsProject::instance()->writeEntry( mConfigurationName, QStringLiteral( "/Color" ), QgsColorUtils::colorToString( mColor ) );
@ -139,7 +140,7 @@ void QgsDecorationScaleBar::saveToProject()
void QgsDecorationScaleBar::run() void QgsDecorationScaleBar::run()
{ {
QgsDecorationScaleBarDialog dlg( *this, QgisApp::instance()->mapCanvas()->mapUnits(), QgisApp::instance() ); QgsDecorationScaleBarDialog dlg( *this, QgisApp::instance() );
dlg.exec(); dlg.exec();
} }
@ -252,34 +253,34 @@ void QgsDecorationScaleBar::render( const QgsMapSettings &mapSettings, QgsRender
const float deviceHeight = static_cast<float>( device->height() ) / context.devicePixelRatio(); const float deviceHeight = static_cast<float>( device->height() ) / context.devicePixelRatio();
const float deviceWidth = static_cast<float>( device->width() ) / context.devicePixelRatio(); const float deviceWidth = static_cast<float>( device->width() ) / context.devicePixelRatio();
const Qgis::DistanceUnit preferredUnits = QgsProject::instance()->distanceUnits(); const Qgis::DistanceUnit preferredUnits = QgsProject::instance()->distanceUnits();
Qgis::DistanceUnit scaleBarUnits = mapSettings.mapUnits();
//Get map units per pixel //Get map units per pixel
const double scaleBarUnitsPerPixel = ( mapWidth( mapSettings ) / mapSettings.outputSize().width() ) * QgsUnitTypes::fromUnitToUnitFactor( mSettings.units(), preferredUnits ); const double scaleBarUnitsPerPixel = ( mapWidth( mapSettings ) / mapSettings.outputSize().width() ) * QgsUnitTypes::fromUnitToUnitFactor( mSettings.units(), preferredUnits );
scaleBarUnits = preferredUnits; Qgis::DistanceUnit scaleBarUnits = preferredUnits;
// Exit if the canvas width is 0 or layercount is 0 or QGIS will freeze // Exit if the canvas width is 0 or layercount is 0 or QGIS will freeze
if ( mapSettings.layers().isEmpty() || !deviceWidth || !scaleBarUnitsPerPixel ) if ( mapSettings.layers().isEmpty() || !deviceWidth || !scaleBarUnitsPerPixel )
return; return;
//Set length of scale bar to desired length in map units
double unitsPerSegment = mPreferredSize; double unitsPerSegment = mPreferredSize;
//Calculate size of scale bar for preferred number of map units //Calculate size of scale bar in pixels for preferred number of map units
double scaleBarWidth = mPreferredSize / scaleBarUnitsPerPixel; double scaleBarWidth = mPreferredSize / scaleBarUnitsPerPixel;
//If scale bar is very small reset to 1/4 of the canvas wide //If scale bar is very small (< 30 pixels) reset to max percentage of map canvas
if ( scaleBarWidth < 30 ) if ( scaleBarWidth < 30 )
{ {
scaleBarWidth = deviceWidth / 4.0; // value in pixels scaleBarWidth = deviceWidth * mMaximumWidth / 100; // value in pixels
unitsPerSegment = scaleBarWidth * scaleBarUnitsPerPixel; // value in map units unitsPerSegment = scaleBarWidth * scaleBarUnitsPerPixel; // value in map units
} }
//if scale bar is more than half the canvas wide keep halving until not //if scale bar is more than the maximum percentage of the width of the map canvas resize to maxWidth
while ( scaleBarWidth > deviceWidth / 3.0 ) if ( scaleBarWidth > deviceWidth * mMaximumWidth / 100 )
{ {
scaleBarWidth = scaleBarWidth / 3; scaleBarWidth = deviceWidth * mMaximumWidth / 100;
unitsPerSegment = scaleBarWidth * scaleBarUnitsPerPixel;
} }
unitsPerSegment = scaleBarWidth * scaleBarUnitsPerPixel;
// Work out the exponent for the number - e.g, 1234 will give 3, // Work out the exponent for the number - e.g, 1234 will give 3,
// and .001234 will give -3 // and .001234 will give -3

View File

@ -53,6 +53,8 @@ class APP_EXPORT QgsDecorationScaleBar : public QgsDecorationItem
private: private:
//! The size preferred size of the scale bar //! The size preferred size of the scale bar
int mPreferredSize; int mPreferredSize;
//! The maximum width of the scale bar in percentage of width of map canvas
int mMaximumWidth;
//! Should we snap to integer times power of 10? //! Should we snap to integer times power of 10?
bool mSnapping; bool mSnapping;
//! Style of scale bar. An index and the translated text //! Style of scale bar. An index and the translated text

View File

@ -13,7 +13,6 @@
#include "qgsdecorationscalebardialog.h" #include "qgsdecorationscalebardialog.h"
#include "moc_qgsdecorationscalebardialog.cpp" #include "moc_qgsdecorationscalebardialog.cpp"
#include "qgsdecorationscalebar.h" #include "qgsdecorationscalebar.h"
#include "qgslogger.h"
#include "qgshelp.h" #include "qgshelp.h"
#include "qgsgui.h" #include "qgsgui.h"
@ -21,7 +20,7 @@
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QPushButton> #include <QPushButton>
QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar &deco, Qgis::DistanceUnit units, QWidget *parent ) QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar &deco, QWidget *parent )
: QDialog( parent ) : QDialog( parent )
, mDeco( deco ) , mDeco( deco )
{ {
@ -36,25 +35,10 @@ QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar
QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply ); QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply );
connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationScaleBarDialog::apply ); connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationScaleBarDialog::apply );
// set the map units in the spin box
spnSize->setShowClearButton( false );
switch ( units )
{
case Qgis::DistanceUnit::Meters:
spnSize->setSuffix( tr( " meters/km" ) );
break;
case Qgis::DistanceUnit::Feet:
case Qgis::DistanceUnit::Miles:
spnSize->setSuffix( tr( " feet/miles" ) );
break;
case Qgis::DistanceUnit::Degrees:
spnSize->setSuffix( tr( " degrees" ) );
break;
default:
QgsDebugError( QStringLiteral( "Error: not picked up map units - actual value = %1" ).arg( qgsEnumValueToKey( units ) ) );
}
spnSize->setValue( mDeco.mPreferredSize ); spnSize->setValue( mDeco.mPreferredSize );
spnMaxWidth->setValue( mDeco.mMaximumWidth );
chkSnapping->setChecked( mDeco.mSnapping ); chkSnapping->setChecked( mDeco.mSnapping );
// placement // placement
@ -114,6 +98,7 @@ void QgsDecorationScaleBarDialog::apply()
mDeco.mMarginHorizontal = spnHorizontal->value(); mDeco.mMarginHorizontal = spnHorizontal->value();
mDeco.mMarginVertical = spnVertical->value(); mDeco.mMarginVertical = spnVertical->value();
mDeco.mPreferredSize = spnSize->value(); mDeco.mPreferredSize = spnSize->value();
mDeco.mMaximumWidth = spnMaxWidth->value();
mDeco.mSnapping = chkSnapping->isChecked(); mDeco.mSnapping = chkSnapping->isChecked();
mDeco.setEnabled( grpEnable->isChecked() ); mDeco.setEnabled( grpEnable->isChecked() );
mDeco.mStyleIndex = cboStyle->currentIndex(); mDeco.mStyleIndex = cboStyle->currentIndex();

View File

@ -24,7 +24,7 @@ class APP_EXPORT QgsDecorationScaleBarDialog : public QDialog, private Ui::QgsDe
Q_OBJECT Q_OBJECT
public: public:
QgsDecorationScaleBarDialog( QgsDecorationScaleBar &deco, Qgis::DistanceUnit units, QWidget *parent = nullptr ); QgsDecorationScaleBarDialog( QgsDecorationScaleBar &deco, QWidget *parent = nullptr );
private slots: private slots:
void buttonBox_accepted(); void buttonBox_accepted();

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>596</width> <width>600</width>
<height>337</height> <height>320</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -17,21 +17,11 @@
<iconset> <iconset>
<normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset> <normaloff>../../../../../.designer/backup</normaloff>../../../../../.designer/backup</iconset>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item row="1" column="0"> <item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="grpEnable"> <widget class="QGroupBox" name="grpEnable">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -39,7 +29,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>220</height> <height>0</height>
</size> </size>
</property> </property>
<property name="title"> <property name="title">
@ -51,14 +41,85 @@
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout">
<item row="3" column="1"> <item row="0" column="0">
<widget class="QLabel" name="textLabel1">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Scale bar style</string>
</property>
<property name="buddy">
<cstring>cboStyle</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="cboStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Select the style of the scale bar</string>
</property>
<property name="currentText">
<string>Tick Up</string>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>Tick Down</string>
</property>
</item>
<item>
<property name="text">
<string>Tick Up</string>
</property>
</item>
<item>
<property name="text">
<string>Box</string>
</property>
</item>
<item>
<property name="text">
<string>Bar</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="textLabel1_3_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Color of bar</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<layout class="QHBoxLayout" name="colorLayout"> <layout class="QHBoxLayout" name="colorLayout">
<item> <item>
<widget class="QLabel" name="fillLabel"> <widget class="QLabel" name="fillLabel">
<property name="text"> <property name="text">
<string>Fill</string> <string>Fill</string>
</property> </property>
<property name="buddy">
<cstring>pbnChangeColor</cstring>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -85,6 +146,9 @@
<property name="text"> <property name="text">
<string>Outline</string> <string>Outline</string>
</property> </property>
<property name="buddy">
<cstring>pbnChangeOutlineColor</cstring>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -106,130 +170,6 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="textLabel1">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Scale bar style</string>
</property>
<property name="buddy">
<cstring>cboStyle</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="textLabel1_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size of bar</string>
</property>
<property name="buddy">
<cstring>spnSize</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cboStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Select the style of the scale bar</string>
</property>
<item>
<property name="text">
<string>Tick Down</string>
</property>
</item>
<item>
<property name="text">
<string>Tick Up</string>
</property>
</item>
<item>
<property name="text">
<string>Box</string>
</property>
</item>
<item>
<property name="text">
<string>Bar</string>
</property>
</item>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="textLabel1_3_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Color of bar</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="textLabel1_3_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Font of bar</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QgsFontButton" name="mButtonFontStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QgsSpinBox" name="spnSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
@ -245,8 +185,234 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="8" column="1"> <item row="2" column="0">
<layout class="QHBoxLayout" name="hlytMargin" stretch="0,0,0,0,0"> <widget class="QLabel" name="textLabel1_3_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Font of bar</string>
</property>
<property name="buddy">
<cstring>mButtonFontStyle</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QgsFontButton" name="mButtonFontStyle">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Font</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lblSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size of bar</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<layout class="QHBoxLayout" name="hlytSize">
<item>
<widget class="QLabel" name="lblmapunits">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Map Units</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>spnSize</cstring>
</property>
</widget>
</item>
<item>
<widget class="QgsSpinBox" name="spnSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Desired length of scale bar in measuring map units</string>
</property>
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblMaxSize">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>70</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Max Width</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>spnMaxWidth</cstring>
</property>
</widget>
</item>
<item>
<widget class="QgsSpinBox" name="spnMaxWidth">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Maximum width of scale bar as percentage of map canvas (1-80%)</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>80</number>
</property>
<property name="value">
<number>50</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="4" column="0" colspan="3">
<widget class="QCheckBox" name="chkSnapping">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Automatically snap to round number on resize</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="lblLocation">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Placement</string>
</property>
<property name="buddy">
<cstring>cboPlacement</cstring>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="cboPlacement">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="lblMargin">
<property name="minimumSize">
<size>
<width>155</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Margin from edge</string>
</property>
</widget>
</item>
<item row="6" column="1" colspan="2">
<layout class="QHBoxLayout" name="hlytMargin" stretch="0,0,0,0,0,0">
<property name="spacing"> <property name="spacing">
<number>10</number> <number>10</number>
</property> </property>
@ -279,6 +445,9 @@
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
<property name="buddy">
<cstring>spnHorizontal</cstring>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -301,15 +470,15 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="toolTip">
<string>Horizontal offset on the map canvas from the placement anchor</string>
</property>
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>100</number> <number>100</number>
</property> </property>
<property name="toolTip">
<string>Horizontal offset on the map canvas from the placement anchor</string>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -329,6 +498,9 @@
<property name="text"> <property name="text">
<string>Vertical</string> <string>Vertical</string>
</property> </property>
<property name="buddy">
<cstring>spnVertical</cstring>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -351,12 +523,12 @@
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
<property name="maximum">
<number>100</number>
</property>
<property name="toolTip"> <property name="toolTip">
<string>Vertical offset on the map canvas from the placement anchor</string> <string>Vertical offset on the map canvas from the placement anchor</string>
</property> </property>
<property name="maximum">
<number>100</number>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -366,64 +538,22 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
<item row="7" column="1"> <item row="7" column="1">
<widget class="QComboBox" name="cboPlacement">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="lblMargin">
<property name="minimumSize">
<size>
<width>155</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Margin from edge</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="lblLocation">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Placement</string>
</property>
<property name="buddy">
<cstring>cboPlacement</cstring>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QCheckBox" name="chkSnapping">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Automatically snap to round number on resize</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0" colspan="2">
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -436,9 +566,58 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="5" column="2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<layoutdefault spacing="6" margin="11"/> <layoutdefault spacing="6" margin="11"/>
@ -473,6 +652,7 @@
<tabstop>pbnChangeOutlineColor</tabstop> <tabstop>pbnChangeOutlineColor</tabstop>
<tabstop>mButtonFontStyle</tabstop> <tabstop>mButtonFontStyle</tabstop>
<tabstop>spnSize</tabstop> <tabstop>spnSize</tabstop>
<tabstop>spnMaxWidth</tabstop>
<tabstop>chkSnapping</tabstop> <tabstop>chkSnapping</tabstop>
<tabstop>cboPlacement</tabstop> <tabstop>cboPlacement</tabstop>
<tabstop>spnHorizontal</tabstop> <tabstop>spnHorizontal</tabstop>