Skip to content

Commit

Permalink
[needs-docs] Remove options for making layer names and groups bold
Browse files Browse the repository at this point in the history
Either these options are desirable, in which case they should
be the default settings, or not, in which case we don't need
an extra user option to control this.
  • Loading branch information
nyalldawson committed Nov 12, 2017
1 parent 41abc0b commit 91e2353
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 107 deletions.
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -3689,8 +3689,8 @@ void QgisApp::setupLayerTreeViewFromSettings()
model->setFlag( QgsLayerTreeModel::ShowRasterPreviewIcon, s.value( QStringLiteral( "/qgis/createRasterLegendIcons" ), false ).toBool() );

QFont fontLayer, fontGroup;
fontLayer.setBold( s.value( QStringLiteral( "/qgis/legendLayersBold" ), true ).toBool() );
fontGroup.setBold( s.value( QStringLiteral( "/qgis/legendGroupsBold" ), false ).toBool() );
fontLayer.setBold( true );
fontGroup.setBold( false );
model->setLayerTreeNodeFont( QgsLayerTreeNode::NodeLayer, fontLayer );
model->setLayerTreeNodeFont( QgsLayerTreeNode::NodeGroup, fontGroup );
}
Expand Down
10 changes: 1 addition & 9 deletions src/app/qgsoptions.cpp
Expand Up @@ -666,8 +666,6 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
// but the checkbox is true to use QPixmap
chkAddedVisibility->setChecked( mSettings->value( QStringLiteral( "/qgis/new_layers_visible" ), true ).toBool() );
cbxLegendClassifiers->setChecked( mSettings->value( QStringLiteral( "/qgis/showLegendClassifiers" ), false ).toBool() );
mLegendLayersBoldChkBx->setChecked( mSettings->value( QStringLiteral( "/qgis/legendLayersBold" ), true ).toBool() );
mLegendGroupsBoldChkBx->setChecked( mSettings->value( QStringLiteral( "/qgis/legendGroupsBold" ), false ).toBool() );
cbxHideSplash->setChecked( mSettings->value( QStringLiteral( "/qgis/hideSplash" ), false ).toBool() );
mDataSourceManagerNonModal->setChecked( mSettings->value( QStringLiteral( "/qgis/dataSourceManagerNonModal" ), false ).toBool() );
cbxCheckVersion->setChecked( mSettings->value( QStringLiteral( "/qgis/checkVersion" ), true ).toBool() );
Expand Down Expand Up @@ -1268,10 +1266,6 @@ void QgsOptions::saveOptions()

bool showLegendClassifiers = mSettings->value( QStringLiteral( "/qgis/showLegendClassifiers" ), false ).toBool();
mSettings->setValue( QStringLiteral( "/qgis/showLegendClassifiers" ), cbxLegendClassifiers->isChecked() );
bool legendLayersBold = mSettings->value( QStringLiteral( "/qgis/legendLayersBold" ), true ).toBool();
mSettings->setValue( QStringLiteral( "/qgis/legendLayersBold" ), mLegendLayersBoldChkBx->isChecked() );
bool legendGroupsBold = mSettings->value( QStringLiteral( "/qgis/legendGroupsBold" ), false ).toBool();
mSettings->setValue( QStringLiteral( "/qgis/legendGroupsBold" ), mLegendGroupsBoldChkBx->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/hideSplash" ), cbxHideSplash->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/dataSourceManagerNonModal" ), mDataSourceManagerNonModal->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/checkVersion" ), cbxCheckVersion->isChecked() );
Expand Down Expand Up @@ -1559,9 +1553,7 @@ void QgsOptions::saveOptions()
saveGdalDriverList();

