diff --git a/images/images.qrc b/images/images.qrc index 7b2da028e7c..4594f19cc93 100644 --- a/images/images.qrc +++ b/images/images.qrc @@ -279,6 +279,7 @@ themes/default/symbologyUp.png themes/default/tracking.png themes/default/transformed.png + themes/default/transp-background_8x8.png themes/default/user.png themes/default/mActionAddHtml.png themes/gis/mActionAddArrow.png diff --git a/images/themes/default/transp-background_8x8.png b/images/themes/default/transp-background_8x8.png new file mode 100644 index 00000000000..1ed871d603b Binary files /dev/null and b/images/themes/default/transp-background_8x8.png differ diff --git a/python/gui/gui.sip b/python/gui/gui.sip index 1bc8567c441..3fb1926ff01 100644 --- a/python/gui/gui.sip +++ b/python/gui/gui.sip @@ -12,6 +12,7 @@ %Include qgsattributeeditor.sip %Include qgscollapsiblegroupbox.sip %Include qgscolorbutton.sip +%Include qgscolordialog.sip %Include qgscomposerview.sip %Include qgscredentialdialog.sip %Include qgsdetaileditemdata.sip diff --git a/python/gui/qgscolorbutton.sip b/python/gui/qgscolorbutton.sip index 767f1dc0f16..174c7062e10 100644 --- a/python/gui/qgscolorbutton.sip +++ b/python/gui/qgscolorbutton.sip @@ -1,6 +1,12 @@ +/** \ingroup gui + * \class QgsColorButton + * A cross platform button subclass for selecting colors. Will open a color chooser dialog when clicked. + * Offers live updates to button from color chooser dialog + * @note inherited base class moved from QToolButton to QPushButton in QGIS 1.9 + */ -class QgsColorButton : QToolButton +class QgsColorButton: QPushButton { %TypeHeaderCode #include @@ -15,7 +21,7 @@ class QgsColorButton : QToolButton * @param cdo Options for the color chooser dialog * @note changed in 1.9 */ - QgsColorButton( QWidget *parent = 0, QString cdt = "Select Color", QColorDialog::ColorDialogOptions cdo = 0 ); + QgsColorButton( QWidget *parent = 0, QString cdt = "", QColorDialog::ColorDialogOptions cdo = 0 ); ~QgsColorButton(); /** @@ -65,11 +71,20 @@ class QgsColorButton : QToolButton */ QString colorDialogTitle(); - protected: - void paintEvent( QPaintEvent *e ); + /** + * Whether the button accepts live updates from QColorDialog. + * + * @note added in 1.9 + */ + bool acceptLiveUpdates(); - public slots: - void onButtonClicked(); + /** + * Sets whether the button accepts live updates from QColorDialog. + * Live updates may cause changes that are not undoable on QColorDialog cancel. + * + * @note added in 1.9 + */ + void setAcceptLiveUpdates( bool accept ); signals: /** @@ -80,19 +95,9 @@ class QgsColorButton : QToolButton * @note added in 1.9 */ void colorChanged( const QColor &color ); -}; - - -class QgsColorButtonV2 : QPushButton -{ -%TypeHeaderCode -#include -%End - - public: - QgsColorButtonV2( QWidget* parent = 0 ); - QgsColorButtonV2( QString text, QWidget* parent = 0 ); - - void setColor( const QColor &color ); - QColor color() const; + + protected: + void changeEvent( QEvent* e ); + void paintEvent( QPaintEvent* e ); + static const QPixmap& transpBkgrd(); }; diff --git a/python/gui/qgscolordialog.sip b/python/gui/qgscolordialog.sip new file mode 100644 index 00000000000..7e5c324ed4e --- /dev/null +++ b/python/gui/qgscolordialog.sip @@ -0,0 +1,29 @@ + +/** \ingroup gui + * \class QgsColorDialog + * A dialog for selecting a color + */ + +class QgsColorDialog : QObject +{ +%TypeHeaderCode +#include +%End + public: + QgsColorDialog(); + ~QgsColorDialog(); + + /** Return a color selection from a QColorDialog, with live updating of interim selections. + * @param initialColor The initial color of the selection dialog. + * @param updateObject The receiver object of the live updating. + * @param updateSlot The receiver object's slot for live updating (e.g. "setColor( const QColor& )" ). + * @param parent Parent widget. Usually 0 is best for native system color dialogs. + * @param title The title of the QColorDialog. + * @param options ColorDialogOptions passed to QColorDialog. + * @return Selected color on accepted() or initialColor on rejected(). + */ + static QColor getLiveColor( const QColor& initialColor, QObject* updateObject, const char* updateSlot, + QWidget* parent = 0, + const QString& title = "", + QColorDialog::ColorDialogOptions options = 0 ); +}; diff --git a/python/gui/symbology-ng/qgsrulebasedrendererv2widget.sip b/python/gui/symbology-ng/qgsrulebasedrendererv2widget.sip index 9767ddc9788..0067bff4575 100644 --- a/python/gui/symbology-ng/qgsrulebasedrendererv2widget.sip +++ b/python/gui/symbology-ng/qgsrulebasedrendererv2widget.sip @@ -96,7 +96,7 @@ class QgsRendererRulePropsDialog : QDialog %End public: - QgsRendererRulePropsDialog( QgsRuleBasedRendererV2::Rule* rule, QgsVectorLayer* layer, QgsStyleV2* style ); + QgsRendererRulePropsDialog( QgsRuleBasedRendererV2::Rule* rule, QgsVectorLayer* layer, QgsStyleV2* style, QWidget* parent = 0 ); ~QgsRendererRulePropsDialog(); QgsRuleBasedRendererV2::Rule* rule(); diff --git a/python/gui/symbology-ng/qgssymbollayerv2widget.sip b/python/gui/symbology-ng/qgssymbollayerv2widget.sip index 867d88f5d81..7379b4e1fb0 100644 --- a/python/gui/symbology-ng/qgssymbollayerv2widget.sip +++ b/python/gui/symbology-ng/qgssymbollayerv2widget.sip @@ -34,7 +34,7 @@ class QgsSimpleLineSymbolLayerV2Widget : QgsSymbolLayerV2Widget public slots: void penWidthChanged(); - void colorChanged(); + void colorChanged( const QColor& color ); void penStyleChanged(); void offsetChanged(); void on_mCustomCheckBox_stateChanged( int state ); @@ -65,8 +65,8 @@ class QgsSimpleMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget public slots: void setName(); - void setColorBorder(); - void setColorFill(); + void setColorBorder( const QColor& color ); + void setColorFill( const QColor& color ); void setSize(); void setAngle(); void setOffset(); @@ -90,8 +90,8 @@ class QgsSimpleFillSymbolLayerV2Widget : QgsSymbolLayerV2Widget virtual QgsSymbolLayerV2* symbolLayer(); public slots: - void setColor(); - void setBorderColor(); + void setColor( const QColor& color ); + void setBorderColor( const QColor& color ); void setBrushStyle(); void borderWidthChanged(); void borderStyleChanged(); @@ -150,8 +150,8 @@ class QgsSvgMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget void setOffset(); void on_mFileToolButton_clicked(); void on_mFileLineEdit_textEdited( const QString& text ); - void on_mChangeColorButton_clicked(); - void on_mChangeBorderColorButton_clicked(); + void on_mChangeColorButton_colorChanged( const QColor& color ); + void on_mChangeBorderColorButton_colorChanged( const QColor& color ); void on_mBorderWidthSpinBox_valueChanged( double d ); protected: @@ -180,7 +180,7 @@ class QgsLineDecorationSymbolLayerV2Widget : QgsSymbolLayerV2Widget virtual QgsSymbolLayerV2* symbolLayer(); public slots: - void colorChanged(); + void colorChanged( const QColor& color ); void penWidthChanged(); }; @@ -252,7 +252,7 @@ class QgsFontMarkerSymbolLayerV2Widget : QgsSymbolLayerV2Widget public slots: void setFontFamily( const QFont& font ); - void setColor(); + void setColor( const QColor& color ); void setSize( double size ); void setAngle( double angle ); void setCharacter( const QChar& chr ); diff --git a/python/gui/symbology-ng/qgssymbolslistwidget.sip b/python/gui/symbology-ng/qgssymbolslistwidget.sip index f5ffd01064a..c86dc2d8a00 100644 --- a/python/gui/symbology-ng/qgssymbolslistwidget.sip +++ b/python/gui/symbology-ng/qgssymbolslistwidget.sip @@ -8,7 +8,7 @@ class QgsSymbolsListWidget : QWidget public slots: void setSymbolFromStyle( const QModelIndex & index ); - void setSymbolColor(); + void setSymbolColor( const QColor& color ); void setMarkerAngle( double angle ); void setMarkerSize( double size ); void setLineWidth( double width ); diff --git a/python/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.sip b/python/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.sip index 29dad3f2b8d..fffee2eb01a 100644 --- a/python/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.sip +++ b/python/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.sip @@ -8,8 +8,8 @@ class QgsVectorGradientColorRampV2Dialog : QDialog QgsVectorGradientColorRampV2Dialog( QgsVectorGradientColorRampV2* ramp, QWidget* parent = NULL ); public slots: - void setColor1(); - void setColor2(); + void setColor1( const QColor& color ); + void setColor2( const QColor& color ); void toggledStops( bool on ); void addStop(); diff --git a/src/app/composer/qgscomposerarrowwidget.cpp b/src/app/composer/qgscomposerarrowwidget.cpp index aca4c33c52a..89bbd84bcdc 100644 --- a/src/app/composer/qgscomposerarrowwidget.cpp +++ b/src/app/composer/qgscomposerarrowwidget.cpp @@ -77,25 +77,17 @@ void QgsComposerArrowWidget::on_mArrowHeadWidthSpinBox_valueChanged( double d ) mArrow->endCommand(); } -void QgsComposerArrowWidget::on_mArrowColorButton_clicked() +void QgsComposerArrowWidget::on_mArrowColorButton_colorChanged( const QColor& newColor ) { if ( !mArrow ) { return; } -#if QT_VERSION >= 0x040500 - QColor newColor = QColorDialog::getColor( mArrow->arrowColor(), 0, tr( "Arrow color" ), QColorDialog::ShowAlphaChannel ); -#else - QColor newColor = QColorDialog::getColor( mArrow->arrowColor() ); -#endif - if ( newColor.isValid() ) - { - mArrow->beginCommand( tr( "Arrow color changed" ) ); - mArrow->setArrowColor( newColor ); - mArrow->update(); - mArrow->endCommand(); - } + mArrow->beginCommand( tr( "Arrow color changed" ) ); + mArrow->setArrowColor( newColor ); + mArrow->update(); + mArrow->endCommand(); } void QgsComposerArrowWidget::blockAllSignals( bool block ) @@ -120,6 +112,9 @@ void QgsComposerArrowWidget::setGuiElementValues() } blockAllSignals( true ); + mArrowColorButton->setColor( mArrow->arrowColor() ); + mArrowColorButton->setColorDialogTitle( tr( "Select arrow color" ) ); + mArrowColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); mOutlineWidthSpinBox->setValue( mArrow->outlineWidth() ); mArrowHeadWidthSpinBox->setValue( mArrow->arrowHeadWidth() ); diff --git a/src/app/composer/qgscomposerarrowwidget.h b/src/app/composer/qgscomposerarrowwidget.h index 939f623fc4a..c055abc232d 100644 --- a/src/app/composer/qgscomposerarrowwidget.h +++ b/src/app/composer/qgscomposerarrowwidget.h @@ -42,7 +42,7 @@ class QgsComposerArrowWidget: public QWidget, private Ui::QgsComposerArrowWidget private slots: void on_mOutlineWidthSpinBox_valueChanged( double d ); void on_mArrowHeadWidthSpinBox_valueChanged( double d ); - void on_mArrowColorButton_clicked(); + void on_mArrowColorButton_colorChanged( const QColor& newColor ); void on_mDefaultMarkerRadioButton_toggled( bool toggled ); void on_mNoMarkerRadioButton_toggled( bool toggled ); void on_mSvgMarkerRadioButton_toggled( bool toggled ); diff --git a/src/app/composer/qgscomposeritemwidget.cpp b/src/app/composer/qgscomposeritemwidget.cpp index 507afff8b42..a890639b1e2 100644 --- a/src/app/composer/qgscomposeritemwidget.cpp +++ b/src/app/composer/qgscomposeritemwidget.cpp @@ -66,13 +66,14 @@ void QgsComposerItemWidget::on_mFrameColorButton_clicked() { return; } +} - QColor newFrameColor = QColorDialog::getColor( mItem->pen().color(), 0 ); - if ( !newFrameColor.isValid() ) +void QgsComposerItemWidget::on_mFrameColorButton_colorChanged( const QColor& newFrameColor ) +{ + if ( !mItem ) { - return; //dialog canceled + return; } - mItem->beginCommand( tr( "Frame color changed" ) ); QPen thePen; thePen.setColor( newFrameColor ); @@ -89,15 +90,17 @@ void QgsComposerItemWidget::on_mBackgroundColorButton_clicked() { return; } +} - QColor newBackgroundColor = QColorDialog::getColor( mItem->brush().color(), 0 ); - if ( !newBackgroundColor.isValid() ) +void QgsComposerItemWidget::on_mBackgroundColorButton_colorChanged( const QColor& newBackgroundColor ) +{ + if ( !mItem ) { - return; //dialog canceled + return; } - +// QColor newColor( newBackgroundColor ); mItem->beginCommand( tr( "Background color changed" ) ); - newBackgroundColor.setAlpha( 255 - ( mTransparencySpinBox->value() * 2.55 ) ); +// newColor.setAlpha( 255 - ( mTransparencySpinBox->value() * 2.55 ) ); mItem->setBrush( QBrush( QColor( newBackgroundColor ), Qt::SolidPattern ) ); //if the item is a composer map, we need to regenerate the map image //because it usually is cached @@ -110,39 +113,39 @@ void QgsComposerItemWidget::on_mBackgroundColorButton_clicked() mItem->endCommand(); } -void QgsComposerItemWidget::on_mTransparencySpinBox_valueChanged( int value ) -{ - if ( !mItem ) - { - return; - } +//void QgsComposerItemWidget::on_mTransparencySpinBox_valueChanged( int value ) +//{ +// if ( !mItem ) +// { +// return; +// } - mTransparencySlider->blockSignals( true ); - mTransparencySlider->setValue( value ); - mTransparencySlider->blockSignals( false ); - changeItemTransparency( value ); -} +// mTransparencySlider->blockSignals( true ); +// mTransparencySlider->setValue( value ); +// mTransparencySlider->blockSignals( false ); +// changeItemTransparency( value ); +//} -void QgsComposerItemWidget::on_mTransparencySlider_valueChanged( int value ) -{ - if ( !mItem ) - { - return; - } - // do item updates only off of mTransparencySpinBox valueChanged - mTransparencySpinBox->setValue( value ); -} +//void QgsComposerItemWidget::on_mTransparencySlider_valueChanged( int value ) +//{ +// if ( !mItem ) +// { +// return; +// } +// // do item updates only off of mTransparencySpinBox valueChanged +// mTransparencySpinBox->setValue( value ); +//} -void QgsComposerItemWidget::changeItemTransparency( int value ) -{ - mItem->beginCommand( tr( "Item transparency changed" ) ); - QBrush itemBrush = mItem->brush(); - QColor brushColor = itemBrush.color(); - brushColor.setAlpha( 255 - ( value * 2.55 ) ); - mItem->setBrush( QBrush( brushColor ) ); - mItem->update(); - mItem->endCommand(); -} +//void QgsComposerItemWidget::changeItemTransparency( int value ) +//{ +// mItem->beginCommand( tr( "Item transparency changed" ) ); +// QBrush itemBrush = mItem->brush(); +// QColor brushColor = itemBrush.color(); +// brushColor.setAlpha( 255 - ( value * 2.55 ) ); +// mItem->setBrush( QBrush( brushColor ) ); +// mItem->update(); +// mItem->endCommand(); +//} void QgsComposerItemWidget::changeItemPosition() { @@ -344,30 +347,37 @@ void QgsComposerItemWidget::setValuesForGuiElements() setValuesForGuiPositionElements(); - mTransparencySlider->blockSignals( true ); +// mTransparencySlider->blockSignals( true ); mOutlineWidthSpinBox->blockSignals( true ); mFrameGroupBox->blockSignals( true ); mBackgroundGroupBox->blockSignals( true ); mItemIdLineEdit->blockSignals( true ); mItemUuidLineEdit->blockSignals( true ); - mTransparencySpinBox->blockSignals( true ); +// mTransparencySpinBox->blockSignals( true ); - int alphaPercent = ( 255 - mItem->brush().color().alpha() ) / 2.55; - mTransparencySpinBox->setValue( alphaPercent ); - mTransparencySlider->setValue( alphaPercent ); + mBackgroundColorButton->setColor( mItem->brush().color() ); + mBackgroundColorButton->setColorDialogTitle( tr( "Select background color" ) ); + mBackgroundColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); +// int alphaPercent = ( 255 - mItem->brush().color().alpha() ) / 2.55; +// mTransparencySpinBox->setValue( alphaPercent ); +// mTransparencySlider->setValue( alphaPercent ); + + mFrameColorButton->setColor( mItem->pen().color() ); + mFrameColorButton->setColorDialogTitle( tr( "Select frame color" ) ); + mFrameColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); mOutlineWidthSpinBox->setValue( mItem->pen().widthF() ); mItemIdLineEdit->setText( mItem->id() ); mItemUuidLineEdit->setText( mItem->uuid() ); mFrameGroupBox->setChecked( mItem->hasFrame() ); mBackgroundGroupBox->setChecked( mItem->hasBackground() ); - mTransparencySlider->blockSignals( false ); +// mTransparencySlider->blockSignals( false ); mOutlineWidthSpinBox->blockSignals( false ); mFrameGroupBox->blockSignals( false ); mBackgroundGroupBox->blockSignals( false ); mItemIdLineEdit->blockSignals( false ); mItemUuidLineEdit->blockSignals( false ); - mTransparencySpinBox->blockSignals( false ); +// mTransparencySpinBox->blockSignals( false ); } diff --git a/src/app/composer/qgscomposeritemwidget.h b/src/app/composer/qgscomposeritemwidget.h index 8bc704264b8..30c994fe8c2 100644 --- a/src/app/composer/qgscomposeritemwidget.h +++ b/src/app/composer/qgscomposeritemwidget.h @@ -38,9 +38,17 @@ class QgsComposerItemWidget: public QWidget, private Ui::QgsComposerItemWidgetBa public slots: void on_mFrameColorButton_clicked(); + /** Set the frame color + * @note added in 1.9 + */ + void on_mFrameColorButton_colorChanged( const QColor& newFrameColor ); void on_mBackgroundColorButton_clicked(); - void on_mTransparencySlider_valueChanged( int value ); - void on_mTransparencySpinBox_valueChanged( int value ); + /** Set the background color + * @note added in 1.9 + */ + void on_mBackgroundColorButton_colorChanged( const QColor& newBackgroundColor ); +// void on_mTransparencySlider_valueChanged( int value ); +// void on_mTransparencySpinBox_valueChanged( int value ); void on_mOutlineWidthSpinBox_valueChanged( double d ); void on_mFrameGroupBox_toggled( bool state ); void on_mBackgroundGroupBox_toggled( bool state ); @@ -67,7 +75,7 @@ class QgsComposerItemWidget: public QWidget, private Ui::QgsComposerItemWidgetBa private: QgsComposerItemWidget(); - void changeItemTransparency( int value ); +// void changeItemTransparency( int value ); void changeItemPosition(); QgsComposerItem* mItem; diff --git a/src/app/composer/qgscomposertablewidget.cpp b/src/app/composer/qgscomposertablewidget.cpp index 0921ae7618f..aa993778043 100644 --- a/src/app/composer/qgscomposertablewidget.cpp +++ b/src/app/composer/qgscomposertablewidget.cpp @@ -265,24 +265,14 @@ void QgsComposerTableWidget::on_mGridStrokeWidthSpinBox_valueChanged( double d ) mComposerTable->endCommand(); } -void QgsComposerTableWidget::on_mGridColorButton_clicked() +void QgsComposerTableWidget::on_mGridColorButton_colorChanged( const QColor& newColor ) { if ( !mComposerTable ) { return; } -#if QT_VERSION >= 0x040500 - QColor newColor = QColorDialog::getColor( mComposerTable->gridColor(), 0, tr( "Select grid color" ) ); -#else - QColor newColor = QColorDialog::getColor( mComposerTable->gridColor(), 0 ); -#endif - if ( !newColor.isValid() ) - { - return; - } mComposerTable->beginCommand( tr( "Table grid color" ) ); - mGridColorButton->setColor( newColor ); mComposerTable->setGridColor( newColor ); mComposerTable->update(); mComposerTable->endCommand(); @@ -336,6 +326,8 @@ void QgsComposerTableWidget::updateGuiElements() mMarginSpinBox->setValue( mComposerTable->lineTextDistance() ); mGridStrokeWidthSpinBox->setValue( mComposerTable->gridStrokeWidth() ); mGridColorButton->setColor( mComposerTable->gridColor() ); + mGridColorButton->setColorDialogTitle( tr( "Select grid color" ) ); + mGridColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); if ( mComposerTable->showGrid() ) { mShowGridGroupCheckBox->setChecked( true ); diff --git a/src/app/composer/qgscomposertablewidget.h b/src/app/composer/qgscomposertablewidget.h index 6091020c13f..f04095675f6 100644 --- a/src/app/composer/qgscomposertablewidget.h +++ b/src/app/composer/qgscomposertablewidget.h @@ -46,7 +46,7 @@ class QgsComposerTableWidget: public QWidget, private Ui::QgsComposerTableWidget void on_mMaximumColumnsSpinBox_valueChanged( int i ); void on_mMarginSpinBox_valueChanged( double d ); void on_mGridStrokeWidthSpinBox_valueChanged( double d ); - void on_mGridColorButton_clicked(); + void on_mGridColorButton_colorChanged( const QColor& newColor ); void on_mHeaderFontPushButton_clicked(); void on_mContentFontPushButton_clicked(); void on_mShowGridGroupCheckBox_toggled( bool state ); diff --git a/src/app/composer/qgscompositionwidget.cpp b/src/app/composer/qgscompositionwidget.cpp index 8f03fe384d6..623a019bcc8 100644 --- a/src/app/composer/qgscompositionwidget.cpp +++ b/src/app/composer/qgscompositionwidget.cpp @@ -64,6 +64,8 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget* parent, QgsComposition* c ) //grid pen color mGridColorButton->setColor( mComposition->gridPen().color() ); + mGridColorButton->setColorDialogTitle( tr( "Select grid color" ) ); + mGridColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); mGridStyleComboBox->insertItem( 0, tr( "Solid" ) ); mGridStyleComboBox->insertItem( 1, tr( "Dots" ) ); diff --git a/src/app/qgscontinuouscolordialog.cpp b/src/app/qgscontinuouscolordialog.cpp index 05bd17827df..98b2f48939b 100644 --- a/src/app/qgscontinuouscolordialog.cpp +++ b/src/app/qgscontinuouscolordialog.cpp @@ -178,13 +178,11 @@ void QgsContinuousColorDialog::apply() void QgsContinuousColorDialog::selectMinimumColor( const QColor& color ) { Q_UNUSED( color ) - activateWindow(); } void QgsContinuousColorDialog::selectMaximumColor( const QColor& color ) { Q_UNUSED( color ) - activateWindow(); } void QgsContinuousColorDialog::on_cb_polygonOutline_clicked() diff --git a/src/app/qgsdecorationcopyrightdialog.cpp b/src/app/qgsdecorationcopyrightdialog.cpp index 132356cc225..a434c8dcf3f 100644 --- a/src/app/qgsdecorationcopyrightdialog.cpp +++ b/src/app/qgsdecorationcopyrightdialog.cpp @@ -70,17 +70,12 @@ void QgsDecorationCopyrightDialog::on_buttonBox_rejected() reject(); } -void QgsDecorationCopyrightDialog::on_pbnColorChooser_clicked() +void QgsDecorationCopyrightDialog::on_pbnColorChooser_colorChanged( const QColor& c ) { - QColor c = QColorDialog::getColor(); - if ( c.isValid() ) - { - pbnColorChooser->setColor( c ); - QTextCursor cursor = txtCopyrightText->textCursor(); - txtCopyrightText->selectAll(); - txtCopyrightText->setTextColor( c ); - txtCopyrightText->setTextCursor( cursor ); - } + QTextCursor cursor = txtCopyrightText->textCursor(); + txtCopyrightText->selectAll(); + txtCopyrightText->setTextColor( c ); + txtCopyrightText->setTextCursor( cursor ); } void QgsDecorationCopyrightDialog::on_buttonBox_helpRequested() diff --git a/src/app/qgsdecorationcopyrightdialog.h b/src/app/qgsdecorationcopyrightdialog.h index 99e86885d15..e3d54d08549 100644 --- a/src/app/qgsdecorationcopyrightdialog.h +++ b/src/app/qgsdecorationcopyrightdialog.h @@ -31,7 +31,7 @@ class QgsDecorationCopyrightDialog : public QDialog, private Ui::QgsDecorationCo void on_buttonBox_accepted(); void on_buttonBox_rejected(); void on_buttonBox_helpRequested(); - void on_pbnColorChooser_clicked(); + void on_pbnColorChooser_colorChanged( const QColor& c ); protected: QgsDecorationCopyright& mDeco; diff --git a/src/app/qgslabelinggui.cpp b/src/app/qgslabelinggui.cpp index bab5e56fd6c..66c1fcb5861 100644 --- a/src/app/qgslabelinggui.cpp +++ b/src/app/qgslabelinggui.cpp @@ -251,6 +251,12 @@ QgsLabelingGui::QgsLabelingGui( QgsPalLabeling* lbl, QgsVectorLayer* layer, QgsM mBufferJoinStyleComboBox->setPenJoinStyle( lyr.bufferJoinStyle ); mBufferTranspFillChbx->setChecked( !lyr.bufferNoFill ); } + else + { + // default color + // TODO: remove after moving to persistent PAL settings? + btnBufferColor->setColor( Qt::white ); + } bool formattedNumbers = lyr.formatNumbers; bool plusSign = lyr.plusSign; @@ -360,6 +366,7 @@ void QgsLabelingGui::collapseSample( bool collapse ) void QgsLabelingGui::apply() { writeSettingsToLayer(); + QgisApp::instance()->markDirty(); // trigger refresh if ( mMapCanvas ) { diff --git a/src/app/qgslabelpropertydialog.cpp b/src/app/qgslabelpropertydialog.cpp index 55be86011d2..feef412ead6 100644 --- a/src/app/qgslabelpropertydialog.cpp +++ b/src/app/qgslabelpropertydialog.cpp @@ -110,9 +110,7 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const mHaliComboBox->setCurrentIndex( mHaliComboBox->findText( "Left" ) ); mValiComboBox->setCurrentIndex( mValiComboBox->findText( "Bottom" ) ); mFontColorButton->setColorDialogTitle( tr( "Font color" ) ); - mFontColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); mBufferColorButton->setColorDialogTitle( tr( "Buffer color" ) ); - mBufferColorButton->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); disableGuiElements(); @@ -121,14 +119,14 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const for ( ; propIt != mDataDefinedProperties.constEnd(); ++propIt ) { + bool ok = false; switch ( propIt.key() ) { case QgsPalLayerSettings::Show: { // new scope to assign variables mShowLabelChkbx->setEnabled( true ); - bool showSuccess; - int showLabel = mCurLabelFeat.attribute( propIt.value() ).toInt( &showSuccess ); - mShowLabelChkbx->setChecked( !showSuccess || showLabel != 0 ); + int showLabel = mCurLabelFeat.attribute( propIt.value() ).toInt( &ok ); + mShowLabelChkbx->setChecked( !ok || showLabel != 0 ); break; } case QgsPalLayerSettings::AlwaysShow: @@ -136,34 +134,76 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const mAlwaysShowChkbx->setChecked( mCurLabelFeat.attribute( propIt.value() ).toBool() ); break; case QgsPalLayerSettings::MinScale: - mMinScaleSpinBox->setEnabled( true ); - mMinScaleSpinBox->setValue( mCurLabelFeat.attribute( propIt.value() ).toInt() ); + { + int minScale = mCurLabelFeat.attribute( propIt.value() ).toInt( &ok ); + if ( ok ) + { + mMinScaleSpinBox->setEnabled( true ); + mMinScaleSpinBox->setValue( minScale ); + } break; + } case QgsPalLayerSettings::MaxScale: - mMaxScaleSpinBox->setEnabled( true ); - mMaxScaleSpinBox->setValue( mCurLabelFeat.attribute( propIt.value() ).toInt() ); + { + int maxScale = mCurLabelFeat.attribute( propIt.value() ).toInt( &ok ); + if ( ok ) + { + mMaxScaleSpinBox->setEnabled( true ); + mMaxScaleSpinBox->setValue( maxScale ); + } break; + } case QgsPalLayerSettings::Size: - mFontSizeSpinBox->setEnabled( true ); - mLabelFont.setPointSizeF( mCurLabelFeat.attribute( propIt.value() ).toDouble() ); - mFontSizeSpinBox->setValue( mCurLabelFeat.attribute( propIt.value() ).toDouble() ); + { + double fontSize = mCurLabelFeat.attribute( propIt.value() ).toDouble( &ok ); + if ( ok ) + { + mFontSizeSpinBox->setEnabled( true ); + mLabelFont.setPointSizeF( fontSize ); + mFontSizeSpinBox->setValue( fontSize ); + } break; + } case QgsPalLayerSettings::BufferSize: - mBufferSizeSpinBox->setEnabled( true ); - mBufferSizeSpinBox->setValue( mCurLabelFeat.attribute( propIt.value() ).toDouble() ); + { + double bufferSize = mCurLabelFeat.attribute( propIt.value() ).toDouble( &ok ); + if ( ok ) + { + mBufferSizeSpinBox->setEnabled( true ); + mBufferSizeSpinBox->setValue( bufferSize ); + } break; + } case QgsPalLayerSettings::PositionX: - mXCoordSpinBox->setEnabled( true ); - mXCoordSpinBox->setValue( mCurLabelFeat.attribute( propIt.value() ).toDouble() ); + { + double posX = mCurLabelFeat.attribute( propIt.value() ).toDouble( &ok ); + if ( ok ) + { + mXCoordSpinBox->setEnabled( true ); + mXCoordSpinBox->setValue( posX ); + } break; + } case QgsPalLayerSettings::PositionY: - mYCoordSpinBox->setEnabled( true ); - mYCoordSpinBox->setValue( mCurLabelFeat.attribute( propIt.value() ).toDouble() ); + { + double posY = mCurLabelFeat.attribute( propIt.value() ).toDouble( &ok ); + if ( ok ) + { + mYCoordSpinBox->setEnabled( true ); + mYCoordSpinBox->setValue( posY ); + } break; + } case QgsPalLayerSettings::LabelDistance: - mLabelDistanceSpinBox->setEnabled( true ); - mLabelDistanceSpinBox->setValue( mCurLabelFeat.attribute( propIt.value() ).toDouble() ); + { + double labelDist = mCurLabelFeat.attribute( propIt.value() ).toDouble( &ok ); + if ( ok ) + { + mLabelDistanceSpinBox->setEnabled( true ); + mLabelDistanceSpinBox->setValue( labelDist ); + } break; + } case QgsPalLayerSettings::Hali: mHaliComboBox->setEnabled( true ); mHaliComboBox->setCurrentIndex( mHaliComboBox->findText( mCurLabelFeat.attribute( propIt.value() ).toString() ) ); @@ -181,11 +221,17 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const mFontColorButton->setColor( QColor( mCurLabelFeat.attribute( propIt.value() ).toString() ) ); break; case QgsPalLayerSettings::Rotation: - mRotationSpinBox->setEnabled( true ); - mRotationSpinBox->setValue( mCurLabelFeat.attribute( propIt.value() ).toDouble() ); + { + double rot = mCurLabelFeat.attribute( propIt.value() ).toDouble( &ok ); + if ( ok ) + { + mRotationSpinBox->setEnabled( true ); + mRotationSpinBox->setValue( rot ); + } break; + } - //font related properties + //font related properties case QgsPalLayerSettings::Bold: mLabelFont.setBold( mCurLabelFeat.attribute( propIt.value() ).toBool() ); break; @@ -237,6 +283,7 @@ void QgsLabelPropertyDialog::blockElementSignals( bool block ) mFontSizeSpinBox->blockSignals( block ); mBufferSizeSpinBox->blockSignals( block ); mFontPushButton->blockSignals( block ); + mFontColorButton->blockSignals( block ); mBufferColorButton->blockSignals( block ); mLabelDistanceSpinBox->blockSignals( block ); mXCoordSpinBox->blockSignals( block ); diff --git a/src/app/qgsoptions.cpp b/src/app/qgsoptions.cpp index b3a147c91a7..c00ed27bb04 100644 --- a/src/app/qgsoptions.cpp +++ b/src/app/qgsoptions.cpp @@ -490,6 +490,9 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) : QString name = QApplication::style()->objectName(); cmbStyle->setCurrentIndex( cmbStyle->findText( name, Qt::MatchFixedString ) ); + + mLiveColorDialogsChkBx->setChecked( settings.value( "/qgis/live_color_dialogs", false ).toBool() ); + //set the state of the checkboxes //Changed to default to true as of QGIS 1.7 chkAntiAliasing->setChecked( settings.value( "/qgis/enable_anti_aliasing", true ).toBool() ); @@ -1085,6 +1088,8 @@ void QgsOptions::saveOptions() settings.setValue( "/qgis/messageTimeout", mMessageTimeoutSpnBx->value() ); + settings.setValue( "/qgis/live_color_dialogs", mLiveColorDialogsChkBx->isChecked() ); + // rasters settings settings.setValue( "/Raster/defaultRedBand", spnRed->value() ); settings.setValue( "/Raster/defaultGreenBand", spnGreen->value() ); diff --git a/src/app/qgssinglesymboldialog.cpp b/src/app/qgssinglesymboldialog.cpp index 43b50a8b6bb..c2d082d70bc 100644 --- a/src/app/qgssinglesymboldialog.cpp +++ b/src/app/qgssinglesymboldialog.cpp @@ -252,14 +252,12 @@ void QgsSingleSymbolDialog::selectOutlineColor( const QColor& color ) { Q_UNUSED( color ) emit settingsChanged(); - activateWindow(); } void QgsSingleSymbolDialog::selectFillColor( const QColor& color ) { Q_UNUSED( color ) emit settingsChanged(); - activateWindow(); } //should this method have a different name? diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 81324d27cb3..fc7c62c8eb5 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -50,6 +50,7 @@ qgsattributeeditor.cpp qgslegendinterface.cpp qgscharacterselectdialog.cpp qgscolorbutton.cpp +qgscolordialog.cpp qgscomposerview.cpp qgscursors.cpp qgsdetaileditemdelegate.cpp @@ -156,6 +157,7 @@ attributetable/qgsattributetabledelegate.h qgsattributeeditor.h qgscharacterselectdialog.h +qgscolordialog.h qgscomposerview.h qgsdetaileditemdelegate.h qgsdetaileditemwidget.h @@ -205,6 +207,7 @@ SET(QGIS_GUI_HDRS qgisgui.h qgisinterface.h qgscharacterselectdialog.h +qgscolordialog.h qgscursors.h qgsencodingfiledialog.h qgsfiledropedit.h diff --git a/src/gui/qgscolorbutton.cpp b/src/gui/qgscolorbutton.cpp index a8c1bf782ce..646b1662954 100644 --- a/src/gui/qgscolorbutton.cpp +++ b/src/gui/qgscolorbutton.cpp @@ -14,78 +14,250 @@ ***************************************************************************/ #include "qgscolorbutton.h" +#include "qgscolordialog.h" +#include "qgsapplication.h" +#include "qgslogger.h" + #include +#include +#include /*! \class QgsColorButton - \brief The QgsColorButton class provides a tool button widget displaying - a color which can be altered by calling QColorDialog::getColor. + \brief A cross platform button subclass for selecting colors. Will open a color chooser dialog when clicked. + Offers live updates to button from color chooser dialog - A subclass of QToolButton is needed to draw the button content because + A subclass of QPushButton is needed to draw the button content because some platforms such as Mac OS X and Windows XP enforce a consistent GUI look by always using the button color of the current style and not allowing button backgrounds to be changed on a button by button basis. + Therefore, a wholely stylesheet-based button is used for the no-text variant. This class is a simplified version of QtColorButton, an internal class used by Qt Designer to do the same thing. */ QgsColorButton::QgsColorButton( QWidget *parent, QString cdt, QColorDialog::ColorDialogOptions cdo ) - : QToolButton( parent ) - , mColorDialogTitle( cdt ) + : QPushButton( parent ) + , mColorDialogTitle( cdt.isEmpty() ? tr( "Select Color" ) : cdt ) + , mColor( Qt::black ) , mColorDialogOptions( cdo ) + , mAcceptLiveUpdates( true ) + , mTempPNG( NULL ) { - setToolButtonStyle( Qt::ToolButtonTextOnly ); // decrease default button height connect( this, SIGNAL( clicked() ), this, SLOT( onButtonClicked() ) ); } QgsColorButton::~QgsColorButton() -{} +{ + mTempPNG.remove(); +} + +const QPixmap& QgsColorButton::transpBkgrd() +{ + static QPixmap transpBkgrd; + + if ( transpBkgrd.isNull() ) + transpBkgrd = QgsApplication::getThemePixmap( "/transp-background_8x8.png" ); + + return transpBkgrd; +} void QgsColorButton::onButtonClicked() { + //QgsDebugMsg( "entered" ); + QColor newColor; #if QT_VERSION >= 0x040500 - QColor newColor = QColorDialog::getColor( color(), 0, mColorDialogTitle, mColorDialogOptions ); + QSettings settings; + if ( mAcceptLiveUpdates && settings.value( "/qgis/live_color_dialogs", false ).toBool() ) + { + newColor = QgsColorDialog::getLiveColor( + color(), this, "setValidColor( const QColor& )", + this->parentWidget(), mColorDialogTitle, mColorDialogOptions ); + } + else + { + newColor = QColorDialog::getColor( color(), this->parentWidget(), mColorDialogTitle, mColorDialogOptions ); + } #else - QColor newColor = QColorDialog::getColor( color() ); + newColor = QColorDialog::getColor( color(), this->parentWidget() ); #endif + setValidColor( newColor ); + + // reactivate button's window + activateWindow(); +} + +void QgsColorButton::setValidColor( const QColor& newColor ) +{ if ( newColor.isValid() ) { setColor( newColor ); } } -/*! - Paints button in response to a paint event. -*/ -void QgsColorButton::paintEvent( QPaintEvent *e ) +void QgsColorButton::changeEvent( QEvent* e ) { - QToolButton::paintEvent( e ); - if ( -#ifdef Q_WS_MAC - // Mac shows color only a when a window is active - isActiveWindow() && -#endif - isEnabled() ) + if ( e->type() == QEvent::EnabledChange ) { - QPainter p( this ); - int margin = 2; // Leave some space for highlighting - QRect r = rect().adjusted( margin, margin, -margin, -margin ); - p.fillRect( r, mColor ); + setButtonBackground(); } + QPushButton::changeEvent( e ); +} + +void QgsColorButton::paintEvent( QPaintEvent* e ) +{ + setButtonBackground(); + QPushButton::paintEvent( e ); } void QgsColorButton::setColor( const QColor &color ) { + if ( !color.isValid() ) + { + return; + } QColor oldColor = mColor; - mColor = color; - update(); if ( oldColor != mColor ) { - emit( colorChanged( mColor ) ); + setButtonBackground(); + if ( isEnabled() ) + { + // TODO: May be beneficial to have the option to set color without emitting this signal. + // Now done by blockSignals( bool ) where button is used + emit( colorChanged( mColor ) ); + } + } +} + +void QgsColorButton::setButtonBackground() +{ + if ( !text().isEmpty() ) + { + // generate icon pixmap for regular pushbutton + setFlat( false ); + + QPixmap pixmap; + pixmap = QPixmap( iconSize() ); + pixmap.fill( QColor( 0, 0, 0, 0 ) ); + + int iconW = iconSize().width(); + int iconH = iconSize().height(); + QRect rect( 0, 0, iconW, iconH ); + + // QPainterPath::addRoundRect has flaws, draw chamfered corners instead + QPainterPath roundRect; + int chamfer = 3; + int inset = 1; + roundRect.moveTo( chamfer, inset ); + roundRect.lineTo( iconW - chamfer, inset ); + roundRect.lineTo( iconW - inset, chamfer ); + roundRect.lineTo( iconW - inset, iconH - chamfer ); + roundRect.lineTo( iconW - chamfer, iconH - inset ); + roundRect.lineTo( chamfer, iconH - inset ); + roundRect.lineTo( inset, iconH - chamfer ); + roundRect.lineTo( inset, chamfer ); + roundRect.closeSubpath(); + + QPainter p; + p.begin( &pixmap ); + p.setRenderHint( QPainter::Antialiasing ); + p.setClipPath( roundRect ); + p.setPen( Qt::NoPen ); + if ( mColor.alpha() < 255 ) + { + p.drawTiledPixmap( rect, transpBkgrd() ); + } + p.setBrush( mColor ); + p.drawRect( rect ); + p.end(); + + // set this pixmap as icon + setIcon( QIcon( pixmap ) ); + } + else + { + // generate temp background image file with checkerboard canvas to be used via stylesheet + + // set flat, or inline spacing (widget margins) needs to be manually calcualted and set + setFlat( true ); + + bool useAlpha = ( mColorDialogOptions & QColorDialog::ShowAlphaChannel ); + + QColor tmpColor( mColor ); + QString border( "110" ); + if ( !isEnabled() ) // fake disabled look (use just Qt::lightGray instead?) + { + int tmpValue = ( 255 - tmpColor.value() ) / 3 + tmpColor.value(); + tmpColor.setHsv( tmpColor.hue(), tmpColor.saturation() / 2, tmpValue, useAlpha ? tmpColor.alpha() : 255 ); + + border = "128"; + } + + // in case margins need to be adjusted + QString margin = QString( "%1px %2px %3px %4px" ).arg( 0 ).arg( 0 ).arg( 0 ).arg( 0 ); + + //QgsDebugMsg( QString( "%1 margin: %2" ).arg( objectName() ).arg( margin ) ); + + QString bkgrd = QString( " background-color: rgba(%1,%2,%3,%4);" ) + .arg( tmpColor.red() ) + .arg( tmpColor.green() ) + .arg( tmpColor.blue() ) + .arg( useAlpha ? tmpColor.alpha() : 255 ); + + if ( useAlpha && tmpColor.alpha() < 255 ) + { + QPixmap pixmap = transpBkgrd(); + QRect rect( 0, 0, pixmap.width(), pixmap.height() ); + + QPainter p; + p.begin( &pixmap ); + p.setRenderHint( QPainter::Antialiasing ); + p.setPen( Qt::NoPen ); + p.setBrush( tmpColor ); + p.drawRect( rect ); + p.end(); + + if ( mTempPNG.open() ) + { + mTempPNG.setAutoRemove( false ); + pixmap.save( mTempPNG.fileName(), "PNG" ); + mTempPNG.close(); + } + + bkgrd = QString( " background-image: url(%1);" ).arg( mTempPNG.fileName() ); + } + + //QgsDebugMsg( QString( "%1" ).arg( bkgrd ) ); + + setStyleSheet( QString( "QgsColorButton{" + " %1" + " background-position: top left;" + " background-origin: content;" + " background-clip: content;" + " padding: 2px;" + " margin: %2;" + " border-style: outset;" + " border-width: 1px;" + " border-color: rgb(%3,%3,%3);" + " border-radius: 3px;} " + "QgsColorButton:pressed{" + " %1" + " background-position: top left;" + " background-origin: content;" + " background-clip: content;" + " padding: 1px;" + " margin: %2;" + " border-style: inset;" + " border-width: 2px;" + " border-color: rgb(128,128,128);" + " border-radius: 4px;} " ) + .arg( bkgrd ) + .arg( margin ) + .arg( border ) ); } } @@ -113,37 +285,3 @@ QString QgsColorButton::colorDialogTitle() { return mColorDialogTitle; } - -////////////////// - -QgsColorButtonV2::QgsColorButtonV2( QWidget* parent ) - : QPushButton( parent ) -{ -} - -QgsColorButtonV2::QgsColorButtonV2( QString text, QWidget* parent ) - : QPushButton( text, parent ) -{ -} - -void QgsColorButtonV2::setColor( const QColor &color ) -{ - mColor = color; - - QPixmap pixmap( iconSize() ); - pixmap.fill( QColor( 0, 0, 0, 0 ) ); - - QRect rect( 1, 1, iconSize().width() - 2, iconSize().height() - 2 ); - - // draw a slightly rounded rectangle - QPainter p; - p.begin( &pixmap ); - p.setPen( Qt::NoPen ); - p.setRenderHint( QPainter::Antialiasing ); - p.setBrush( color ); - p.drawRoundedRect( rect, 4, 4 ); - p.end(); - - // set this pixmap as icon - setIcon( QIcon( pixmap ) ); -} diff --git a/src/gui/qgscolorbutton.h b/src/gui/qgscolorbutton.h index 65385d934f4..162a778a0c6 100644 --- a/src/gui/qgscolorbutton.h +++ b/src/gui/qgscolorbutton.h @@ -16,15 +16,20 @@ #define QGSCOLORBUTTON_H #include -#include #include +#include + /** \ingroup gui + * \class QgsColorButton * A cross platform button subclass for selecting colors. Will open a color chooser dialog when clicked. + * Offers live updates to button from color chooser dialog + * @note inherited base class moved from QToolButton to QPushButton in QGIS 1.9 */ -class GUI_EXPORT QgsColorButton: public QToolButton + +class GUI_EXPORT QgsColorButton: public QPushButton { - Q_OBJECT + Q_OBJECT public: /** @@ -35,7 +40,7 @@ class GUI_EXPORT QgsColorButton: public QToolButton * @param cdo Options for the color chooser dialog * @note changed in 1.9 */ - QgsColorButton( QWidget *parent = 0, QString cdt = tr( "Select Color" ), QColorDialog::ColorDialogOptions cdo = 0 ); + QgsColorButton( QWidget *parent = 0, QString cdt = "", QColorDialog::ColorDialogOptions cdo = 0 ); ~QgsColorButton(); /** @@ -85,11 +90,20 @@ class GUI_EXPORT QgsColorButton: public QToolButton */ QString colorDialogTitle(); - protected: - void paintEvent( QPaintEvent *e ); + /** + * Whether the button accepts live updates from QColorDialog. + * + * @note added in 1.9 + */ + bool acceptLiveUpdates() { return mAcceptLiveUpdates; } - public slots: - void onButtonClicked(); + /** + * Sets whether the button accepts live updates from QColorDialog. + * Live updates may cause changes that are not undoable on QColorDialog cancel. + * + * @note added in 1.9 + */ + void setAcceptLiveUpdates( bool accept ) { mAcceptLiveUpdates = accept; } signals: /** @@ -101,24 +115,34 @@ class GUI_EXPORT QgsColorButton: public QToolButton */ void colorChanged( const QColor &color ); + protected: + void changeEvent( QEvent* e ); + void paintEvent( QPaintEvent* e ); + static const QPixmap& transpBkgrd(); + private: QString mColorDialogTitle; QColor mColor; QColorDialog::ColorDialogOptions mColorDialogOptions; -}; + bool mAcceptLiveUpdates; + QTemporaryFile mTempPNG; + private slots: + void onButtonClicked(); -class GUI_EXPORT QgsColorButtonV2 : public QPushButton -{ - public: - QgsColorButtonV2( QWidget* parent = 0 ); - QgsColorButtonV2( QString text, QWidget* parent = 0 ); + /** + * Sets the background pixmap for the button based upon set color and transparency. + * + * @note added in 1.9 + */ + void setButtonBackground(); - void setColor( const QColor &color ); - QColor color() const { return mColor; } - - private: - QColor mColor; + /** + * Sets color for button, if valid. + * + * @note added in 1.9 + */ + void setValidColor( const QColor& newColor ); }; #endif diff --git a/src/gui/qgscolordialog.cpp b/src/gui/qgscolordialog.cpp new file mode 100644 index 00000000000..055e9a3937e --- /dev/null +++ b/src/gui/qgscolordialog.cpp @@ -0,0 +1,53 @@ +/*************************************************************************** + qgscolordialog.cpp - color selection dialog + + --------------------- + begin : March 19, 2013 + copyright : (C) 2013 by Larry Shaffer + email : larrys at dakcarto dot com + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "qgscolordialog.h" + +#include + +QgsColorDialog::QgsColorDialog() +{ +} + +QgsColorDialog::~QgsColorDialog() +{ +} + +QColor QgsColorDialog::getLiveColor( const QColor& initialColor, QObject* updateObject, const char* updateSlot, + QWidget* parent, + const QString& title, + QColorDialog::ColorDialogOptions options ) +{ + QColor returnColor( initialColor ); + QColorDialog* liveDialog = new QColorDialog( initialColor, parent ); + liveDialog->setWindowTitle( title.isEmpty() ? tr( "Select Color" ) : title ); + liveDialog->setOptions( options ); +#ifdef Q_WS_MAC + // always use native color dialog on Mac + liveDialog->setOption( QColorDialog::DontUseNativeDialog, false ); +#endif + connect( liveDialog, SIGNAL( currentColorChanged( const QColor& ) ), + updateObject, QString( "1%1" ).arg( QString( QMetaObject::normalizedSignature( updateSlot ) ) ).toAscii() ); + + if ( liveDialog->exec() ) + { + returnColor = liveDialog->currentColor(); + } + delete liveDialog; + liveDialog = 0; + + return returnColor; +} diff --git a/src/gui/qgscolordialog.h b/src/gui/qgscolordialog.h new file mode 100644 index 00000000000..f49c1430848 --- /dev/null +++ b/src/gui/qgscolordialog.h @@ -0,0 +1,53 @@ +/*************************************************************************** + qgscolordialog.h - color selection dialog + + --------------------- + begin : March 19, 2013 + copyright : (C) 2013 by Larry Shaffer + email : larrys at dakcarto dot com + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef QGSCOLORDIALOG_H +#define QGSCOLORDIALOG_H + +#include +#include "qgisgui.h" + +class QColor; + +/** \ingroup gui + * \class QgsColorDialog + * A dialog for selecting a color + */ + +class GUI_EXPORT QgsColorDialog : public QObject +{ + Q_OBJECT + + public: + QgsColorDialog(); + ~QgsColorDialog(); + + /** Return a color selection from a QColorDialog, with live updating of interim selections. + * @param initialColor The initial color of the selection dialog. + * @param updateObject The receiver object of the live updating. + * @param updateSlot The receiver object's slot for live updating (e.g. "setColor( const QColor& )" ). + * @param parent Parent widget. Usually 0 is best for native system color dialogs. + * @param title The title of the QColorDialog. + * @param options ColorDialogOptions passed to QColorDialog. + * @return Selected color on accepted() or initialColor on rejected(). + */ + static QColor getLiveColor( const QColor& initialColor, QObject* updateObject, const char* updateSlot, + QWidget* parent = 0, + const QString& title = "", + QColorDialog::ColorDialogOptions options = 0 ); +}; + +#endif // #ifndef QGSCOLORDIALOG_H diff --git a/src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp b/src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp index 1afce570e34..77c1cd58b97 100644 --- a/src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp +++ b/src/gui/symbology-ng/qgsellipsesymbollayerv2widget.cpp @@ -60,7 +60,9 @@ void QgsEllipseSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer ) mOutlineWidthSpinBox->setValue( mLayer->outlineWidth() ); btnChangeColorBorder->setColor( mLayer->outlineColor() ); + btnChangeColorBorder->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); btnChangeColorFill->setColor( mLayer->fillColor() ); + btnChangeColorFill->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); QList symbolItemList = mShapeListWidget->findItems( mLayer->symbolName(), Qt::MatchExactly ); if ( symbolItemList.size() > 0 ) @@ -190,32 +192,26 @@ void QgsEllipseSymbolLayerV2Widget::on_mOutlineWidthSpinBox_valueChanged( double } } -void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_clicked() +void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_colorChanged( const QColor& newColor ) { - if ( mLayer ) + if ( !mLayer ) { - QColor newColor = QColorDialog::getColor( mLayer->outlineColor(), this, "", QColorDialog::ShowAlphaChannel ); - if ( newColor.isValid() ) - { - mLayer->setOutlineColor( newColor ); - btnChangeColorBorder->setColor( newColor ); - emit changed(); - } + return; } + + mLayer->setOutlineColor( newColor ); + emit changed(); } -void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_clicked() +void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_colorChanged( const QColor& newColor ) { - if ( mLayer ) + if ( !mLayer ) { - QColor newColor = QColorDialog::getColor( mLayer->fillColor(), this, "", QColorDialog::ShowAlphaChannel ); - if ( newColor.isValid() ) - { - mLayer->setFillColor( newColor ); - btnChangeColorFill->setColor( newColor ); - emit changed(); - } + return; } + + mLayer->setFillColor( newColor ); + emit changed(); } void QgsEllipseSymbolLayerV2Widget::fillDataDefinedComboBoxes() diff --git a/src/gui/symbology-ng/qgsellipsesymbollayerv2widget.h b/src/gui/symbology-ng/qgsellipsesymbollayerv2widget.h index d556e259e44..c56b9c6b136 100644 --- a/src/gui/symbology-ng/qgsellipsesymbollayerv2widget.h +++ b/src/gui/symbology-ng/qgsellipsesymbollayerv2widget.h @@ -47,8 +47,8 @@ class GUI_EXPORT QgsEllipseSymbolLayerV2Widget: public QgsSymbolLayerV2Widget, p void on_mHeightSpinBox_valueChanged( double d ); void on_mRotationSpinBox_valueChanged( double d ); void on_mOutlineWidthSpinBox_valueChanged( double d ); - void on_btnChangeColorBorder_clicked(); - void on_btnChangeColorFill_clicked(); + void on_btnChangeColorBorder_colorChanged( const QColor& newColor ); + void on_btnChangeColorFill_colorChanged( const QColor& newColor ); void on_mDDSymbolWidthComboBox_currentIndexChanged( int idx ); void on_mDDSymbolHeightComboBox_currentIndexChanged( int idx ); diff --git a/src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp b/src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp index 8dab8527466..d1f2e8215b6 100644 --- a/src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp +++ b/src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp @@ -222,42 +222,24 @@ void QgsPointDisplacementRendererWidget::on_mCircleWidthSpinBox_valueChanged( do } } -void QgsPointDisplacementRendererWidget::on_mCircleColorButton_clicked() +void QgsPointDisplacementRendererWidget::on_mCircleColorButton_colorChanged( const QColor& newColor ) { if ( !mRenderer ) { return; } -#if QT_VERSION >= 0x040500 - QColor newColor = QColorDialog::getColor( mRenderer->circleColor(), 0, tr( "Circle color" ), QColorDialog::ShowAlphaChannel ); -#else - QColor newColor = QColorDialog::getColor( mRenderer->circleColor() ); -#endif - if ( newColor.isValid() ) - { - mRenderer->setCircleColor( newColor ); - mCircleColorButton->setColor( newColor ); - } + mRenderer->setCircleColor( newColor ); } -void QgsPointDisplacementRendererWidget::on_mLabelColorButton_clicked() +void QgsPointDisplacementRendererWidget::on_mLabelColorButton_colorChanged( const QColor& newColor ) { if ( !mRenderer ) { return; } -#if QT_VERSION >= 0x040500 - QColor newColor = QColorDialog::getColor( mRenderer->labelColor(), 0, tr( "Label color" ), QColorDialog::ShowAlphaChannel ); -#else - QColor newColor = QColorDialog::getColor( mRenderer->labelColor() ); -#endif - if ( newColor.isValid() ) - { - mRenderer->setLabelColor( newColor ); - mLabelColorButton->setColor( newColor ); - } + mRenderer->setLabelColor( newColor ); } void QgsPointDisplacementRendererWidget::on_mCircleModificationSpinBox_valueChanged( double d ) diff --git a/src/gui/symbology-ng/qgspointdisplacementrendererwidget.h b/src/gui/symbology-ng/qgspointdisplacementrendererwidget.h index ed3b1657c3e..2fc60aa750f 100644 --- a/src/gui/symbology-ng/qgspointdisplacementrendererwidget.h +++ b/src/gui/symbology-ng/qgspointdisplacementrendererwidget.h @@ -46,9 +46,9 @@ class GUI_EXPORT QgsPointDisplacementRendererWidget: public QgsRendererV2Widget, void on_mRendererComboBox_currentIndexChanged( int index ); void on_mLabelFontButton_clicked(); void on_mCircleWidthSpinBox_valueChanged( double d ); - void on_mCircleColorButton_clicked(); + void on_mCircleColorButton_colorChanged( const QColor& newColor ); void on_mDistanceSpinBox_valueChanged( double d ); - void on_mLabelColorButton_clicked(); + void on_mLabelColorButton_colorChanged( const QColor& newColor ); void on_mCircleModificationSpinBox_valueChanged( double d ); void on_mScaleDependentLabelsCheckBox_stateChanged( int state ); void on_mMaxScaleDenominatorEdit_textChanged( const QString & text ); diff --git a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp index 999e9dd988f..1450b78478f 100644 --- a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp +++ b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.cpp @@ -115,7 +115,7 @@ void QgsRuleBasedRendererV2Widget::addRule() QgsSymbolV2* s = QgsSymbolV2::defaultSymbol( mLayer->geometryType() ); QgsRuleBasedRendererV2::Rule* newrule = new QgsRuleBasedRendererV2::Rule( s ); - QgsRendererRulePropsDialog dlg( newrule, mLayer, mStyle ); + QgsRendererRulePropsDialog dlg( newrule, mLayer, mStyle, this ); if ( dlg.exec() ) { QgsRuleBasedRendererV2::Rule* current = currentRule(); @@ -159,7 +159,7 @@ void QgsRuleBasedRendererV2Widget::editRule( const QModelIndex& index ) return; QgsRuleBasedRendererV2::Rule* rule = mModel->ruleForIndex( index ); - QgsRendererRulePropsDialog dlg( rule, mLayer, mStyle ); + QgsRendererRulePropsDialog dlg( rule, mLayer, mStyle, this ); if ( dlg.exec() ) { // model should know about the change and emit dataChanged signal for the view @@ -478,10 +478,13 @@ void QgsRuleBasedRendererV2Widget::countFeatures() /////////// -QgsRendererRulePropsDialog::QgsRendererRulePropsDialog( QgsRuleBasedRendererV2::Rule* rule, QgsVectorLayer* layer, QgsStyleV2* style ) - : mRule( rule ), mLayer( layer ), mSymbolSelector( NULL ), mSymbol( NULL ) +QgsRendererRulePropsDialog::QgsRendererRulePropsDialog( QgsRuleBasedRendererV2::Rule* rule, QgsVectorLayer* layer, QgsStyleV2* style, QWidget* parent ) + : QDialog( parent ), mRule( rule ), mLayer( layer ), mSymbolSelector( NULL ), mSymbol( NULL ) { setupUi( this ); +#ifdef Q_WS_MAC + setWindowModality( Qt::WindowModal ); +#endif connect( buttonBox, SIGNAL( accepted() ), this, SLOT( accept() ) ); connect( buttonBox, SIGNAL( rejected() ), this, SLOT( reject() ) ); diff --git a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.h b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.h index d9228c081ce..2ad160a09cf 100644 --- a/src/gui/symbology-ng/qgsrulebasedrendererv2widget.h +++ b/src/gui/symbology-ng/qgsrulebasedrendererv2widget.h @@ -156,7 +156,7 @@ class GUI_EXPORT QgsRendererRulePropsDialog : public QDialog, private Ui::QgsRen Q_OBJECT public: - QgsRendererRulePropsDialog( QgsRuleBasedRendererV2::Rule* rule, QgsVectorLayer* layer, QgsStyleV2* style ); + QgsRendererRulePropsDialog( QgsRuleBasedRendererV2::Rule* rule, QgsVectorLayer* layer, QgsStyleV2* style, QWidget* parent = 0 ); ~QgsRendererRulePropsDialog(); QgsRuleBasedRendererV2::Rule* rule() { return mRule; } diff --git a/src/gui/symbology-ng/qgsstylev2managerdialog.cpp b/src/gui/symbology-ng/qgsstylev2managerdialog.cpp index d0aabda9685..60ad1cb5d8a 100644 --- a/src/gui/symbology-ng/qgsstylev2managerdialog.cpp +++ b/src/gui/symbology-ng/qgsstylev2managerdialog.cpp @@ -45,6 +45,9 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa : QDialog( parent ), mStyle( style ), mModified( false ) { setupUi( this ); +#ifdef Q_WS_MAC + setWindowModality( Qt::WindowModal ); +#endif QSettings settings; restoreGeometry( settings.value( "/Windows/StyleV2Manager/geometry" ).toByteArray() ); diff --git a/src/gui/symbology-ng/qgssymbollayerv2widget.cpp b/src/gui/symbology-ng/qgssymbollayerv2widget.cpp index 0b90d425bdf..b607ab95d11 100644 --- a/src/gui/symbology-ng/qgssymbollayerv2widget.cpp +++ b/src/gui/symbology-ng/qgssymbollayerv2widget.cpp @@ -52,7 +52,7 @@ QgsSimpleLineSymbolLayerV2Widget::QgsSimpleLineSymbolLayerV2Widget( const QgsVec setupUi( this ); connect( spinWidth, SIGNAL( valueChanged( double ) ), this, SLOT( penWidthChanged() ) ); - connect( btnChangeColor, SIGNAL( clicked() ), this, SLOT( colorChanged() ) ); + connect( btnChangeColor, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( colorChanged( const QColor& ) ) ); connect( cboPenStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( penStyleChanged() ) ); connect( spinOffset, SIGNAL( valueChanged( double ) ), this, SLOT( offsetChanged() ) ); connect( cboCapStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( penStyleChanged() ) ); @@ -83,6 +83,7 @@ void QgsSimpleLineSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer ) // set values spinWidth->setValue( mLayer->width() ); btnChangeColor->setColor( mLayer->color() ); + btnChangeColor->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); spinOffset->setValue( mLayer->offset() ); cboPenStyle->blockSignals( true ); cboJoinStyle->blockSignals( true ); @@ -117,20 +118,9 @@ void QgsSimpleLineSymbolLayerV2Widget::penWidthChanged() emit changed(); } -void QgsSimpleLineSymbolLayerV2Widget::colorChanged() +void QgsSimpleLineSymbolLayerV2Widget::colorChanged( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog | QColorDialog::ShowAlphaChannel ); -#else - QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::ShowAlphaChannel ); -#endif - if ( !color.isValid() ) - return; mLayer->setColor( color ); - btnChangeColor->setColor( mLayer->color() ); updatePatternIcon(); emit changed(); } @@ -241,8 +231,8 @@ QgsSimpleMarkerSymbolLayerV2Widget::QgsSimpleMarkerSymbolLayerV2Widget( const Qg } connect( lstNames, SIGNAL( currentRowChanged( int ) ), this, SLOT( setName() ) ); - connect( btnChangeColorBorder, SIGNAL( clicked() ), this, SLOT( setColorBorder() ) ); - connect( btnChangeColorFill, SIGNAL( clicked() ), this, SLOT( setColorFill() ) ); + connect( btnChangeColorBorder, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColorBorder( const QColor& ) ) ); + connect( btnChangeColorFill, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColorFill( const QColor& ) ) ); connect( spinSize, SIGNAL( valueChanged( double ) ), this, SLOT( setSize() ) ); connect( spinAngle, SIGNAL( valueChanged( double ) ), this, SLOT( setAngle() ) ); connect( spinOffsetX, SIGNAL( valueChanged( double ) ), this, SLOT( setOffset() ) ); @@ -268,7 +258,9 @@ void QgsSimpleMarkerSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer } } btnChangeColorBorder->setColor( mLayer->borderColor() ); + btnChangeColorBorder->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); btnChangeColorFill->setColor( mLayer->color() ); + btnChangeColorFill->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); spinSize->setValue( mLayer->size() ); spinAngle->setValue( mLayer->angle() ); @@ -299,37 +291,15 @@ void QgsSimpleMarkerSymbolLayerV2Widget::setName() emit changed(); } -void QgsSimpleMarkerSymbolLayerV2Widget::setColorBorder() +void QgsSimpleMarkerSymbolLayerV2Widget::setColorBorder( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor borderColor = QColorDialog::getColor( mLayer->borderColor(), this, "", QColorDialog::DontUseNativeDialog | QColorDialog::ShowAlphaChannel ); -#else - QColor borderColor = QColorDialog::getColor( mLayer->borderColor(), this, "", QColorDialog::ShowAlphaChannel ); -#endif - if ( !borderColor.isValid() ) - return; - mLayer->setBorderColor( borderColor ); - btnChangeColorBorder->setColor( mLayer->borderColor() ); + mLayer->setBorderColor( color ); emit changed(); } -void QgsSimpleMarkerSymbolLayerV2Widget::setColorFill() +void QgsSimpleMarkerSymbolLayerV2Widget::setColorFill( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog | QColorDialog::ShowAlphaChannel ); -#else - QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::ShowAlphaChannel ); -#endif - if ( !color.isValid() ) - return; mLayer->setColor( color ); - btnChangeColorFill->setColor( mLayer->color() ); emit changed(); } @@ -379,9 +349,9 @@ QgsSimpleFillSymbolLayerV2Widget::QgsSimpleFillSymbolLayerV2Widget( const QgsVec setupUi( this ); - connect( btnChangeColor, SIGNAL( clicked() ), this, SLOT( setColor() ) ); + connect( btnChangeColor, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColor( const QColor& ) ) ); connect( cboFillStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( setBrushStyle() ) ); - connect( btnChangeBorderColor, SIGNAL( clicked() ), this, SLOT( setBorderColor() ) ); + connect( btnChangeBorderColor, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setBorderColor( const QColor& ) ) ); connect( spinBorderWidth, SIGNAL( valueChanged( double ) ), this, SLOT( borderWidthChanged() ) ); connect( cboBorderStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( borderStyleChanged() ) ); connect( spinOffsetX, SIGNAL( valueChanged( double ) ), this, SLOT( offsetChanged() ) ); @@ -398,8 +368,10 @@ void QgsSimpleFillSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer ) // set values btnChangeColor->setColor( mLayer->color() ); + btnChangeColor->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); cboFillStyle->setBrushStyle( mLayer->brushStyle() ); btnChangeBorderColor->setColor( mLayer->borderColor() ); + btnChangeBorderColor->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); cboBorderStyle->setPenStyle( mLayer->borderStyle() ); spinBorderWidth->setValue( mLayer->borderWidth() ); spinOffsetX->blockSignals( true ); @@ -422,37 +394,15 @@ QgsSymbolLayerV2* QgsSimpleFillSymbolLayerV2Widget::symbolLayer() return mLayer; } -void QgsSimpleFillSymbolLayerV2Widget::setColor() +void QgsSimpleFillSymbolLayerV2Widget::setColor( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog | QColorDialog::ShowAlphaChannel ); -#else - QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::ShowAlphaChannel ); -#endif - if ( !color.isValid() ) - return; mLayer->setColor( color ); - btnChangeColor->setColor( mLayer->color() ); emit changed(); } -void QgsSimpleFillSymbolLayerV2Widget::setBorderColor() +void QgsSimpleFillSymbolLayerV2Widget::setBorderColor( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mLayer->borderColor(), this, "", QColorDialog::DontUseNativeDialog | QColorDialog::ShowAlphaChannel ); -#else - QColor color = QColorDialog::getColor( mLayer->borderColor(), this, "", QColorDialog::ShowAlphaChannel ); -#endif - if ( !color.isValid() ) - return; mLayer->setBorderColor( color ); - btnChangeBorderColor->setColor( mLayer->borderColor() ); emit changed(); } @@ -936,34 +886,26 @@ void QgsSvgMarkerSymbolLayerV2Widget::on_mFileLineEdit_editingFinished() emit changed(); } -void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeColorButton_clicked() +void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeColorButton_colorChanged( const QColor& color ) { if ( !mLayer ) { return; } - QColor c = QColorDialog::getColor( mLayer->fillColor() ); - if ( c.isValid() ) - { - mLayer->setFillColor( c ); - mChangeColorButton->setColor( c ); - emit changed(); - } + + mLayer->setFillColor( color ); + emit changed(); } -void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeBorderColorButton_clicked() +void QgsSvgMarkerSymbolLayerV2Widget::on_mChangeBorderColorButton_colorChanged( const QColor& color ) { if ( !mLayer ) { return; } - QColor c = QColorDialog::getColor( mLayer->outlineColor() ); - if ( c.isValid() ) - { - mLayer->setOutlineColor( c ); - mChangeBorderColorButton->setColor( c ); - emit changed(); - } + + mLayer->setOutlineColor( color ); + emit changed(); } void QgsSvgMarkerSymbolLayerV2Widget::on_mBorderWidthSpinBox_valueChanged( double d ) @@ -1011,7 +953,7 @@ QgsLineDecorationSymbolLayerV2Widget::QgsLineDecorationSymbolLayerV2Widget( cons setupUi( this ); - connect( btnChangeColor, SIGNAL( clicked() ), this, SLOT( colorChanged() ) ); + connect( btnChangeColor, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( colorChanged( const QColor& ) ) ); connect( spinWidth, SIGNAL( valueChanged( double ) ), this, SLOT( penWidthChanged() ) ); } @@ -1037,20 +979,9 @@ QgsSymbolLayerV2* QgsLineDecorationSymbolLayerV2Widget::symbolLayer() return mLayer; } -void QgsLineDecorationSymbolLayerV2Widget::colorChanged() +void QgsLineDecorationSymbolLayerV2Widget::colorChanged( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog ); -#else - QColor color = QColorDialog::getColor( mLayer->color(), this ); -#endif - if ( !color.isValid() ) - return; mLayer->setColor( color ); - btnChangeColor->setColor( mLayer->color() ); emit changed(); } @@ -1241,34 +1172,26 @@ void QgsSVGFillSymbolLayerWidget::updateParamGui() mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam ); } -void QgsSVGFillSymbolLayerWidget::on_mChangeColorButton_clicked() +void QgsSVGFillSymbolLayerWidget::on_mChangeColorButton_colorChanged( const QColor& color ) { if ( !mLayer ) { return; } - QColor c = QColorDialog::getColor( mLayer->svgFillColor() ); - if ( c.isValid() ) - { - mLayer->setSvgFillColor( c ); - mChangeColorButton->setColor( c ); - emit changed(); - } + + mLayer->setSvgFillColor( color ); + emit changed(); } -void QgsSVGFillSymbolLayerWidget::on_mChangeBorderColorButton_clicked() +void QgsSVGFillSymbolLayerWidget::on_mChangeBorderColorButton_colorChanged( const QColor& color ) { if ( !mLayer ) { return; } - QColor c = QColorDialog::getColor( mLayer->svgOutlineColor() ); - if ( c.isValid() ) - { - mLayer->setSvgOutlineColor( c ); - mChangeBorderColorButton->setColor( c ); - emit changed(); - } + + mLayer->setSvgOutlineColor( color ); + emit changed(); } void QgsSVGFillSymbolLayerWidget::on_mBorderWidthSpinBox_valueChanged( double d ) @@ -1377,18 +1300,15 @@ void QgsLinePatternFillSymbolLayerWidget::on_mOffsetSpinBox_valueChanged( double } } -void QgsLinePatternFillSymbolLayerWidget::on_mColorPushButton_clicked() +void QgsLinePatternFillSymbolLayerWidget::on_mColorPushButton_colorChanged( const QColor& color ) { - if ( mLayer ) + if ( !mLayer ) { - QColor c = QColorDialog::getColor( mLayer->color() ); - if ( c.isValid() ) - { - mLayer->setColor( c ); - mColorPushButton->setColor( c ); - emit changed(); - } + return; } + + mLayer->setColor( color ); + emit changed(); } void QgsLinePatternFillSymbolLayerWidget::on_mDistanceUnitComboBox_currentIndexChanged( int index ) @@ -1545,7 +1465,7 @@ QgsFontMarkerSymbolLayerV2Widget::QgsFontMarkerSymbolLayerV2Widget( const QgsVec connect( cboFont, SIGNAL( currentFontChanged( const QFont & ) ), this, SLOT( setFontFamily( const QFont& ) ) ); connect( spinSize, SIGNAL( valueChanged( double ) ), this, SLOT( setSize( double ) ) ); - connect( btnColor, SIGNAL( clicked() ), this, SLOT( setColor() ) ); + connect( btnColor, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColor( const QColor& ) ) ); connect( spinAngle, SIGNAL( valueChanged( double ) ), this, SLOT( setAngle( double ) ) ); connect( spinOffsetX, SIGNAL( valueChanged( double ) ), this, SLOT( setOffset() ) ); connect( spinOffsetY, SIGNAL( valueChanged( double ) ), this, SLOT( setOffset() ) ); @@ -1596,20 +1516,9 @@ void QgsFontMarkerSymbolLayerV2Widget::setFontFamily( const QFont& font ) emit changed(); } -void QgsFontMarkerSymbolLayerV2Widget::setColor() +void QgsFontMarkerSymbolLayerV2Widget::setColor( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mLayer->color(), this, "", QColorDialog::DontUseNativeDialog ); -#else - QColor color = QColorDialog::getColor( mLayer->color(), this ); -#endif - if ( !color.isValid() ) - return; mLayer->setColor( color ); - btnColor->setColor( mLayer->color() ); emit changed(); } diff --git a/src/gui/symbology-ng/qgssymbollayerv2widget.h b/src/gui/symbology-ng/qgssymbollayerv2widget.h index 58d34bde33f..3fa9df34970 100644 --- a/src/gui/symbology-ng/qgssymbollayerv2widget.h +++ b/src/gui/symbology-ng/qgssymbollayerv2widget.h @@ -62,7 +62,7 @@ class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widge public slots: void penWidthChanged(); - void colorChanged(); + void colorChanged( const QColor& color ); void penStyleChanged(); void offsetChanged(); void on_mCustomCheckBox_stateChanged( int state ); @@ -100,8 +100,8 @@ class GUI_EXPORT QgsSimpleMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Wid public slots: void setName(); - void setColorBorder(); - void setColorFill(); + void setColorBorder( const QColor& color ); + void setColorFill( const QColor& color ); void setSize(); void setAngle(); void setOffset(); @@ -132,8 +132,8 @@ class GUI_EXPORT QgsSimpleFillSymbolLayerV2Widget : public QgsSymbolLayerV2Widge virtual QgsSymbolLayerV2* symbolLayer(); public slots: - void setColor(); - void setBorderColor(); + void setColor( const QColor& color ); + void setBorderColor( const QColor& color ); void setBrushStyle(); void borderWidthChanged(); void borderStyleChanged(); @@ -208,8 +208,8 @@ class GUI_EXPORT QgsSvgMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widget void on_mFileToolButton_clicked(); void on_mFileLineEdit_textEdited( const QString& text ); void on_mFileLineEdit_editingFinished(); - void on_mChangeColorButton_clicked(); - void on_mChangeBorderColorButton_clicked(); + void on_mChangeColorButton_colorChanged( const QColor& color ); + void on_mChangeBorderColorButton_colorChanged( const QColor& color ); void on_mBorderWidthSpinBox_valueChanged( double d ); void on_mSizeUnitComboBox_currentIndexChanged( int index ); void on_mBorderWidthUnitComboBox_currentIndexChanged( int index ); @@ -245,7 +245,7 @@ class GUI_EXPORT QgsLineDecorationSymbolLayerV2Widget : public QgsSymbolLayerV2W virtual QgsSymbolLayerV2* symbolLayer(); public slots: - void colorChanged(); + void colorChanged( const QColor& color ); void penWidthChanged(); void on_mWidthUnitComboBox_currentIndexChanged( int index ); @@ -285,8 +285,8 @@ class GUI_EXPORT QgsSVGFillSymbolLayerWidget : public QgsSymbolLayerV2Widget, pr void setFile( const QModelIndex& item ); void populateIcons( const QModelIndex& item ); void on_mRotationSpinBox_valueChanged( double d ); - void on_mChangeColorButton_clicked(); - void on_mChangeBorderColorButton_clicked(); + void on_mChangeColorButton_colorChanged( const QColor& color ); + void on_mChangeBorderColorButton_colorChanged( const QColor& color ); void on_mBorderWidthSpinBox_valueChanged( double d ); void on_mTextureWidthUnitComboBox_currentIndexChanged( int index ); void on_mSvgOutlineWidthUnitComboBox_currentIndexChanged( int index ); @@ -318,7 +318,7 @@ class GUI_EXPORT QgsLinePatternFillSymbolLayerWidget : public QgsSymbolLayerV2Wi void on_mDistanceSpinBox_valueChanged( double d ); void on_mLineWidthSpinBox_valueChanged( double d ); void on_mOffsetSpinBox_valueChanged( double d ); - void on_mColorPushButton_clicked(); + void on_mColorPushButton_colorChanged( const QColor& color ); void on_mDistanceUnitComboBox_currentIndexChanged( int index ); void on_mLineWidthUnitComboBox_currentIndexChanged( int index ); void on_mOffsetUnitComboBox_currentIndexChanged( int index ); @@ -377,7 +377,7 @@ class GUI_EXPORT QgsFontMarkerSymbolLayerV2Widget : public QgsSymbolLayerV2Widge public slots: void setFontFamily( const QFont& font ); - void setColor(); + void setColor( const QColor& color ); void setSize( double size ); void setAngle( double angle ); void setCharacter( const QChar& chr ); diff --git a/src/gui/symbology-ng/qgssymbolslistwidget.cpp b/src/gui/symbology-ng/qgssymbolslistwidget.cpp index 4ba6025f854..ae83f43105d 100644 --- a/src/gui/symbology-ng/qgssymbolslistwidget.cpp +++ b/src/gui/symbology-ng/qgssymbolslistwidget.cpp @@ -99,12 +99,14 @@ QgsSymbolsListWidget::QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* sty // select correct page in stacked widget // there's a correspondence between symbol type number and page numbering => exploit it! stackedWidget->setCurrentIndex( symbol->type() ); - connect( btnColor, SIGNAL( clicked() ), this, SLOT( setSymbolColor() ) ); + connect( btnColor, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setSymbolColor( const QColor& ) ) ); connect( spinAngle, SIGNAL( valueChanged( double ) ), this, SLOT( setMarkerAngle( double ) ) ); connect( spinSize, SIGNAL( valueChanged( double ) ), this, SLOT( setMarkerSize( double ) ) ); connect( spinWidth, SIGNAL( valueChanged( double ) ), this, SLOT( setLineWidth( double ) ) ); - + // Live color updates are not undoable to child symbol layers + btnColor->setAcceptLiveUpdates( false ); + btnColor->setColorDialogOptions( QColorDialog::ShowAlphaChannel ); // Set symbol color in btnColor updateSymbolColor(); } @@ -182,21 +184,9 @@ void QgsSymbolsListWidget::openStyleManager() populateSymbolView(); } -void QgsSymbolsListWidget::setSymbolColor() +void QgsSymbolsListWidget::setSymbolColor( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mSymbol->color(), this, "", QColorDialog::DontUseNativeDialog ); -#else - QColor color = QColorDialog::getColor( mSymbol->color(), this ); -#endif - if ( !color.isValid() ) - return; - mSymbol->setColor( color ); - updateSymbolColor(); emit changed(); } @@ -287,7 +277,9 @@ void QgsSymbolsListWidget::displayTransparency( double alpha ) void QgsSymbolsListWidget::updateSymbolColor() { + btnColor->blockSignals( true ); btnColor->setColor( mSymbol->color() ); + btnColor->blockSignals( false ); } void QgsSymbolsListWidget::updateSymbolInfo() diff --git a/src/gui/symbology-ng/qgssymbolslistwidget.h b/src/gui/symbology-ng/qgssymbolslistwidget.h index b5935c3012f..0116e78985d 100644 --- a/src/gui/symbology-ng/qgssymbolslistwidget.h +++ b/src/gui/symbology-ng/qgssymbolslistwidget.h @@ -34,7 +34,7 @@ class GUI_EXPORT QgsSymbolsListWidget : public QWidget, private Ui::SymbolsListW public slots: void setSymbolFromStyle( const QModelIndex & index ); - void setSymbolColor(); + void setSymbolColor( const QColor& color ); void setMarkerAngle( double angle ); void setMarkerSize( double size ); void setLineWidth( double width ); diff --git a/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp b/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp index 2163600342d..8dff7e4e1a2 100644 --- a/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp +++ b/src/gui/symbology-ng/qgssymbolv2selectordialog.cpp @@ -142,6 +142,9 @@ class SymbolLayerItem : public QStandardItem QgsSymbolV2SelectorDialog::QgsSymbolV2SelectorDialog( QgsSymbolV2* symbol, QgsStyleV2* style, const QgsVectorLayer* vl, QWidget* parent, bool embedded ) : QDialog( parent ), mAdvancedMenu( NULL ), mVectorLayer( vl ) { +#ifdef Q_WS_MAC + setWindowModality( Qt::WindowModal ); +#endif mStyle = style; mSymbol = symbol; mPresentWidget = NULL; diff --git a/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp b/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp index f02b7401c79..96a725ddac2 100644 --- a/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp +++ b/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp @@ -17,21 +17,26 @@ #include "qgsvectorcolorrampv2.h" #include "qgsdialog.h" +#include "qgscolordialog.h" #include "qgscptcityarchive.h" #include #include #include +#include #include #include QgsVectorGradientColorRampV2Dialog::QgsVectorGradientColorRampV2Dialog( QgsVectorGradientColorRampV2* ramp, QWidget* parent ) - : QDialog( parent ), mRamp( ramp ) + : QDialog( parent ), mRamp( ramp ), mCurrentItem( 0 ) { setupUi( this ); +#ifdef Q_WS_MAC + setWindowModality( Qt::WindowModal ); +#endif - connect( btnColor1, SIGNAL( clicked() ), this, SLOT( setColor1() ) ); - connect( btnColor2, SIGNAL( clicked() ), this, SLOT( setColor2() ) ); + connect( btnColor1, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColor1( const QColor& ) ) ); + connect( btnColor2, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( setColor2( const QColor& ) ) ); // handle stops updateStops(); @@ -207,34 +212,14 @@ void QgsVectorGradientColorRampV2Dialog::updatePreview() btnColor2->setColor( mRamp->color2() ); } -void QgsVectorGradientColorRampV2Dialog::setColor1() +void QgsVectorGradientColorRampV2Dialog::setColor1( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mRamp->color1(), this, "", QColorDialog::DontUseNativeDialog ); -#else - QColor color = QColorDialog::getColor( mRamp->color1(), this ); -#endif - if ( !color.isValid() ) - return; mRamp->setColor1( color ); updatePreview(); } -void QgsVectorGradientColorRampV2Dialog::setColor2() +void QgsVectorGradientColorRampV2Dialog::setColor2( const QColor& color ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( mRamp->color2(), this, "", QColorDialog::DontUseNativeDialog ); -#else - QColor color = QColorDialog::getColor( mRamp->color2(), this ); -#endif - if ( !color.isValid() ) - return; mRamp->setColor2( color ); updatePreview(); } @@ -252,7 +237,7 @@ void QgsVectorGradientColorRampV2Dialog::setStopColor( QTreeWidgetItem* item, QC p.setPen( Qt::NoPen ); p.setRenderHint( QPainter::Antialiasing ); p.setBrush( color ); - p.drawRoundedRect( rect, 4, 4 ); + p.drawRoundedRect( rect, 2, 2 ); p.end(); item->setIcon( 0, QIcon( pixmap ) ); @@ -260,18 +245,32 @@ void QgsVectorGradientColorRampV2Dialog::setStopColor( QTreeWidgetItem* item, QC item->setText( 0, color.name() ); } +void QgsVectorGradientColorRampV2Dialog::setItemStopColor( const QColor& newColor ) +{ + if ( mCurrentItem ) + { + setStopColor( mCurrentItem, newColor ); + updatePreview(); + } +} + void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* item, int column ) { if ( column == 0 ) { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // FIXME need to also check max QT_VERSION when Qt bug fixed - QColor color = QColorDialog::getColor( item->data( 0, StopColorRole ).value(), this, "", QColorDialog::DontUseNativeDialog ); -#else - QColor color = QColorDialog::getColor( item->data( 0, StopColorRole ).value(), this ); -#endif + QColor color; + + QSettings settings; + if ( settings.value( "/qgis/live_color_dialogs", false ).toBool() ) + { + mCurrentItem = item; + color = QgsColorDialog::getLiveColor( item->data( 0, StopColorRole ).value(), this, "setItemStopColor( const QColor& )", this ); + mCurrentItem = 0; + } + else + { + color = QColorDialog::getColor( item->data( 0, StopColorRole ).value(), this ); + } if ( !color.isValid() ) return; setStopColor( item, color ); @@ -310,19 +309,19 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite void QgsVectorGradientColorRampV2Dialog::addStop() { -#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA) - // Native Mac dialog works only for Qt Carbon - // Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 - // also Qt 4.7 Mac Cocoa bug: calling QInputDialog::getInt after QColorDialog::getColor will freeze app - // workaround: call QColorDialog::getColor below instead of here, - // but not needed at this time because of the other Qt bug - // FIXME need to also check max QT_VERSION when Qt bug(s) fixed - QColor color = QColorDialog::getColor( QColor(), this, "", QColorDialog::DontUseNativeDialog ); -#else +// Native Mac dialog works only for Qt Carbon +// Qt bug: http://bugreports.qt.nokia.com/browse/QTBUG-14889 +// Qt 4.7 Mac Cocoa bug: calling QInputDialog::getInt after QColorDialog::getColor will freeze app +// workaround: call QColorDialog::getColor below instead of here, +// but not needed at this time because of the other Qt bug +// FIXME need to also check max QT_VERSION when Qt bug(s) fixed +#ifndef Q_WS_MAC QColor color = QColorDialog::getColor( QColor(), this ); -#endif + if ( !color.isValid() ) return; + activateWindow(); +#endif bool ok; double val = 50.0; @@ -341,11 +340,20 @@ void QgsVectorGradientColorRampV2Dialog::addStop() #endif if ( !ok ) return; + activateWindow(); double key = val / 100.0; QStringList lst; lst << "." << QString(( val < 10 ) ? '0' + QString::number( val ) : QString::number( val ) ); +#ifdef Q_WS_MAC + QColor color = QColorDialog::getColor( QColor(), this ); + + if ( !color.isValid() ) + return; + activateWindow(); +#endif + QTreeWidgetItem* item = new QTreeWidgetItem( lst ); setStopColor( item, color ); diff --git a/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.h b/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.h index c1bd28aa030..c1dd713ada7 100644 --- a/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.h +++ b/src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.h @@ -30,14 +30,15 @@ class GUI_EXPORT QgsVectorGradientColorRampV2Dialog : public QDialog, private Ui QgsVectorGradientColorRampV2Dialog( QgsVectorGradientColorRampV2* ramp, QWidget* parent = NULL ); public slots: - void setColor1(); - void setColor2(); + void setColor1( const QColor& color ); + void setColor2( const QColor& color ); void toggledStops( bool on ); void addStop(); void removeStop(); void stopDoubleClicked( QTreeWidgetItem* item, int column ); + void setItemStopColor( const QColor& newColor ); protected slots: void on_cboType_currentIndexChanged( int index ); @@ -53,6 +54,8 @@ class GUI_EXPORT QgsVectorGradientColorRampV2Dialog : public QDialog, private Ui static const int StopColorRole = Qt::UserRole + 1; static const int StopOffsetRole = Qt::UserRole + 2; + + QTreeWidgetItem* mCurrentItem; }; #endif diff --git a/src/plugins/grass/qgsgrassregion.cpp b/src/plugins/grass/qgsgrassregion.cpp index 56e968c5d6c..d1087e27a17 100644 --- a/src/plugins/grass/qgsgrassregion.cpp +++ b/src/plugins/grass/qgsgrassregion.cpp @@ -273,23 +273,17 @@ QgsGrassRegion::QgsGrassRegion( QgsGrassPlugin *plugin, QgisInterface *iface, // Symbology QPen pen = mPlugin->regionPen(); mColorButton->setColor( pen.color() ); - connect( mColorButton, SIGNAL( clicked() ), this, SLOT( changeColor() ) ); + connect( mColorButton, SIGNAL( colorChanged( const QColor& ) ), this, SLOT( changeColor( const QColor& ) ) ); mWidthSpinBox->setValue( pen.width() ); connect( mWidthSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( changeWidth() ) ); } -void QgsGrassRegion::changeColor( void ) +void QgsGrassRegion::changeColor( const QColor& color ) { QPen pen = mPlugin->regionPen(); - QColor color = QColorDialog::getColor( pen.color(), this ); - if ( color.isValid() ) - { - mColorButton->setColor( color ); - - pen.setColor( color ); - mPlugin->setRegionPen( pen ); - } + pen.setColor( color ); + mPlugin->setRegionPen( pen ); } void QgsGrassRegion::changeWidth( void ) diff --git a/src/plugins/grass/qgsgrassregion.h b/src/plugins/grass/qgsgrassregion.h index 5e5922c5f6f..b92566e7f9d 100644 --- a/src/plugins/grass/qgsgrassregion.h +++ b/src/plugins/grass/qgsgrassregion.h @@ -81,7 +81,7 @@ class QgsGrassRegion: public QDialog, private Ui::QgsGrassRegionBase void radioChanged( void ) ; - void changeColor( void ) ; + void changeColor( const QColor& color ) ; void changeWidth( void ) ; void restorePosition( void ); diff --git a/src/plugins/grass/qgsgrassregionbase.ui b/src/plugins/grass/qgsgrassregionbase.ui index f9484adcc5e..bccb282afb3 100644 --- a/src/plugins/grass/qgsgrassregionbase.ui +++ b/src/plugins/grass/qgsgrassregionbase.ui @@ -7,7 +7,7 @@ 0 0 445 - 388 + 397 @@ -172,19 +172,6 @@ or change the following values - - - - - 35 - 25 - - - - - - - @@ -211,6 +198,25 @@ or change the following values + + + + + 64 + 0 + + + + + 100 + 16777215 + + + + + + + @@ -228,8 +234,8 @@ or change the following values - QgsColorButton - QWidget + QgsColorButtonV2 + QPushButton
qgscolorbutton.h
diff --git a/src/ui/qgsannotationwidgetbase.ui b/src/ui/qgsannotationwidgetbase.ui index 413508ce298..ffa7d6baada 100644 --- a/src/ui/qgsannotationwidgetbase.ui +++ b/src/ui/qgsannotationwidgetbase.ui @@ -6,8 +6,8 @@ 0 0 - 180 - 151 + 221 + 172 @@ -23,6 +23,20 @@ + + + + + + + + + + + Background color + + + @@ -33,6 +47,13 @@ + + + + + + + @@ -53,50 +74,11 @@ - - - - Background color - - - mBackgroundColorButton - - - - - - - - 0 - 0 - - - - - - - Frame color - - mFrameColorButton - - - - - - - - 0 - 0 - - - - - @@ -106,7 +88,7 @@ QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
diff --git a/src/ui/qgscategorizedsymbolrendererv2widget.ui b/src/ui/qgscategorizedsymbolrendererv2widget.ui index ded019ff880..1d9a3e911fe 100644 --- a/src/ui/qgscategorizedsymbolrendererv2widget.ui +++ b/src/ui/qgscategorizedsymbolrendererv2widget.ui @@ -66,7 +66,7 @@
- change + Change... diff --git a/src/ui/qgscomposerarrowwidgetbase.ui b/src/ui/qgscomposerarrowwidgetbase.ui index 6959035257b..0d63463856c 100644 --- a/src/ui/qgscomposerarrowwidgetbase.ui +++ b/src/ui/qgscomposerarrowwidgetbase.ui @@ -104,7 +104,7 @@ - + 0 @@ -112,7 +112,7 @@ - Arrow color... + Color... @@ -214,6 +214,11 @@ + + QgsColorButton + QPushButton +
qgscolorbutton.h
+
QgsCollapsibleGroupBoxBasic QGroupBox diff --git a/src/ui/qgscomposeritemwidgetbase.ui b/src/ui/qgscomposeritemwidgetbase.ui index 4c91e9224a2..50cc39ed9a6 100644 --- a/src/ui/qgscomposeritemwidgetbase.ui +++ b/src/ui/qgscomposeritemwidgetbase.ui @@ -231,36 +231,35 @@ true - - - + + + QFormLayout::AllNonFixedFieldsGrow + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + - Frame color... + Thickness + + + true + + + mOutlineWidthSpinBox - - - - QFormLayout::AllNonFixedFieldsGrow + + + + + + + Color... - - - - Thickness - - - true - - - mOutlineWidthSpinBox - - - - - - - + @@ -270,9 +269,6 @@ Background - - false - true @@ -285,51 +281,14 @@ true - + - + - Background color... + Color... - - - - - - Transparency - - - true - - - mTransparencySlider - - - - - - - 100 - - - Qt::Horizontal - - - - - - - % - - - 100 - - - - - @@ -397,6 +356,11 @@ + + QgsColorButton + QPushButton +
qgscolorbutton.h
+
QgsCollapsibleGroupBoxBasic QGroupBox diff --git a/src/ui/qgscomposertablewidgetbase.ui b/src/ui/qgscomposertablewidgetbase.ui index 61ddf763118..f0c6e9930d6 100644 --- a/src/ui/qgscomposertablewidgetbase.ui +++ b/src/ui/qgscomposertablewidgetbase.ui @@ -187,35 +187,10 @@ - - - - Color - - - true - - - mGridColorButton - - - - + - - - 0 - 0 - - - - - 100 - 16777215 - - - + Color... @@ -265,17 +240,17 @@ + + QgsColorButton + QPushButton +
qgscolorbutton.h
+
QgsCollapsibleGroupBoxBasic QGroupBox
qgscollapsiblegroupbox.h
1
- - QgsColorButton - QToolButton -
qgscolorbutton.h
-
diff --git a/src/ui/qgscompositionwidgetbase.ui b/src/ui/qgscompositionwidgetbase.ui index 1cd976da107..ff8350fc7fd 100644 --- a/src/ui/qgscompositionwidgetbase.ui +++ b/src/ui/qgscompositionwidgetbase.ui @@ -297,6 +297,16 @@ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + Spacing + + + true + + + @@ -368,44 +378,6 @@ - - - Grid color - - - true - - - mGridColorButton - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - - - - - Grid style @@ -418,7 +390,7 @@ - + @@ -441,13 +413,10 @@ - - + + - Spacing - - - true + Color... @@ -516,17 +485,17 @@ + + QgsColorButton + QPushButton +
qgscolorbutton.h
+
QgsCollapsibleGroupBoxBasic QGroupBox
qgscollapsiblegroupbox.h
1
- - QgsColorButton - QToolButton -
qgscolorbutton.h
-
scrollArea diff --git a/src/ui/qgscontinuouscolordialogbase.ui b/src/ui/qgscontinuouscolordialogbase.ui index 4cbbf42f692..58ab13941a6 100644 --- a/src/ui/qgscontinuouscolordialogbase.ui +++ b/src/ui/qgscontinuouscolordialogbase.ui @@ -6,7 +6,7 @@ 0 0 - 256 + 263 175 @@ -64,19 +64,6 @@ Minimum value - - btnMinValue - - -
- - - - - 100 - 0 - - @@ -90,19 +77,6 @@ Maximum value - - btnMaxValue - - - - - - - - 100 - 0 - - @@ -144,20 +118,32 @@ + + + + + + + + + + + + + + QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
classificationComboBox - btnMinValue - btnMaxValue outlinewidthspinbox cb_polygonOutline diff --git a/src/ui/qgsdecorationcopyrightdialog.ui b/src/ui/qgsdecorationcopyrightdialog.ui index 6d0044fd182..4c708a33fff 100644 --- a/src/ui/qgsdecorationcopyrightdialog.ui +++ b/src/ui/qgsdecorationcopyrightdialog.ui @@ -45,8 +45,8 @@ <!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:10pt; 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';">© QGIS 2009</span></p></body></html> +</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; 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 2009</span></p></body></html>
@@ -111,26 +111,7 @@ p, li { white-space: pre-wrap; } - &Color - - - pbnColorChooser - - - - - - - - 0 - 0 - - - - - 100 - 0 - + Color @@ -144,13 +125,20 @@ p, li { white-space: pre-wrap; }
+ + + + + + + QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
@@ -159,7 +147,6 @@ p, li { white-space: pre-wrap; } txtCopyrightText cboPlacement cboOrientation - pbnColorChooser buttonBox diff --git a/src/ui/qgsdecorationscalebardialog.ui b/src/ui/qgsdecorationscalebardialog.ui index 6b896aea58b..58a38632220 100644 --- a/src/ui/qgsdecorationscalebardialog.ui +++ b/src/ui/qgsdecorationscalebardialog.ui @@ -125,28 +125,6 @@ Color of bar - - pbnChangeColor - - - - - - - - 0 - 0 - - - - Click to select the color - - - Click to select the color - - - - @@ -217,20 +195,26 @@ + + + + + + + QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
cboPlacement cboStyle - pbnChangeColor spnSize chkEnable chkSnapping diff --git a/src/ui/qgsdiagrampropertiesbase.ui b/src/ui/qgsdiagrampropertiesbase.ui index 096f1e85490..83194bfe104 100644 --- a/src/ui/qgsdiagrampropertiesbase.ui +++ b/src/ui/qgsdiagrampropertiesbase.ui @@ -39,8 +39,8 @@ 0 0 - 756 - 627 + 752 + 613 @@ -124,8 +124,8 @@ 0 0 - 723 - 356 + 713 + 364 @@ -204,25 +204,6 @@ - - - - - 0 - 0 - - - - - 25 - 0 - - - - - - - @@ -233,25 +214,6 @@ - - - - - 0 - 0 - - - - - 25 - 0 - - - - - - - @@ -262,6 +224,20 @@ + + + + + + + + + + + + + + @@ -334,8 +310,8 @@ 0 0 - 640 - 289 + 715 + 318 @@ -523,8 +499,8 @@ 0 0 - 216 - 284 + 713 + 271 @@ -685,8 +661,8 @@ 0 0 - 137 - 191 + 728 + 166 @@ -979,7 +955,7 @@ QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
diff --git a/src/ui/qgsgraduatedsymbolrendererv2widget.ui b/src/ui/qgsgraduatedsymbolrendererv2widget.ui index 900711a26a4..9fe0050c7e0 100644 --- a/src/ui/qgsgraduatedsymbolrendererv2widget.ui +++ b/src/ui/qgsgraduatedsymbolrendererv2widget.ui @@ -45,7 +45,7 @@ - change + Change...
diff --git a/src/ui/qgslabelingguibase.ui b/src/ui/qgslabelingguibase.ui index 1c56631e007..76a6aeaceaa 100644 --- a/src/ui/qgslabelingguibase.ui +++ b/src/ui/qgslabelingguibase.ui @@ -134,12 +134,6 @@ 0 - - - 0 - 0 - - 0 @@ -288,24 +282,6 @@ - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - Sample text @@ -408,24 +384,27 @@ + + + 0 + 0 + + - 48 + 64 0 - 16777215 - 22 + 64 + 16777215 Sample background color - - ... - @@ -442,12 +421,6 @@ QFrame::NoFrame - - QFrame::Plain - - - 0 - true @@ -456,31 +429,16 @@ 0 0 - 686 - 834 + 689 + 826 6 - - 20 - - - - 0 - 0 - - - - - 16777215 - 16777215 - - Formatted numbers @@ -702,18 +660,6 @@ - - - 0 - 0 - - - - - 16777215 - 16777215 - - Text style @@ -909,19 +855,22 @@ - + 0 0 - 32 + 64 0 - - ... + + + 64 + 16777215 + @@ -990,7 +939,7 @@ - 32 + 36 0 @@ -1195,18 +1144,6 @@ - - - 0 - 0 - - - - - 16777215 - 16777215 - - Buffer @@ -1330,19 +1267,22 @@ - + 0 0 - 32 + 64 0 - - ... + + + 64 + 16777215 + @@ -1602,24 +1542,6 @@ - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - Scale-based visibility @@ -1999,12 +1921,6 @@ - - - 16777215 - 16777215 - - Priority @@ -2056,18 +1972,6 @@ - - - 0 - 0 - - - - - 16777215 - 16777215 - - Placement @@ -2819,12 +2723,6 @@ - - - 16777215 - 16777215 - - Options @@ -3335,12 +3233,6 @@ - - - 0 - 0 - - Font properties @@ -3579,7 +3471,7 @@
QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
diff --git a/src/ui/qgslabelpropertydialogbase.ui b/src/ui/qgslabelpropertydialogbase.ui index 7ac874f7004..5e00c2a662d 100644 --- a/src/ui/qgslabelpropertydialogbase.ui +++ b/src/ui/qgslabelpropertydialogbase.ui @@ -34,19 +34,6 @@ Font - - - - - 0 - 0 - - - - - - - @@ -81,6 +68,19 @@ + + + + + 100 + 16777215 + + + + + + + @@ -197,11 +197,11 @@ - - - 0 - 0 - + + + 100 + 16777215 + @@ -370,7 +370,7 @@ QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
diff --git a/src/ui/qgsoptionsbase.ui b/src/ui/qgsoptionsbase.ui index 312f32fad3e..02499d585f7 100644 --- a/src/ui/qgsoptionsbase.ui +++ b/src/ui/qgsoptionsbase.ui @@ -267,7 +267,7 @@ 0 0 654 - 612 + 642
@@ -594,6 +594,17 @@
+ + + + + + Use live-updating color chooser dialogs + + + + + @@ -901,7 +912,7 @@ 0 0 - 654 + 611 808 @@ -997,7 +1008,7 @@ - falsetrue + 0 @@ -1007,6 +1018,12 @@ Current environment variables (read-only - bold indicates modified at startup) + + false + + + true + @@ -1231,8 +1248,8 @@ 0 0 - 669 - 490 + 559 + 417 @@ -1549,8 +1566,8 @@ 0 - -291 - 654 + 0 + 615 781 @@ -2081,8 +2098,8 @@ 0 0 - 669 - 490 + 474 + 390 @@ -2091,7 +2108,58 @@ Default map appearance (overridden by project properties) - + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Background color + + + @@ -2105,58 +2173,31 @@ - - - - - 100 - 0 - - - - - - - - - + + - + 0 0 - - Background color - - - - - 100 0 + + + 100 + 16777215 + + - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -2392,8 +2433,8 @@ 0 0 - 654 - 718 + 556 + 712 @@ -2476,19 +2517,6 @@ - - - - - 100 - 0 - - - - - - - @@ -2575,6 +2603,31 @@ + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + + + + @@ -2772,8 +2825,8 @@ 0 0 - 654 - 643 + 517 + 642 @@ -2881,19 +2934,6 @@ - - - - - 100 - 0 - - - - - - - @@ -2907,6 +2947,31 @@ + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + + + + @@ -3261,8 +3326,8 @@ 0 0 - 669 - 490 + 537 + 361 @@ -3401,8 +3466,8 @@ 0 0 - 669 - 490 + 614 + 393 @@ -3582,8 +3647,8 @@ 0 0 - 669 - 490 + 300 + 248 @@ -3682,7 +3747,7 @@ 0 0 - 654 + 521 650 @@ -3790,7 +3855,7 @@ - falsetrue + Use proxy for web access @@ -3800,6 +3865,12 @@ true + + false + + + true + @@ -3995,17 +4066,17 @@ + + QgsColorButton + QPushButton +
qgscolorbutton.h
+
QgsCollapsibleGroupBox QGroupBox
qgscollapsiblegroupbox.h
1
- - QgsColorButton - QToolButton -
qgscolorbutton.h
-
diff --git a/src/ui/qgspointdisplacementrendererwidgetbase.ui b/src/ui/qgspointdisplacementrendererwidgetbase.ui index c8eaf58f5cc..57d3065a2db 100644 --- a/src/ui/qgspointdisplacementrendererwidgetbase.ui +++ b/src/ui/qgspointdisplacementrendererwidgetbase.ui @@ -6,8 +6,8 @@ 0 0 - 327 - 505 + 383 + 532 @@ -84,12 +84,6 @@
- - - 0 - 0 - - @@ -194,12 +188,6 @@ - - - 0 - 0 - - @@ -236,7 +224,7 @@ QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
diff --git a/src/ui/qgsprojectpropertiesbase.ui b/src/ui/qgsprojectpropertiesbase.ui index 4dc848d8f34..3f3341c8114 100644 --- a/src/ui/qgsprojectpropertiesbase.ui +++ b/src/ui/qgsprojectpropertiesbase.ui @@ -50,8 +50,8 @@ 0 0 - 600 - 497 + 558 + 668 @@ -107,19 +107,6 @@
- - - - - 100 - 0 - - - - - - - @@ -143,19 +130,6 @@ - - - - - 100 - 0 - - - - - - - @@ -193,6 +167,32 @@ + + + + + 100 + 0 + + + + + + + + + + + + 100 + 0 + + + + + + +
@@ -212,7 +212,7 @@ - + @@ -836,14 +836,14 @@ 0 - 0 - 600 - 1085 + -891 + 617 + 1260 - falsetrue + Service Capabilitities @@ -853,6 +853,12 @@ false + + false + + + true + @@ -979,7 +985,7 @@ - falsetrue + Advertised Extent @@ -989,6 +995,12 @@ false + + false + + + true + @@ -1082,7 +1094,7 @@ - falsetrue + Coordinate Systems Restrictions @@ -1092,6 +1104,12 @@ false + + false + + + true + @@ -1121,7 +1139,7 @@ - falsetrue + Exclude composers @@ -1131,6 +1149,12 @@ false + + false + + + true + @@ -1174,7 +1198,7 @@ - falsetrue + Exclude layers @@ -1184,6 +1208,12 @@ false + + false + + + true + @@ -1388,21 +1418,21 @@ QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
- - QgsProjectionSelector - QWidget -
qgsprojectionselector.h
- 1 -
QgsCollapsibleGroupBox QGroupBox
qgscollapsiblegroupbox.h
1
+ + QgsProjectionSelector + QWidget +
qgsprojectionselector.h
+ 1 +
titleEdit @@ -1437,7 +1467,6 @@ - diff --git a/src/ui/qgssinglesymboldialogbase.ui b/src/ui/qgssinglesymboldialogbase.ui index 3f8fe14ea12..60a1937eda6 100644 --- a/src/ui/qgssinglesymboldialogbase.ui +++ b/src/ui/qgssinglesymboldialogbase.ui @@ -6,16 +6,10 @@ 0 0 - 337 + 372 620 - - - 0 - 0 - - Single Symbol @@ -32,9 +26,9 @@ 0 - 0 - 335 - 618 + -37 + 358 + 640 @@ -200,19 +194,22 @@ - 32 + 80 0 - 32 + 80 16777215 + + false +
@@ -275,19 +272,22 @@ - 32 + 80 0 - 32 + 80 16777215 + + false +
@@ -412,7 +412,7 @@ QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
diff --git a/src/ui/qgstextannotationdialogbase.ui b/src/ui/qgstextannotationdialogbase.ui index 1959f2590cf..c2ad02a70c0 100644 --- a/src/ui/qgstextannotationdialogbase.ui +++ b/src/ui/qgstextannotationdialogbase.ui @@ -37,6 +37,12 @@
+ + + 50 + 0 + + B @@ -47,6 +53,12 @@ + + + 50 + 0 + + I @@ -57,15 +69,12 @@ - - - 0 - 0 - - + + false +
@@ -97,7 +106,7 @@ QgsColorButton - QToolButton + QPushButton
qgscolorbutton.h
diff --git a/src/ui/qgsvectorgradientcolorrampv2dialogbase.ui b/src/ui/qgsvectorgradientcolorrampv2dialogbase.ui index 82717abef1a..33d3a6deca2 100644 --- a/src/ui/qgsvectorgradientcolorrampv2dialogbase.ui +++ b/src/ui/qgsvectorgradientcolorrampv2dialogbase.ui @@ -7,7 +7,7 @@ 0 0 400 - 364 + 379 @@ -26,10 +26,13 @@
- - + + - Change + Color 2 + + + btnColor2 @@ -49,30 +52,6 @@ - - - - Color 2 - - - btnColor2 - - - - - - - Change - - - - - - - Type - - - @@ -89,6 +68,27 @@ + + + + Change... + + + + + + + Type + + + + + + + Change... + + +
@@ -109,21 +109,7 @@ false - - - - Add stop - - - - - - - Remove stop - - - - + false @@ -143,6 +129,20 @@ + + + + Add stop + + + + + + + Remove stop + + +
@@ -193,7 +193,7 @@
- QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
@@ -204,7 +204,6 @@ groupStops treeStops btnAddStop - btnRemoveStop diff --git a/src/ui/symbollayer/widget_ellipse.ui b/src/ui/symbollayer/widget_ellipse.ui index 48538d143bd..b8535bd5d63 100644 --- a/src/ui/symbollayer/widget_ellipse.ui +++ b/src/ui/symbollayer/widget_ellipse.ui @@ -35,16 +35,16 @@
- + - Change + Change... - + - Change + Change... @@ -317,7 +317,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_fontmarker.ui b/src/ui/symbollayer/widget_fontmarker.ui index a787a206b02..1d85b28e6e9 100644 --- a/src/ui/symbollayer/widget_fontmarker.ui +++ b/src/ui/symbollayer/widget_fontmarker.ui @@ -131,9 +131,9 @@
- + - Change + Change... @@ -194,7 +194,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_linedecoration.ui b/src/ui/symbollayer/widget_linedecoration.ui index 317b8f240ec..dbaaedb1ade 100644 --- a/src/ui/symbollayer/widget_linedecoration.ui +++ b/src/ui/symbollayer/widget_linedecoration.ui @@ -27,7 +27,7 @@
- + 0 @@ -35,7 +35,7 @@ - Change + Change... @@ -102,7 +102,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_linepatternfill.ui b/src/ui/symbollayer/widget_linepatternfill.ui index 00a2b0cae11..00c238355d2 100644 --- a/src/ui/symbollayer/widget_linepatternfill.ui +++ b/src/ui/symbollayer/widget_linepatternfill.ui @@ -41,9 +41,9 @@ - + - Change + Change... @@ -176,7 +176,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_simplefill.ui b/src/ui/symbollayer/widget_simplefill.ui index 59552a78a63..af9b08dcc9c 100644 --- a/src/ui/symbollayer/widget_simplefill.ui +++ b/src/ui/symbollayer/widget_simplefill.ui @@ -20,9 +20,9 @@ - + - Change + Change... @@ -41,9 +41,9 @@ - + - Change + Change... @@ -182,7 +182,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_simpleline.ui b/src/ui/symbollayer/widget_simpleline.ui index adcd3b65f88..e0644d082f3 100644 --- a/src/ui/symbollayer/widget_simpleline.ui +++ b/src/ui/symbollayer/widget_simpleline.ui @@ -6,23 +6,16 @@ 0 0 - 331 - 235 + 395 + 276 Form - - - - Color - - - - + 0 @@ -30,7 +23,14 @@ - Change + Change... + + + + + + + Color @@ -41,6 +41,13 @@ + + + + Join style + + + @@ -106,56 +113,9 @@ - - - - - 0 - 0 - - - - - Millimeter - - - - - Map unit - - - - - - - - Pen style - - - - - - - - - - Join style - - - - - - - Cap style - - - - - - @@ -177,6 +137,36 @@ + + + + + + + Pen style + + + + + + + + 0 + 0 + + + + + Millimeter + + + + + Map unit + + + + @@ -198,11 +188,34 @@ + + + + + + + Cap style + + + + + + + Qt::Vertical + + + + 20 + 40 + + + +
- QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_simplemarker.ui b/src/ui/symbollayer/widget_simplemarker.ui index e7e26501248..53e7bb05d4e 100644 --- a/src/ui/symbollayer/widget_simplemarker.ui +++ b/src/ui/symbollayer/widget_simplemarker.ui @@ -40,9 +40,9 @@ - + - Change + Change... @@ -126,9 +126,9 @@ - + - Change + Change... @@ -225,7 +225,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_svgfill.ui b/src/ui/symbollayer/widget_svgfill.ui index 82e036d6328..eb3487f048c 100644 --- a/src/ui/symbollayer/widget_svgfill.ui +++ b/src/ui/symbollayer/widget_svgfill.ui @@ -51,9 +51,9 @@ - + - Change + Change... @@ -65,9 +65,9 @@ - + - Change + Change... @@ -191,7 +191,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_svgmarker.ui b/src/ui/symbollayer/widget_svgmarker.ui index e8ca2d0d1f3..f46f18afef1 100644 --- a/src/ui/symbollayer/widget_svgmarker.ui +++ b/src/ui/symbollayer/widget_svgmarker.ui @@ -54,9 +54,9 @@ - + - Change + Change... @@ -82,9 +82,9 @@ - + - Change + Change... @@ -290,7 +290,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h
diff --git a/src/ui/symbollayer/widget_symbolslist.ui b/src/ui/symbollayer/widget_symbolslist.ui index 4119214ba80..a3304bd6b93 100644 --- a/src/ui/symbollayer/widget_symbolslist.ui +++ b/src/ui/symbollayer/widget_symbolslist.ui @@ -85,9 +85,9 @@ - + - Change + Change... @@ -353,7 +353,7 @@ - QgsColorButtonV2 + QgsColorButton QPushButton
qgscolorbutton.h