Skip to content

Commit

Permalink
add missing combobox to set data defined label color
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@10746 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed May 6, 2009
1 parent 3fa33b5 commit 3f90ce6
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 41 deletions.
11 changes: 9 additions & 2 deletions src/app/qgslabeldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ void QgsLabelDialog::init( )
cboLabelField->addItems( myFieldStringList );
cboLabelField->setCurrentIndex( itemNoForField( mLabel->labelField( QgsLabel::Text ), myFieldStringList ) );


cboFontField->clear();
cboFontField->addItems( myFieldStringList );
cboFontField->setCurrentIndex( itemNoForField( mLabel->labelField( QgsLabel::Family ), myFieldStringList ) );
Expand All @@ -98,9 +97,16 @@ void QgsLabelDialog::init( )
cboFontSizeTypeField->addItems( myFieldStringList );
cboFontSizeTypeField->setCurrentIndex( itemNoForField( mLabel->labelField( QgsLabel::SizeType ), myFieldStringList ) );

#if 0
cboFontTransparencyField->clear();
cboFontTransparencyField->addItems( myFieldStringList );
//cboFontTransparencyField->setCurrentIndex(itemNoForField(mLabel->labelField(QgsLabel::FontTransparency),myFieldStringList));
cboFontTransparencyField->setCurrentIndex( itemNoForField( mLabel->labelField( QgsLabel::FontTransparency ), myFieldStringList ) );
#endif

cboFontColorField->clear();
cboFontColorField->addItems( myFieldStringList );
cboFontColorField->setCurrentIndex( itemNoForField( mLabel->labelField( QgsLabel::Color ), myFieldStringList ) );


cboBufferSizeField->clear();
cboBufferSizeField->addItems( myFieldStringList );
Expand Down Expand Up @@ -389,6 +395,7 @@ void QgsLabelDialog::apply()
mLabel->setLabelField( QgsLabel::Underline, fieldIndexFromName( cboUnderlineField->currentText() ) );
mLabel->setLabelField( QgsLabel::Size, fieldIndexFromName( cboFontSizeField->currentText() ) );
mLabel->setLabelField( QgsLabel::SizeType, fieldIndexFromName( cboFontSizeTypeField->currentText() ) );
mLabel->setLabelField( QgsLabel::Color, fieldIndexFromName( cboFontColorField->currentText() ) );
mLabel->setLabelField( QgsLabel::BufferSize, fieldIndexFromName( cboBufferSizeField->currentText() ) );
//mLabel->setLabelField( QgsLabel::BufferTransparency, cboBufferTransparencyField->currentText() );
mLabel->setLabelField( QgsLabel::XCoordinate, fieldIndexFromName( cboXCoordinateField->currentText() ) );
Expand Down
113 changes: 74 additions & 39 deletions src/ui/qgslabeldialogbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,31 @@
</item>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QGroupBox" name="groupBox5" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Preview:</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="lblSample" >
<property name="text" >
<string>QGIS Rocks!</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1" >
<widget class="QStackedWidget" name="stackedWidget" >
<property name="sizePolicy" >
Expand All @@ -126,15 +151,15 @@
</sizepolicy>
</property>
<property name="currentIndex" >
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="page" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>309</width>
<height>394</height>
<width>304</width>
<height>399</height>
</rect>
</property>
<layout class="QGridLayout" >
Expand Down Expand Up @@ -421,8 +446,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>309</width>
<height>394</height>
<width>304</width>
<height>399</height>
</rect>
</property>
<layout class="QGridLayout" >
Expand Down Expand Up @@ -537,8 +562,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>304</width>
<height>399</height>
</rect>
</property>
<layout class="QGridLayout" >
Expand Down Expand Up @@ -613,11 +638,11 @@
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>304</width>
<height>399</height>
</rect>
</property>
<layout class="QGridLayout" >
<layout class="QGridLayout" name="gridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="lblFont" >
<property name="sizePolicy" >
Expand Down Expand Up @@ -776,6 +801,9 @@
</item>
<item row="6" column="0" >
<widget class="QLabel" name="textLabel4_3_2_3" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
Expand All @@ -792,6 +820,35 @@
</item>
<item row="6" column="1" >
<widget class="QComboBox" name="cboFontTransparencyField" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="minimumSize" >
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item row="7" column="0" >
<widget class="QLabel" name="textLabel4_3_2_5" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Color</string>
</property>
<property name="buddy" >
<cstring>cboFontColorField</cstring>
</property>
</widget>
</item>
<item row="7" column="1" >
<widget class="QComboBox" name="cboFontColorField" >
<property name="minimumSize" >
<size>
<width>0</width>
Expand All @@ -807,8 +864,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>304</width>
<height>399</height>
</rect>
</property>
<layout class="QGridLayout" >
Expand Down Expand Up @@ -851,8 +908,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>100</width>
<height>30</height>
<width>304</width>
<height>399</height>
</rect>
</property>
<layout class="QGridLayout" >
Expand Down Expand Up @@ -987,32 +1044,10 @@
</widget>
</widget>
</item>
<item row="2" column="0" colspan="2" >
<widget class="QGroupBox" name="groupBox5" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title" >
<string>Preview:</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="lblSample" >
<property name="text" >
<string>QGIS Rocks!</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
<zorder>listWidget</zorder>
<zorder>groupBox5</zorder>
<zorder>stackedWidget</zorder>
</widget>
<layoutdefault spacing="6" margin="11" />
<tabstops>
Expand Down

0 comments on commit 3f90ce6

Please sign in to comment.