// refresh legend if any legend item's state is to be changed
if ( legendLayersBold != mLegendLayersBoldChkBx->isChecked()
|| legendGroupsBold != mLegendGroupsBoldChkBx->isChecked()
|| legendLayersCapitalize != capitalizeCheckBox->isChecked() )
if ( legendLayersCapitalize != capitalizeCheckBox->isChecked() )
{
// TODO[MD] QgisApp::instance()->legend()->updateLegendItemStyles();
}
Expand Down
183 changes: 87 additions & 96 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -308,7 +308,7 @@
<item>
<widget class="QStackedWidget" name="mOptionsStackedWidget">
<property name="currentIndex">
<number>12</number>
<number>5</number>
</property>
<widget class="QWidget" name="mOptionsPageGeneral">
<layout class="QVBoxLayout" name="verticalLayout_3">
Expand Down Expand Up @@ -337,8 +337,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>580</width>
<height>804</height>
<width>1159</width>
<height>1434</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_28">
Expand Down Expand Up @@ -1032,8 +1032,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>537</width>
<height>1128</height>
<width>1092</width>
<height>1502</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
Expand Down Expand Up @@ -1562,8 +1562,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>499</width>
<height>754</height>
<width>1010</width>
<height>1266</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_27">
Expand Down Expand Up @@ -1930,8 +1930,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>672</width>
<height>1043</height>
<width>1351</width>
<height>1933</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_22">
Expand Down Expand Up @@ -2681,8 +2681,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>130</width>
<height>322</height>
<width>741</width>
<height>779</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_46">
Expand Down Expand Up @@ -2832,8 +2832,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>340</height>
<width>813</width>
<height>751</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_25">
Expand Down Expand Up @@ -2992,34 +2992,19 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="2">
<widget class="Line" name="line_4">
<property name="minimumSize">
<size>
<width>12</width>
<height>0</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="3" column="1" colspan="2">
<widget class="QCheckBox" name="cbxCreateRasterLegendIcons">
<property name="text">
<string>Create raster icons (may be slow)</string>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_34">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>8</width>
<height>1</height>
</size>
<item row="2" column="1" colspan="2">
<widget class="QCheckBox" name="cbxLegendClassifiers">
<property name="text">
<string>Display classification attribute names</string>
</property>
</spacer>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="capitalizeCheckBox">
Expand All @@ -3034,52 +3019,34 @@
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QCheckBox" name="mLegendLayersBoldChkBx">
<item row="0" column="0" colspan="3">
<widget class="QLabel" name="label_53">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Bold layer names</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QCheckBox" name="cbxLegendClassifiers">
<property name="text">
<string>Display classification attribute names</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="3">
<widget class="QCheckBox" name="mLegendGroupsBoldChkBx">
<property name="text">
<string>Bold group names</string>
<string>Legend item styles</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="3">
<widget class="QCheckBox" name="cbxCreateRasterLegendIcons">
<property name="text">
<string>Create raster icons (may be slow)</string>
<item row="1" column="0">
<spacer name="horizontalSpacer_34">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="0" colspan="4">
<widget class="QLabel" name="label_53">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="text">
<string>Legend item styles</string>
<property name="sizeHint" stdset="0">
<size>
<width>8</width>
<height>1</height>
</size>
</property>
</widget>
</spacer>
</item>
</layout>
</item>
Expand Down Expand Up @@ -3175,8 +3142,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>623</width>
<height>734</height>
<width>1081</width>
<height>1164</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_30">
Expand Down Expand Up @@ -3619,8 +3586,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>491</width>
<height>610</height>
<width>920</width>
<height>924</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_39">
Expand Down Expand Up @@ -3888,8 +3855,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>548</width>
<height>785</height>
<width>1072</width>
<height>1551</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_31">
Expand Down Expand Up @@ -4483,8 +4450,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>431</width>
<height>376</height>
<width>823</width>
<height>576</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
Expand Down Expand Up @@ -4622,8 +4589,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>418</width>
<height>544</height>
<width>838</width>
<height>855</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_15">
Expand Down Expand Up @@ -4845,8 +4812,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect>
<x>0</x>
<y>0</y>
<width>866</width>
<height>930</height>
<width>1258</width>
<height>1349</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_33">
Expand Down Expand Up @@ -5373,23 +5340,12 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsScrollArea</class>
<extends>QScrollArea</extends>
<header>qgsscrollarea.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsSpinBox</class>
<extends>QSpinBox</extends>
<header>qgsspinbox.h</header>
</customwidget>
<customwidget>
<class>QgsCollapsibleGroupBox</class>
<extends>QGroupBox</extends>
Expand All @@ -5402,6 +5358,17 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<header>qgsprojectionselectionwidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsColorButton</class>
<extends>QToolButton</extends>
<header>qgscolorbutton.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QgsSpinBox</class>
<extends>QSpinBox</extends>
<header>qgsspinbox.h</header>
</customwidget>
<customwidget>
<class>QgsVariableEditorWidget</class>
<extends>QWidget</extends>
Expand Down Expand Up @@ -5572,8 +5539,6 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<tabstop>mLegendGrpBx</tabstop>
<tabstop>cmbLegendDoubleClickAction</tabstop>
<tabstop>capitalizeCheckBox</tabstop>
<tabstop>mLegendLayersBoldChkBx</tabstop>
<tabstop>mLegendGroupsBoldChkBx</tabstop>
<tabstop>cbxLegendClassifiers</tabstop>
<tabstop>cbxCreateRasterLegendIcons</tabstop>
<tabstop>mLegendGraphicResolutionSpinBox</tabstop>
Expand Down Expand Up @@ -5679,6 +5644,32 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
</tabstops>
<resources>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>
Expand Down

0 comments on commit 91e2353

Please sign in to comment.