Skip to content

Commit

Permalink
[labeling] use QgsColorButtonV2 for label property dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
slarosa committed Dec 2, 2014
1 parent 2eb0ca3 commit d034a66
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 53 deletions.
3 changes: 2 additions & 1 deletion src/app/qgslabelpropertydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ void QgsLabelPropertyDialog::init( const QString& layerId, int featureId, const
updateFont( mLabelFont, false );

//set all the gui elements to the default layer-level values
mBufferColorButton->setColor( layerSettings.textColor );
mFontColorButton->setColor( layerSettings.textColor );
mBufferColorButton->setColor( layerSettings.bufferColor );
mLabelDistanceSpinBox->setValue( layerSettings.dist );
mBufferSizeSpinBox->setValue( layerSettings.bufferSize );
mMinScaleSpinBox->setValue( layerSettings.scaleMin );
Expand Down
128 changes: 76 additions & 52 deletions src/ui/qgslabelpropertydialogbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -34,60 +34,13 @@
<string>Font</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1" colspan="2">
<widget class="QComboBox" name="mFontStyleCmbBx">
<property name="toolTip">
<string>Available typeface styles</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QgsColorButton" name="mFontColorButton">
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QFontComboBox" name="mFontFamilyCmbBx">
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="mFontSizeLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="mFontSizeSpinBox">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<double>999999.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
Expand All @@ -101,6 +54,13 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="mFontStyleCmbBx">
<property name="toolTip">
<string>Available typeface styles</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
Expand Down Expand Up @@ -255,6 +215,58 @@
</item>
</layout>
</item>
<item row="3" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="mFontSizeLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Size</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="mFontSizeSpinBox">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum">
<double>999999.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="2">
<widget class="QgsColorButtonV2" name="mFontColorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down Expand Up @@ -370,10 +382,22 @@
</layout>
</item>
<item row="0" column="1">
<widget class="QgsColorButton" name="mBufferColorButton">
<widget class="QgsColorButtonV2" name="mBufferColorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<width>120</width>
<height>16777215</height>
</size>
</property>
Expand Down Expand Up @@ -543,9 +567,9 @@
</widget>
<customwidgets>
<customwidget>
<class>QgsColorButton</class>
<extends>QPushButton</extends>
<header>qgscolorbutton.h</header>
<class>QgsColorButtonV2</class>
<extends>QToolButton</extends>
<header>qgscolorbuttonv2.h</header>
</customwidget>
</customwidgets>
<resources/>
Expand Down

0 comments on commit d034a66

Please sign in to comment.