Skip to content
Permalink
Browse files

Move numeric format button for scalebars to Units group

  • Loading branch information
nyalldawson committed Jan 9, 2020
1 parent 1cd2e16 commit 4391fe73699b609737b6d73c9768b37046d3b677
Showing with 53 additions and 41 deletions.
  1. +12 −3 src/app/layout/qgslayoutscalebarwidget.cpp
  2. +41 −38 src/ui/layout/qgslayoutscalebarwidgetbase.ui
@@ -514,8 +514,12 @@ void QgsLayoutScaleBarWidget::toggleStyleSpecificControls( const QString &style
if ( style == QLatin1String( "Numeric" ) )
{
//Disable controls which don't apply to numeric scale bars
mGroupBoxUnits->setEnabled( false );
mGroupBoxUnits->setCollapsed( true );
mUnitsComboBox->setEnabled( false );
mUnitsLabel->setEnabled( false );
mMapUnitsPerBarUnitSpinBox->setEnabled( false );
mMapUnitsPerBarUnitLabel->setEnabled( false );
mUnitLabelLineEdit->setEnabled( false );
mUnitLabelLabel->setEnabled( false );
mGroupBoxSegments->setEnabled( false );
mGroupBoxSegments->setCollapsed( true );
mLabelBarSpaceSpinBox->setEnabled( false );
@@ -532,7 +536,12 @@ void QgsLayoutScaleBarWidget::toggleStyleSpecificControls( const QString &style
else
{
//Enable controls
mGroupBoxUnits->setEnabled( true );
mUnitsComboBox->setEnabled( true );
mUnitsLabel->setEnabled( true );
mMapUnitsPerBarUnitSpinBox->setEnabled( true );
mMapUnitsPerBarUnitLabel->setEnabled( true );
mUnitLabelLineEdit->setEnabled( true );
mUnitLabelLabel->setEnabled( true );
mGroupBoxSegments->setEnabled( true );
mLabelBarSpaceSpinBox->setEnabled( true );
mLineWidthSpinBox->setEnabled( true );
@@ -134,36 +134,29 @@
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0">
<item row="1" column="0">
<widget class="QLabel" name="mMapUnitsPerBarUnitLabel">
<item row="2" column="0">
<widget class="QLabel" name="mUnitLabelLabel">
<property name="text">
<string>Label unit multiplier</string>
<string>&amp;Label for units</string>
</property>
<property name="wordWrap">
<bool>false</bool>
<bool>true</bool>
</property>
<property name="buddy">
<cstring>mMapUnitsPerBarUnitSpinBox</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="mUnitsComboBox">
<property name="toolTip">
<string>Specifies the underlying units used for scalebar calculations, e.g., &quot;meters&quot; or &quot;feet&quot;</string>
<cstring>mUnitLabelLineEdit</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mUnitLabelLabel">
<item row="1" column="0">
<widget class="QLabel" name="mMapUnitsPerBarUnitLabel">
<property name="text">
<string>&amp;Label for units</string>
<string>Label unit multiplier</string>
</property>
<property name="wordWrap">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="buddy">
<cstring>mUnitLabelLineEdit</cstring>
<cstring>mMapUnitsPerBarUnitSpinBox</cstring>
</property>
</widget>
</item>
@@ -183,8 +176,15 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="mUnitsComboBox">
<property name="toolTip">
<string>Specifies the underlying units used for scalebar calculations, e.g., &quot;meters&quot; or &quot;feet&quot;</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_12">
<widget class="QLabel" name="mUnitsLabel">
<property name="text">
<string>Scalebar units</string>
</property>
@@ -197,6 +197,26 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="mUnitLabelLabel_2">
<property name="text">
<string>Number format</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>mUnitLabelLineEdit</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="mNumberFormatPushButton">
<property name="text">
<string>Customize</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -468,26 +488,6 @@
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QPushButton" name="mNumberFormatPushButton">
<property name="text">
<string>Customize</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="mUnitLabelLabel_2">
<property name="text">
<string>Number format</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>mUnitLabelLineEdit</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -748,6 +748,7 @@
<tabstop>mUnitsComboBox</tabstop>
<tabstop>mMapUnitsPerBarUnitSpinBox</tabstop>
<tabstop>mUnitLabelLineEdit</tabstop>
<tabstop>mNumberFormatPushButton</tabstop>
<tabstop>mGroupBoxSegments</tabstop>
<tabstop>mSegmentsLeftSpinBox</tabstop>
<tabstop>mNumberOfSegmentsSpinBox</tabstop>
@@ -773,6 +774,8 @@
<tabstop>mFillColor2DDBtn</tabstop>
<tabstop>mStrokeColorButton</tabstop>
<tabstop>mLineColorDDBtn</tabstop>
<tabstop>mLabelHorizontalPlacementComboBox</tabstop>
<tabstop>mLabelVerticalPlacementComboBox</tabstop>
</tabstops>
<resources/>
<connections/>

0 comments on commit 4391fe7

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