groupSpace.diff

Anna Kratochvilova, 2011-11-10 05:15 AM

Download (9.19 KB)

View differences:

src/app/composer/qgscomposerlegendwidget.cpp
81 81
  mTitleLineEdit->setText( mLegend->title() );
82 82
  mSymbolWidthSpinBox->setValue( mLegend->symbolWidth() );
83 83
  mSymbolHeightSpinBox->setValue( mLegend->symbolHeight() );
84
  mGroupSpaceSpinBox->setValue( mLegend->groupSpace() );
84 85
  mLayerSpaceSpinBox->setValue( mLegend->layerSpace() );
85 86
  mSymbolSpaceSpinBox->setValue( mLegend->symbolSpace() );
86 87
  mIconLabelSpaceSpinBox->setValue( mLegend->iconLabelSpace() );
......
140 141
  }
141 142
}
142 143

  
144
void QgsComposerLegendWidget::on_mGroupSpaceSpinBox_valueChanged( double d )
145
{
146
  if ( mLegend )
147
  {
148
    mLegend->beginCommand( tr( "Legend group space" ), QgsComposerMergeCommand::LegendGroupSpace );
149
    mLegend->setGroupSpace( d );
150
    mLegend->adjustBoxSize();
151
    mLegend->update();
152
    mLegend->endCommand();
153
  }
154
}
155

  
143 156
void QgsComposerLegendWidget::on_mLayerSpaceSpinBox_valueChanged( double d )
144 157
{
145 158
  if ( mLegend )
......
641 654
  mMapComboBox->blockSignals( b );
642 655
  mSymbolWidthSpinBox->blockSignals( b );
643 656
  mSymbolHeightSpinBox->blockSignals( b );
657
  mGroupSpaceSpinBox->blockSignals( b );
644 658
  mLayerSpaceSpinBox->blockSignals( b );
645 659
  mSymbolSpaceSpinBox->blockSignals( b );
646 660
  mIconLabelSpaceSpinBox->blockSignals( b );
src/app/composer/qgscomposerlegendwidget.h
42 42
    void on_mTitleLineEdit_textChanged( const QString& text );
43 43
    void on_mSymbolWidthSpinBox_valueChanged( double d );
44 44
    void on_mSymbolHeightSpinBox_valueChanged( double d );
45
    void on_mGroupSpaceSpinBox_valueChanged( double d );
45 46
    void on_mLayerSpaceSpinBox_valueChanged( double d );
46 47
    void on_mSymbolSpaceSpinBox_valueChanged( double d );
47 48
    void on_mIconLabelSpaceSpinBox_valueChanged( double d );
src/core/composer/qgscomposeritemcommand.h
79 79
      ComposerLegendText,
80 80
      LegendSymbolWidth,
81 81
      LegendSymbolHeight,
82
      LegendGroupSpace,
82 83
      LegendLayerSpace,
83 84
      LegendSymbolSpace,
84 85
      LegendIconSymbolSpace,
src/core/composer/qgscomposerlegend.cpp
32 32
    : QgsComposerItem( composition )
33 33
    , mTitle( tr( "Legend" ) )
34 34
    , mBoxSpace( 2 )
35
    , mGroupSpace( 2 )
35 36
    , mLayerSpace( 2 )
36 37
    , mSymbolSpace( 2 )
37 38
    , mIconLabelSpace( 2 ), mComposerMap( 0 )
......
165 166
    return;
166 167
  }
167 168

  
168
  currentYCoord += mLayerSpace;
169
  currentYCoord += mGroupSpace;
169 170
  currentYCoord += fontAscentMillimeters( mGroupFont );
170 171

  
171 172
  p->setPen( QColor( 0, 0, 0 ) );
......
642 643
  composerLegendElem.setAttribute( "layerFont", mLayerFont.toString() );
643 644
  composerLegendElem.setAttribute( "itemFont", mItemFont.toString() );
644 645
  composerLegendElem.setAttribute( "boxSpace", QString::number( mBoxSpace ) );
646
  composerLegendElem.setAttribute( "groupSpace", QString::number( mGroupSpace ) );
645 647
  composerLegendElem.setAttribute( "layerSpace", QString::number( mLayerSpace ) );
646 648
  composerLegendElem.setAttribute( "symbolSpace", QString::number( mSymbolSpace ) );
647 649
  composerLegendElem.setAttribute( "iconLabelSpace", QString::number( mIconLabelSpace ) );
......
697 699

  
698 700
  //spaces
699 701
  mBoxSpace = itemElem.attribute( "boxSpace", "2.0" ).toDouble();
702
  mGroupSpace = itemElem.attribute( "groupSpace", "3.0" ).toDouble();
