Skip to content

Commit

Permalink
[FEATURE] Add "All" tab to style manager
Browse files Browse the repository at this point in the history
This allows you to see ALL the symbols/ramps matching the current
group/tag/filter. It makes it easier to manage groups which consist
of both markers/lines and fills.
  • Loading branch information
nyalldawson committed Jan 14, 2019
1 parent cd96ecd commit 180bb6a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/gui/symbology/qgsstylemanagerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void QgsStyleManagerDialog::tabItemType_currentChanged( int )

mModel->setEntityFilter( isSymbol ? QgsStyle::SymbolEntity : QgsStyle::ColorrampEntity );
mModel->setEntityFilterEnabled( true );
mModel->setSymbolTypeFilterEnabled( isSymbol );
mModel->setSymbolTypeFilterEnabled( isSymbol && tabItemType->currentIndex() > 0 );
mModel->setSymbolType( static_cast< QgsSymbol::SymbolType >( currentItemType() ) );

populateList();
Expand Down Expand Up @@ -385,13 +385,13 @@ int QgsStyleManagerDialog::currentItemType()
{
switch ( tabItemType->currentIndex() )
{
case 0:
return QgsSymbol::Marker;
case 1:
return QgsSymbol::Line;
return QgsSymbol::Marker;
case 2:
return QgsSymbol::Fill;
return QgsSymbol::Line;
case 3:
return QgsSymbol::Fill;
case 4:
return 3;
default:
return 0;
Expand Down
28 changes: 18 additions & 10 deletions src/ui/qgsstylemanagerdialogbase.ui
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QgsFilterLineEdit" name="searchBox">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
Expand Down Expand Up @@ -265,6 +258,13 @@
</item>
</layout>
</item>
<item>
<widget class="QgsFilterLineEdit" name="searchBox">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
Expand All @@ -274,9 +274,17 @@
</property>
<item>
<widget class="QTabWidget" name="tabItemType">
<property name="currentIndex">
<number>4</number>
</property>
<property name="documentMode">
<bool>true</bool>
</property>
<widget class="QWidget" name="tabAll">
<attribute name="title">
<string>All</string>
</attribute>
</widget>
<widget class="QWidget" name="tabMarker">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
Expand Down Expand Up @@ -334,15 +342,15 @@
<normaloff>:/images/themes/default/styleicons/color.svg</normaloff>:/images/themes/default/styleicons/color.svg</iconset>
</attribute>
<attribute name="title">
<string>Color ramp</string>
<string>Color Ramp</string>
</attribute>
</widget>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="mSymbolViewStackedWidget">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="page">
<layout class="QVBoxLayout" name="verticalLayout_2">
Expand Down Expand Up @@ -617,9 +625,9 @@
<tabstop>btnAddItem</tabstop>
<tabstop>btnRemoveItem</tabstop>
<tabstop>btnEditItem</tabstop>
<tabstop>searchBox</tabstop>
<tabstop>mButtonIconView</tabstop>
<tabstop>mButtonListView</tabstop>
<tabstop>searchBox</tabstop>
</tabstops>
<resources>
<include location="../../images/images.qrc"/>
Expand Down

0 comments on commit 180bb6a

Please sign in to comment.