Skip to content

Commit

Permalink
[Diagrams] Switch properties dialog to tabs
Browse files Browse the repository at this point in the history
Histograms:
* Use a more descriptive text for the size parameter
* Hide unneeded parameter controls
  • Loading branch information
m-kuhn committed Apr 30, 2013
1 parent 009ba1b commit 6e6ff40
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 103 deletions.
8 changes: 6 additions & 2 deletions src/app/qgsdiagramproperties.cpp
Expand Up @@ -325,21 +325,25 @@ void QgsDiagramProperties::on_mDiagramTypeComboBox_currentIndexChanged( int inde
mBarWidthLabel->show();
mBarWidthSpinBox->show();
mOrientationFrame->show();
mLinearlyScalingLabel->setText( tr( "Multiplicator for attribute values:" ) );
mAttributeBasedScalingOptions->hide();
}
else
{
mBarWidthLabel->hide();
mBarWidthSpinBox->hide();
mOrientationFrame->hide();
mLinearlyScalingLabel->setText( tr( "Scale linearly between 0 and the following attribute value / diagram size:" ) );
mAttributeBasedScalingOptions->show();
}

if ( DIAGRAM_NAME_HISTOGRAM == diagramType || DIAGRAM_NAME_TEXT == diagramType )
{
mDiagramPropertiesToolBox->setItemEnabled( 3, true );
mDiagramPropertiesTabWidget->setTabEnabled( 3, true );
}
else
{
mDiagramPropertiesToolBox->setItemEnabled( 3, false );
mDiagramPropertiesTabWidget->setTabEnabled( 3, false );
}

if ( DIAGRAM_NAME_TEXT == diagramType || DIAGRAM_NAME_PIE == diagramType )
Expand Down
149 changes: 48 additions & 101 deletions src/ui/qgsdiagrampropertiesbase.ui
Expand Up @@ -39,8 +39,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>752</width>
<height>613</height>
<width>743</width>
<height>644</height>
</rect>
</property>
<layout class="QVBoxLayout" name="scrollAreaLayout">
Expand Down Expand Up @@ -118,17 +118,12 @@
<layout class="QHBoxLayout" name="appearanceLayout"/>
</item>
<item>
<widget class="QToolBox" name="mDiagramPropertiesToolBox">
<widget class="QWidget" name="mDiagramPropertiesToolBoxPage1">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>713</width>
<height>394</height>
</rect>
</property>
<attribute name="label">
<widget class="QTabWidget" name="mDiagramPropertiesTabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="mDiagramPropertiesTabWidgetPage1">
<attribute name="title">
<string>Appearance</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_8">
Expand Down Expand Up @@ -315,16 +310,8 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="mDiagramPropertiesToolBoxPage2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>715</width>
<height>278</height>
</rect>
</property>
<attribute name="label">
<widget class="QWidget" name="mDiagramPropertiesTabWidgetPage2">
<attribute name="title">
<string>Size</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_7">
Expand Down Expand Up @@ -406,32 +393,41 @@
<item>
<layout class="QHBoxLayout" name="mLinearlyScalingLayout">
<item>
<widget class="QLabel" name="mSizeAttributeLabel">
<property name="text">
<string>Attribute</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSizeAttributeComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mFindMaximumValueButton">
<property name="text">
<string>Find maximum value</string>
</property>
<widget class="QWidget" name="mAttributeBasedScalingOptions" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="mSizeAttributeLabel">
<property name="text">
<string>Attribute</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="mSizeAttributeComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="mFindMaximumValueButton">
<property name="text">
<string>Find maximum value</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="mValueLineEdit"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLineEdit" name="mValueLineEdit"/>
</item>
<item>
<widget class="QLabel" name="mSizeLabel">
<property name="text">
Expand Down Expand Up @@ -504,16 +500,8 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="mDiagramPropertiesToolBoxPage3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>713</width>
<height>271</height>
</rect>
</property>
<attribute name="label">
<widget class="QWidget" name="mDiagramPropertiesTabWidgetPage3">
<attribute name="title">
<string>Position</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
Expand Down Expand Up @@ -666,16 +654,8 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="mDiagramPropertiesToolBoxPage4">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>728</width>
<height>166</height>
</rect>
</property>
<attribute name="label">
<widget class="QWidget" name="mDiagramPropertiesTabOptions">
<attribute name="title">
<string>Options</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
Expand Down Expand Up @@ -972,40 +952,7 @@
<resources>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>
<sender>mFixedSizeCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>mDiagramSizeSpinBox</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>75</x>
<y>118</y>
</hint>
<hint type="destinationlabel">
<x>158</x>
<y>118</y>
</hint>
</hints>
</connection>
<connection>
<sender>mFixedSizeCheckBox</sender>
<signal>toggled(bool)</signal>
<receiver>mLinearScaleFrame</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>75</x>
<y>118</y>
</hint>
<hint type="destinationlabel">
<x>390</x>
<y>222</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
<buttongroups>
<buttongroup name="mOrientationButtonGroup"/>
</buttongroups>
Expand Down

0 comments on commit 6e6ff40

Please sign in to comment.