700 703
  mLayerSpace = itemElem.attribute( "layerSpace", "3.0" ).toDouble();
701 704
  mSymbolSpace = itemElem.attribute( "symbolSpace", "2.0" ).toDouble();
702 705
  mIconLabelSpace = itemElem.attribute( "iconLabelSpace", "2.0" ).toDouble();
src/core/composer/qgscomposerlegend.h
72 72
    double boxSpace() const {return mBoxSpace;}
73 73
    void setBoxSpace( double s ) {mBoxSpace = s;}
74 74

  
75
    double groupSpace() const {return mGroupSpace;}
76
    void setGroupSpace( double s ) {mGroupSpace = s;}
77

  
75 78
    double layerSpace() const {return mLayerSpace;}
76 79
    void setLayerSpace( double s ) {mLayerSpace = s;}
77 80

  
......
122 125

  
123 126
    /**Space between item box and contents*/
124 127
    double mBoxSpace;
128
    /**Vertical space between group entries*/
129
    double mGroupSpace;
125 130
    /**Vertical space between layer entries*/
126 131
    double mLayerSpace;
127 132
    /**Vertical space between symbol entries*/
src/ui/qgscomposerlegendwidgetbase.ui
33 33
       <rect>
34 34
        <x>0</x>
35 35
        <y>0</y>
36
        <width>367</width>
37
        <height>472</height>
36
        <width>369</width>
37
        <height>474</height>
38 38
       </rect>
39 39
      </property>
40 40
      <layout class="QGridLayout" name="gridLayout_3">
......
48 48
           <rect>
49 49
            <x>0</x>
50 50
            <y>0</y>
51
            <width>349</width>
52
            <height>398</height>
51
            <width>336</width>
52
            <height>493</height>
53 53
           </rect>
54 54
          </property>
55 55
          <attribute name="label">
......
123 123
             </property>
124 124
            </widget>
125 125
           </item>
126
           <item row="8" column="0">
126
           <item row="9" column="0">
127 127
            <widget class="QDoubleSpinBox" name="mLayerSpaceSpinBox">
128 128
             <property name="prefix">
129 129
              <string>Layer space </string>
......
133 133
             </property>
134 134
            </widget>
135 135
           </item>
136
           <item row="9" column="0">
136
           <item row="10" column="0">
137 137
            <widget class="QDoubleSpinBox" name="mSymbolSpaceSpinBox">
138 138
             <property name="prefix">
139 139
              <string>Symbol space </string>
......
143 143
             </property>
144 144
            </widget>
145 145
           </item>
146
           <item row="10" column="0">
146
           <item row="11" column="0">
147 147
            <widget class="QDoubleSpinBox" name="mIconLabelSpaceSpinBox">
148 148
             <property name="prefix">
149 149
              <string>Icon label space </string>
......
153 153
             </property>
154 154
            </widget>
155 155
           </item>
156
           <item row="11" column="0">
156
           <item row="12" column="0">
157 157
            <widget class="QDoubleSpinBox" name="mBoxSpaceSpinBox">
158 158
             <property name="prefix">
159 159
              <string>Box space </string>
......
163 163
             </property>
164 164
            </widget>
165 165
           </item>
166
           <item row="14" column="0">
166
           <item row="15" column="0">
167 167
            <spacer name="verticalSpacer">
168 168
             <property name="orientation">
169 169
              <enum>Qt::Vertical</enum>
......
176 176
             </property>
177 177
            </spacer>
178 178
           </item>
179
           <item row="13" column="0">
179
           <item row="14" column="0">
180 180
            <widget class="QComboBox" name="mMapComboBox"/>
181 181
           </item>
182
           <item row="12" column="0">
182
           <item row="13" column="0">
183 183
            <widget class="QLabel" name="mMapLabel">
184 184
             <property name="text">
185 185
              <string>Map</string>
186 186
             </property>
187 187
            </widget>
188 188
           </item>
189
           <item row="8" column="0">
190
            <widget class="QDoubleSpinBox" name="mGroupSpaceSpinBox">
191
             <property name="prefix">
192
              <string>Group space </string>
193
             </property>
194
             <property name="suffix">
195
              <string> mm</string>
196
             </property>
197
            </widget>
198
           </item>
189 199
          </layout>
190 200
         </widget>
191 201
         <widget class="QWidget" name="page_2">
......
193 203
           <rect>
194 204
            <x>0</x>
195 205
            <y>0</y>
196
            <width>349</width>
197
            <height>398</height>
206
            <width>384</width>
207
            <height>168</height>
198 208
           </rect>
199 209
          </property>
200 210
          <attribute name="label">