Skip to content

Commit e135e79

Browse files
authoredDec 3, 2016
Merge pull request #3827 from nirvn/color_ramp_migration
Migration of remaining color ramp widgets
2 parents 6009f5a + 0b9fbeb commit e135e79

17 files changed

+150
-617
lines changed
 

‎doc/api_break.dox

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ Removed Classes {#qgis_api_break_3_0_removed_classes}
230230
- QgsColorbutton was removed. QgsColorButtonV2 has now been renamed to QgsColorButton. Hence, QgsColorButtonV2 does not exist anymore.
231231
- QgsColorDialog was removed, and QgsColorDialogV2 was renamed to QgsColorDialog. Hence, QgsColorButtonV2 does not exist anymore.
232232
All the functionality from the old QgsColorDialog has been moved to the new class.
233+
- QgsColorRampComboBox was removed, replaced by QgsColorRampButton
233234
- QgsComposerAttributeTable and associated classes (eg QgsComposerAttributeTableCompare,
234235
QgsComposerAttributeTableColumnModel, QgsComposerTableSortColumnsProxyModel) were removed.
235236
Use QgsComposerAttributeTableV2 instead.
@@ -435,12 +436,17 @@ QgsCachedFeatureIterator {#qgis_api_break_3_0_QgsQgsCachedFeatureIterator
435436

436437
- The constructor for QgsCachedFeatureIterator has changed.
437438

439+
QgsCategorizedRenderer {#qgis_api_break_3_0_QgsCategorizedRenderer}
440+
--------------------
441+
442+
- setInvertedColorRamp() and invertedColorRamp() functions are gone, QgsColorRamp now responsible for invert
443+
- createRenderer() and updateColorRamp()'s inverted parameter is gone
438444

439445
QgsCategorizedSymbolRendererWidget {#qgis_api_break_3_0_QgsCategorizedSymbolRendererWidget}
440446
----------------------------------
441447

442448
- sizeScaleFieldChanged() and scaleMethodChanged() were removed. These settings are no longer exposed in the widget's GUI.
443-
449+
- getColorRamp() was removed.
444450

445451
QgsClipper {#qgis_api_break_3_0_QgsClipper}
446452
----------
@@ -956,12 +962,21 @@ QgsEditorWidgetRegistry {#qgis_api_break_3_0_QgsEditorWidgetRegistry}
956962
- The signature of isFieldSupported() has been changed to return an unsigned (how good it supports the given field)
957963
and to const-correct it.
958964

965+
QgsGraduatedRenderer {#qgis_api_break_3_0_QgsGraduatedRenderer}
966+
--------------------
967+
968+
- setInvertedColorRamp() and invertedColorRamp() functions are gone, QgsColorRamp now responsible for invert
969+
- createRenderer() and updateColorRamp()'s inverted parameter is gone
959970

960971
QgsGroupWMSDataDialog {#qgis_api_break_3_0_QgsGroupWMSDataDialog}
961972
---------------------
962973

963974
- QgsGroupWMSDataDialo has been renamed to QgsGroupWmsDataDialog
964975

976+
QgsHeatmapRenderer {#qgis_api_break_3_0_QgsHeatmapRenderer}
977+
------------------
978+
979+
- setInvertRamp() and invertRamp() functions are gone, QgsColorRamp now responsible for invert
965980

966981
QgsHighlight {#qgis_api_break_3_0_QgsHighlight}
967982
------------

‎python/core/symbology-ng/qgsheatmaprenderer.sip

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,6 @@ class QgsHeatmapRenderer : QgsFeatureRenderer
4040
*/
4141
void setColorRamp( QgsColorRamp* ramp /Transfer/ );
4242

43-
/** Returns whether the ramp is inverted
44-
* @returns true if color ramp is inverted
45-
* @see setInvertRamp
46-
* @see colorRamp
47-
*/
48-
bool invertRamp() const;
49-
50-
/** Sets whether the ramp is inverted
51-
* @param invert set to true to invert color ramp
52-
* @see invertRamp
53-
* @see setColorRamp
54-
*/
55-
void setInvertRamp( const bool invert );
56-
5743
/** Returns the radius for the heatmap
5844
* @returns heatmap radius
5945
* @see setRadius

‎python/gui/gui.sip

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@
224224
%Include symbology-ng/qgsarrowsymbollayerwidget.sip
225225
%Include symbology-ng/qgsbrushstylecombobox.sip
226226
%Include symbology-ng/qgscategorizedsymbolrendererwidget.sip
227-
%Include symbology-ng/qgscolorrampcombobox.sip
228227
%Include symbology-ng/qgscptcitycolorrampdialog.sip
229228
%Include symbology-ng/qgsdashspacedialog.sip
230229
%Include symbology-ng/qgsellipsesymbollayerwidget.sip

‎python/gui/symbology-ng/qgscolorrampcombobox.sip

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎src/core/symbology-ng/qgsheatmaprenderer.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ QgsHeatmapRenderer::QgsHeatmapRenderer()
4040
, mRadiusUnit( QgsUnitTypes::RenderMillimeters )
4141
, mWeightAttrNum( -1 )
4242
, mGradientRamp( nullptr )
43-
, mInvertRamp( false )
4443
, mExplicitMax( 0.0 )
4544
, mRenderQuality( 3 )
4645
, mFeaturesRendered( 0 )
@@ -255,7 +254,7 @@ void QgsHeatmapRenderer::renderImage( QgsRenderContext& context )
255254
pixVal = mValues.at( idx ) > 0 ? qMin(( mValues.at( idx ) / scaleMax ), 1.0 ) : 0;
256255

257256
//convert value to color from ramp
258-
pixColor = mGradientRamp->color( mInvertRamp ? 1 - pixVal : pixVal );
257+
pixColor = mGradientRamp->color( pixVal );
259258

260259
scanLine[widthIndex] = pixColor.rgba();
261260
idx++;
@@ -286,7 +285,6 @@ QgsHeatmapRenderer* QgsHeatmapRenderer::clone() const
286285
{
287286
newRenderer->setColorRamp( mGradientRamp->clone() );
288287
}
289-
newRenderer->setInvertRamp( mInvertRamp );
290288
newRenderer->setRadius( mRadius );
291289
newRenderer->setRadiusUnit( mRadiusUnit );
292290
newRenderer->setRadiusMapUnitScale( mRadiusMapUnitScale );
@@ -337,7 +335,6 @@ QgsFeatureRenderer* QgsHeatmapRenderer::create( QDomElement& element )
337335
{
338336
r->setColorRamp( QgsSymbolLayerUtils::loadColorRamp( sourceColorRampElem ) );
339337
}
340-
r->setInvertRamp( element.attribute( QStringLiteral( "invert_ramp" ), QStringLiteral( "0" ) ).toInt() );
341338
return r;
342339
}
343340

@@ -356,7 +353,6 @@ QDomElement QgsHeatmapRenderer::save( QDomDocument& doc )
356353
QDomElement colorRampElem = QgsSymbolLayerUtils::saveColorRamp( QStringLiteral( "[source]" ), mGradientRamp, doc );
357354
rendererElem.appendChild( colorRampElem );
358355
}
359-
rendererElem.setAttribute( QStringLiteral( "invert_ramp" ), QString::number( mInvertRamp ) );
360356
rendererElem.setAttribute( QStringLiteral( "forceraster" ), ( mForceRaster ? "1" : "0" ) );
361357

362358
if ( mPaintEffect && !QgsPaintEffectRegistry::isDefaultStack( mPaintEffect ) )

‎src/core/symbology-ng/qgsheatmaprenderer.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,20 +69,6 @@ class CORE_EXPORT QgsHeatmapRenderer : public QgsFeatureRenderer
6969
*/
7070
void setColorRamp( QgsColorRamp* ramp );
7171

72-
/** Returns whether the ramp is inverted
73-
* @returns true if color ramp is inverted
74-
* @see setInvertRamp
75-
* @see colorRamp
76-
*/
77-
bool invertRamp() const { return mInvertRamp; }
78-
79-
/** Sets whether the ramp is inverted
80-
* @param invert set to true to invert color ramp
81-
* @see invertRamp
82-
* @see setColorRamp
83-
*/
84-
void setInvertRamp( const bool invert ) { mInvertRamp = invert; }
85-
8672
/** Returns the radius for the heatmap
8773
* @returns heatmap radius
8874
* @see setRadius
@@ -192,7 +178,6 @@ class CORE_EXPORT QgsHeatmapRenderer : public QgsFeatureRenderer
192178
QScopedPointer<QgsExpression> mWeightExpression;
193179

194180
QgsColorRamp* mGradientRamp;
195-
bool mInvertRamp;
196181

197182
double mExplicitMax;
198183
int mRenderQuality;

‎src/gui/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ SET(QGIS_GUI_SRCS
1616
symbology-ng/qgsarrowsymbollayerwidget.cpp
1717
symbology-ng/qgsbrushstylecombobox.cpp
1818
symbology-ng/qgscategorizedsymbolrendererwidget.cpp
19-
symbology-ng/qgscolorrampcombobox.cpp
2019
symbology-ng/qgscptcitycolorrampdialog.cpp
2120
symbology-ng/qgsdashspacedialog.cpp
2221
symbology-ng/qgsellipsesymbollayerwidget.cpp
@@ -490,7 +489,6 @@ SET(QGIS_GUI_MOC_HDRS
490489
symbology-ng/qgsarrowsymbollayerwidget.h
491490
symbology-ng/qgsbrushstylecombobox.h
492491
symbology-ng/qgscategorizedsymbolrendererwidget.h
493-
symbology-ng/qgscolorrampcombobox.h
494492
symbology-ng/qgscptcitycolorrampdialog.h
495493
symbology-ng/qgsdashspacedialog.h
496494
symbology-ng/qgsellipsesymbollayerwidget.h

‎src/gui/effects/qgspainteffectwidget.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgscoloreffect.h"
2525
#include "qgsstyle.h"
2626
#include "qgscolorramp.h"
27+
#include "qgscolorrampbutton.h"
2728

2829
//
2930
// draw source
@@ -421,15 +422,12 @@ QgsGlowWidget::QgsGlowWidget( QWidget *parent )
421422

422423
mSpreadUnitWidget->setUnits( QgsUnitTypes::RenderUnitList() << QgsUnitTypes::RenderMillimeters << QgsUnitTypes::RenderPixels << QgsUnitTypes::RenderMapUnits );
423424

424-
mRampComboBox->populate( QgsStyle::defaultStyle() );
425-
mRampComboBox->setShowGradientOnly( true );
426-
connect( mRampComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( applyColorRamp() ) );
427-
connect( mRampComboBox, SIGNAL( sourceRampEdited() ), this, SLOT( applyColorRamp() ) );
428-
connect( mButtonEditRamp, SIGNAL( clicked() ), mRampComboBox, SLOT( editSourceRamp() ) );
429-
430-
connect( radioSingleColor, SIGNAL( toggled( bool ) ), this, SLOT( colorModeChanged() ) );
425+
btnColorRamp->setShowGradientOnly( true );
431426

432427
initGui();
428+
429+
connect( btnColorRamp, &QgsColorRampButton::colorRampChanged, this, &QgsGlowWidget::applyColorRamp );
430+
connect( radioSingleColor, SIGNAL( toggled( bool ) ), this, SLOT( colorModeChanged() ) );
433431
}
434432

435433
void QgsGlowWidget::setPaintEffect( QgsPaintEffect *effect )
@@ -461,14 +459,13 @@ void QgsGlowWidget::initGui()
461459

462460
if ( mEffect->ramp() )
463461
{
464-
mRampComboBox->setSourceColorRamp( mEffect->ramp() );
462+
btnColorRamp->setColorRamp( mEffect->ramp() );
465463
}
466464

467465
radioSingleColor->setChecked( mEffect->colorType() == QgsGlowEffect::SingleColor );
468466
mColorBtn->setEnabled( mEffect->colorType() == QgsGlowEffect::SingleColor );
469467
radioColorRamp->setChecked( mEffect->colorType() == QgsGlowEffect::ColorRamp );
470-
mRampComboBox->setEnabled( mEffect->colorType() == QgsGlowEffect::ColorRamp );
471-
mButtonEditRamp->setEnabled( mEffect->colorType() == QgsGlowEffect::ColorRamp );
468+
btnColorRamp->setEnabled( mEffect->colorType() == QgsGlowEffect::ColorRamp );
472469
mDrawModeComboBox->setDrawMode( mEffect->drawMode() );
473470

474471
blockSignals( false );
@@ -483,7 +480,7 @@ void QgsGlowWidget::blockSignals( const bool block )
483480
mTranspSlider->blockSignals( block );
484481
mColorBtn->blockSignals( block );
485482
mBlendCmbBx->blockSignals( block );
486-
mRampComboBox->blockSignals( block );
483+
btnColorRamp->blockSignals( block );
487484
radioSingleColor->blockSignals( block );
488485
radioColorRamp->blockSignals( block );
489486
mDrawModeComboBox->blockSignals( block );
@@ -503,7 +500,7 @@ void QgsGlowWidget::colorModeChanged()
503500
else
504501
{
505502
mEffect->setColorType( QgsGlowEffect::ColorRamp );
506-
mEffect->setRamp( mRampComboBox->currentColorRamp() );
503+
mEffect->setRamp( btnColorRamp->colorRamp() );
507504
}
508505
emit changed();
509506
}
@@ -594,7 +591,7 @@ void QgsGlowWidget::applyColorRamp()
594591
return;
595592
}
596593

597-
QgsColorRamp* ramp = mRampComboBox->currentColorRamp();
594+
QgsColorRamp* ramp = btnColorRamp->colorRamp();
598595
if ( !ramp )
599596
return;
600597

‎src/gui/symbology-ng/qgscolorrampcombobox.cpp

Lines changed: 0 additions & 258 deletions
This file was deleted.

‎src/gui/symbology-ng/qgscolorrampcombobox.h

Lines changed: 0 additions & 95 deletions
This file was deleted.

‎src/gui/symbology-ng/qgsheatmaprendererwidget.cpp

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "qgslogger.h"
2222
#include "qgsvectorlayer.h"
2323
#include "qgscolorramp.h"
24+
#include "qgscolorrampbutton.h"
2425
#include "qgsstyle.h"
2526
#include "qgsproject.h"
2627
#include "qgsmapcanvas.h"
@@ -95,17 +96,15 @@ QgsHeatmapRendererWidget::QgsHeatmapRendererWidget( QgsVectorLayer* layer, QgsSt
9596
mRenderer = new QgsHeatmapRenderer();
9697
}
9798

98-
mRampComboBox->setShowGradientOnly( true );
99-
mRampComboBox->populate( QgsStyle::defaultStyle() );
100-
connect( mRampComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( applyColorRamp() ) );
101-
connect( mRampComboBox, SIGNAL( sourceRampEdited() ), this, SLOT( applyColorRamp() ) );
102-
connect( mButtonEditRamp, SIGNAL( clicked() ), mRampComboBox, SLOT( editSourceRamp() ) );
99+
btnColorRamp->setShowGradientOnly( true );
100+
101+
connect( btnColorRamp, &QgsColorRampButton::colorRampChanged, this, &QgsHeatmapRendererWidget::applyColorRamp );
103102

104103
if ( mRenderer->colorRamp() )
105104
{
106-
mRampComboBox->blockSignals( true );
107-
mRampComboBox->setSourceColorRamp( mRenderer->colorRamp() );
108-
mRampComboBox->blockSignals( false );
105+
btnColorRamp->blockSignals( true );
106+
btnColorRamp->setColorRamp( mRenderer->colorRamp() );
107+
btnColorRamp->blockSignals( false );
109108
}
110109
mRadiusSpinBox->blockSignals( true );
111110
mRadiusSpinBox->setValue( mRenderer->radius() );
@@ -120,9 +119,6 @@ QgsHeatmapRendererWidget::QgsHeatmapRendererWidget( QgsVectorLayer* layer, QgsSt
120119
mQualitySlider->blockSignals( true );
121120
mQualitySlider->setValue( mRenderer->renderQuality() );
122121
mQualitySlider->blockSignals( false );
123-
mInvertCheckBox->blockSignals( true );
124-
mInvertCheckBox->setChecked( mRenderer->invertRamp() );
125-
mInvertCheckBox->blockSignals( false );
126122

127123
mWeightExpressionWidget->setLayer( layer );
128124
mWeightExpressionWidget->setField( mRenderer->weightExpression() );
@@ -148,7 +144,7 @@ void QgsHeatmapRendererWidget::applyColorRamp()
148144
return;
149145
}
150146

151-
QgsColorRamp* ramp = mRampComboBox->currentColorRamp();
147+
QgsColorRamp* ramp = btnColorRamp->colorRamp();
152148
if ( !ramp )
153149
return;
154150

@@ -201,17 +197,6 @@ void QgsHeatmapRendererWidget::on_mQualitySlider_valueChanged( int v )
201197
emit widgetChanged();
202198
}
203199

204-
void QgsHeatmapRendererWidget::on_mInvertCheckBox_toggled( bool v )
205-
{
206-
if ( !mRenderer )
207-
{
208-
return;
209-
}
210-
211-
mRenderer->setInvertRamp( v );
212-
emit widgetChanged();
213-
}
214-
215200
void QgsHeatmapRendererWidget::weightExpressionChanged( const QString& expression )
216201
{
217202
mRenderer->setWeightExpression( expression );

‎src/gui/symbology-ng/qgsheatmaprendererwidget.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ class GUI_EXPORT QgsHeatmapRendererWidget : public QgsRendererWidget, private Ui
6161
void on_mRadiusSpinBox_valueChanged( double d );
6262
void on_mMaxSpinBox_valueChanged( double d );
6363
void on_mQualitySlider_valueChanged( int v );
64-
void on_mInvertCheckBox_toggled( bool v );
6564
void weightExpressionChanged( const QString& expression );
6665

6766
};

‎src/gui/symbology-ng/qgssymbollayerwidget.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "qgssvgcache.h"
2929
#include "qgssymbollayerutils.h"
3030
#include "qgscolorramp.h"
31+
#include "qgscolorrampbutton.h"
3132
#include "qgsgradientcolorrampdialog.h"
3233
#include "qgsdatadefined.h"
3334
#include "qgsstyle.h" //for symbol selector dialog
@@ -1360,11 +1361,9 @@ QgsShapeburstFillSymbolLayerWidget::QgsShapeburstFillSymbolLayerWidget( const Qg
13601361
spinOffsetX->setClearValue( 0.0 );
13611362
spinOffsetY->setClearValue( 0.0 );
13621363

1363-
cboGradientColorRamp->populate( QgsStyle::defaultStyle() );
1364+
btnColorRamp->setShowGradientOnly( true );
13641365

1365-
connect( cboGradientColorRamp, SIGNAL( currentIndexChanged( int ) ), this, SLOT( applyColorRamp() ) );
1366-
connect( cboGradientColorRamp, SIGNAL( sourceRampEdited() ), this, SLOT( applyColorRamp() ) );
1367-
connect( mButtonEditRamp, SIGNAL( clicked() ), cboGradientColorRamp, SLOT( editSourceRamp() ) );
1366+
connect( btnColorRamp, &QgsColorRampButton::colorRampChanged, this, &QgsShapeburstFillSymbolLayerWidget::applyColorRamp );
13681367

13691368
connect( btnChangeColor, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColor( const QColor& ) ) );
13701369
connect( btnChangeColor2, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColor2( const QColor& ) ) );
@@ -1395,7 +1394,7 @@ void QgsShapeburstFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayer* layer )
13951394
if ( mLayer->colorType() == QgsShapeburstFillSymbolLayer::SimpleTwoColor )
13961395
{
13971396
radioTwoColor->setChecked( true );
1398-
cboGradientColorRamp->setEnabled( false );
1397+
btnColorRamp->setEnabled( false );
13991398
}
14001399
else
14011400
{
@@ -1444,9 +1443,9 @@ void QgsShapeburstFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayer* layer )
14441443
// set source color ramp
14451444
if ( mLayer->colorRamp() )
14461445
{
1447-
cboGradientColorRamp->blockSignals( true );
1448-
cboGradientColorRamp->setSourceColorRamp( mLayer->colorRamp() );
1449-
cboGradientColorRamp->blockSignals( false );
1446+
btnColorRamp->blockSignals( true );
1447+
btnColorRamp->setColorRamp( mLayer->colorRamp() );
1448+
btnColorRamp->blockSignals( false );
14501449
}
14511450

14521451
spinOffsetX->blockSignals( true );
@@ -1549,7 +1548,7 @@ void QgsShapeburstFillSymbolLayerWidget::on_mRadioUseWholeShape_toggled( bool va
15491548

15501549
void QgsShapeburstFillSymbolLayerWidget::applyColorRamp()
15511550
{
1552-
QgsColorRamp* ramp = cboGradientColorRamp->currentColorRamp();
1551+
QgsColorRamp* ramp = btnColorRamp->colorRamp();
15531552
if ( !ramp )
15541553
return;
15551554

‎src/ui/effects/widget_glow.ui

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,26 @@
135135
</widget>
136136
</item>
137137
<item row="4" column="1" colspan="2">
138-
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
139-
<item>
140-
<widget class="QgsColorRampComboBox" name="mRampComboBox"/>
141-
</item>
142-
<item>
143-
<widget class="QPushButton" name="mButtonEditRamp">
144-
<property name="maximumSize">
145-
<size>
146-
<width>100</width>
147-
<height>16777215</height>
148-
</size>
149-
</property>
150-
<property name="text">
151-
<string>Edit</string>
152-
</property>
153-
</widget>
154-
</item>
155-
</layout>
138+
<widget class="QgsColorRampButton" name="btnColorRamp">
139+
<property name="sizePolicy">
140+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
141+
<horstretch>0</horstretch>
142+
<verstretch>0</verstretch>
143+
</sizepolicy>
144+
</property>
145+
<property name="minimumSize">
146+
<size>
147+
<width>120</width>
148+
<height>0</height>
149+
</size>
150+
</property>
151+
<property name="maximumSize">
152+
<size>
153+
<width>16777215</width>
154+
<height>16777215</height>
155+
</size>
156+
</property>
157+
</widget>
156158
</item>
157159
<item row="5" column="1" colspan="2">
158160
<widget class="QgsBlendModeComboBox" name="mBlendCmbBx"/>
@@ -275,9 +277,10 @@
275277
<container>1</container>
276278
</customwidget>
277279
<customwidget>
278-
<class>QgsColorRampComboBox</class>
279-
<extends>QComboBox</extends>
280-
<header>qgscolorrampcombobox.h</header>
280+
<class>QgsColorRampButton</class>
281+
<extends>QToolButton</extends>
282+
<header>qgscolorrampbutton.h</header>
283+
<container>1</container>
281284
</customwidget>
282285
</customwidgets>
283286
<tabstops>
@@ -289,8 +292,7 @@
289292
<tabstop>radioSingleColor</tabstop>
290293
<tabstop>mColorBtn</tabstop>
291294
<tabstop>radioColorRamp</tabstop>
292-
<tabstop>mRampComboBox</tabstop>
293-
<tabstop>mButtonEditRamp</tabstop>
295+
<tabstop>btnColorRamp</tabstop>
294296
<tabstop>mBlendCmbBx</tabstop>
295297
<tabstop>mDrawModeComboBox</tabstop>
296298
</tabstops>
@@ -315,7 +317,7 @@
315317
<connection>
316318
<sender>radioColorRamp</sender>
317319
<signal>toggled(bool)</signal>
318-
<receiver>mRampComboBox</receiver>
320+
<receiver>btnColorRamp</receiver>
319321
<slot>setEnabled(bool)</slot>
320322
<hints>
321323
<hint type="sourcelabel">
@@ -328,21 +330,5 @@
328330
</hint>
329331
</hints>
330332
</connection>
331-
<connection>
332-
<sender>radioColorRamp</sender>
333-
<signal>toggled(bool)</signal>
334-
<receiver>mButtonEditRamp</receiver>
335-
<slot>setEnabled(bool)</slot>
336-
<hints>
337-
<hint type="sourcelabel">
338-
<x>64</x>
339-
<y>156</y>
340-
</hint>
341-
<hint type="destinationlabel">
342-
<x>423</x>
343-
<y>157</y>
344-
</hint>
345-
</hints>
346-
</connection>
347333
</connections>
348334
</ui>

‎src/ui/symbollayer/qgsheatmaprendererwidgetbase.ui

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -112,32 +112,34 @@
112112
</item>
113113
</layout>
114114
</item>
115-
<item row="0" column="0" colspan="3">
116-
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0,0">
117-
<item>
118-
<widget class="QgsColorRampComboBox" name="mRampComboBox"/>
119-
</item>
120-
<item>
121-
<widget class="QPushButton" name="mButtonEditRamp">
122-
<property name="maximumSize">
123-
<size>
124-
<width>100</width>
125-
<height>16777215</height>
126-
</size>
127-
</property>
128-
<property name="text">
129-
<string>Edit</string>
130-
</property>
131-
</widget>
132-
</item>
133-
<item>
134-
<widget class="QCheckBox" name="mInvertCheckBox">
135-
<property name="text">
136-
<string>Invert</string>
137-
</property>
138-
</widget>
139-
</item>
140-
</layout>
115+
<item row="0" column="0">
116+
<widget class="QLabel" name="label_7">
117+
<property name="text">
118+
<string>Color ramp</string>
119+
</property>
120+
</widget>
121+
</item>
122+
<item row="0" column="1" colspan="2">
123+
<widget class="QgsColorRampButton" name="btnColorRamp">
124+
<property name="sizePolicy">
125+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
126+
<horstretch>0</horstretch>
127+
<verstretch>0</verstretch>
128+
</sizepolicy>
129+
</property>
130+
<property name="minimumSize">
131+
<size>
132+
<width>120</width>
133+
<height>0</height>
134+
</size>
135+
</property>
136+
<property name="maximumSize">
137+
<size>
138+
<width>16777215</width>
139+
<height>16777215</height>
140+
</size>
141+
</property>
142+
</widget>
141143
</item>
142144
<item row="2" column="0">
143145
<widget class="QLabel" name="label">
@@ -219,15 +221,14 @@
219221
<container>1</container>
220222
</customwidget>
221223
<customwidget>
222-
<class>QgsColorRampComboBox</class>
223-
<extends>QComboBox</extends>
224-
<header>qgscolorrampcombobox.h</header>
224+
<class>QgsColorRampButton</class>
225+
<extends>QToolButton</extends>
226+
<header>qgscolorrampbutton.h</header>
227+
<container>1</container>
225228
</customwidget>
226229
</customwidgets>
227230
<tabstops>
228-
<tabstop>mRampComboBox</tabstop>
229-
<tabstop>mButtonEditRamp</tabstop>
230-
<tabstop>mInvertCheckBox</tabstop>
231+
<tabstop>btnColorRamp</tabstop>
231232
<tabstop>mRadiusSpinBox</tabstop>
232233
<tabstop>mMaxSpinBox</tabstop>
233234
<tabstop>mWeightExpressionWidget</tabstop>

‎src/ui/symbollayer/widget_gradientfill.ui

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -150,30 +150,26 @@
150150
</widget>
151151
</item>
152152
<item row="2" column="1">
153-
<layout class="QHBoxLayout" name="horizontalLayout_8">
154-
<item>
155-
<widget class="QgsColorRampButton" name="btnColorRamp">
156-
<property name="sizePolicy">
157-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
158-
<horstretch>0</horstretch>
159-
<verstretch>0</verstretch>
160-
</sizepolicy>
161-
</property>
162-
<property name="minimumSize">
163-
<size>
164-
<width>120</width>
165-
<height>0</height>
166-
</size>
167-
</property>
168-
<property name="maximumSize">
169-
<size>
170-
<width>16777215</width>
171-
<height>16777215</height>
172-
</size>
173-
</property>
174-
</widget>
175-
</item>
176-
</layout>
153+
<widget class="QgsColorRampButton" name="btnColorRamp">
154+
<property name="sizePolicy">
155+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
156+
<horstretch>0</horstretch>
157+
<verstretch>0</verstretch>
158+
</sizepolicy>
159+
</property>
160+
<property name="minimumSize">
161+
<size>
162+
<width>120</width>
163+
<height>0</height>
164+
</size>
165+
</property>
166+
<property name="maximumSize">
167+
<size>
168+
<width>16777215</width>
169+
<height>16777215</height>
170+
</size>
171+
</property>
172+
</widget>
177173
</item>
178174
<item row="8" column="2" rowspan="2">
179175
<widget class="QgsDataDefinedButton" name="mRefPoint1YDDBtn">

‎src/ui/symbollayer/widget_shapeburstfill.ui

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,26 @@
2929
</widget>
3030
</item>
3131
<item row="3" column="1" colspan="3">
32-
<layout class="QHBoxLayout" name="horizontalLayout_8">
33-
<item>
34-
<widget class="QgsColorRampComboBox" name="cboGradientColorRamp"/>
35-
</item>
36-
<item>
37-
<widget class="QPushButton" name="mButtonEditRamp">
38-
<property name="maximumSize">
39-
<size>
40-
<width>100</width>
41-
<height>16777215</height>
42-
</size>
43-
</property>
44-
<property name="text">
45-
<string>Edit</string>
46-
</property>
47-
</widget>
48-
</item>
49-
</layout>
32+
<widget class="QgsColorRampButton" name="btnColorRamp">
33+
<property name="sizePolicy">
34+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
35+
<horstretch>0</horstretch>
36+
<verstretch>0</verstretch>
37+
</sizepolicy>
38+
</property>
39+
<property name="minimumSize">
40+
<size>
41+
<width>120</width>
42+
<height>0</height>
43+
</size>
44+
</property>
45+
<property name="maximumSize">
46+
<size>
47+
<width>16777215</width>
48+
<height>16777215</height>
49+
</size>
50+
</property>
51+
</widget>
5052
</item>
5153
<item row="5" column="4">
5254
<widget class="QgsDataDefinedButton" name="mShadeWholeShapeDDBtn">
@@ -126,7 +128,7 @@
126128
<item>
127129
<widget class="QRadioButton" name="mRadioUseMaxDistance">
128130
<property name="text">
129-
<string>Shade to a set distance</string>
131+
<string>Set distance</string>
130132
</property>
131133
</widget>
132134
</item>
@@ -339,7 +341,7 @@
339341
<item>
340342
<widget class="QRadioButton" name="mRadioUseWholeShape">
341343
<property name="text">
342-
<string>Shade whole shape</string>
344+
<string>Whole shape</string>
343345
</property>
344346
</widget>
345347
</item>
@@ -424,16 +426,16 @@
424426
<container>1</container>
425427
</customwidget>
426428
<customwidget>
427-
<class>QgsColorRampComboBox</class>
428-
<extends>QComboBox</extends>
429-
<header>qgscolorrampcombobox.h</header>
429+
<class>QgsColorRampButton</class>
430+
<extends>QToolButton</extends>
431+
<header>qgscolorrampbutton.h</header>
432+
<container>1</container>
430433
</customwidget>
431434
</customwidgets>
432435
<tabstops>
433436
<tabstop>radioTwoColor</tabstop>
434437
<tabstop>radioColorRamp</tabstop>
435-
<tabstop>cboGradientColorRamp</tabstop>
436-
<tabstop>mButtonEditRamp</tabstop>
438+
<tabstop>btnColorRamp</tabstop>
437439
<tabstop>mRadioUseWholeShape</tabstop>
438440
<tabstop>mRadioUseMaxDistance</tabstop>
439441
<tabstop>mSpinMaxDistance</tabstop>
@@ -479,7 +481,7 @@
479481
<connection>
480482
<sender>radioColorRamp</sender>
481483
<signal>toggled(bool)</signal>
482-
<receiver>cboGradientColorRamp</receiver>
484+
<receiver>btnColorRamp</receiver>
483485
<slot>setEnabled(bool)</slot>
484486
<hints>
485487
<hint type="sourcelabel">

0 commit comments

Comments
 (0)
Please sign in to comment.