Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Better style manager dialog with icons from Robert Szczepanek.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14913 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 14, 2010
1 parent bbb5a84 commit 87ca525
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 18 deletions.
4 changes: 4 additions & 0 deletions images/images.qrc
Expand Up @@ -279,6 +279,10 @@
<file>themes/default/propertyicons/rendering.png</file>
<file>themes/default/propertyicons/symbology.png</file>
<file>themes/default/propertyicons/transparency.png</file>
<file>themes/default/styleicons/color.png</file>
<file>themes/default/styleicons/style-point.png</file>
<file>themes/default/styleicons/style-line.png</file>
<file>themes/default/styleicons/style-polygon.png</file>
<file>icons/qgis-icon-16x16.png</file>
<file>icons/qgis-icon-60x60.png</file>
<file>themes/gis/mActionAddArrow.png</file>
Expand Down
Binary file added images/themes/default/styleicons/color.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/styleicons/style-line.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/styleicons/style-point.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/themes/default/styleicons/style-polygon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 13 additions & 5 deletions src/gui/symbology-ng/qgsstylev2managerdialog.cpp
Expand Up @@ -44,7 +44,7 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa

populateTypes();

connect( cboItemType, SIGNAL( currentIndexChanged( int ) ), this, SLOT( populateList() ) );
connect( tabItemType, SIGNAL( currentChanged( int ) ), this, SLOT( populateList() ) );

populateList();

Expand All @@ -61,8 +61,10 @@ void QgsStyleV2ManagerDialog::onFinished()
void QgsStyleV2ManagerDialog::populateTypes()
{
// save current selection index in types combo
int current = ( cboItemType->count() > 0 ? cboItemType->currentIndex() : 0 );
int current = ( tabItemType->count() > 0 ? tabItemType->currentIndex() : 0 );

// no counting of style items
/*
int markerCount = 0, lineCount = 0, fillCount = 0;
QStringList symbolNames = mStyle->symbolNames();
Expand All @@ -86,7 +88,7 @@ void QgsStyleV2ManagerDialog::populateTypes()
// update current index to previous selection
cboItemType->setCurrentIndex( current );

*/
}

void QgsStyleV2ManagerDialog::populateList()
Expand Down Expand Up @@ -154,8 +156,14 @@ void QgsStyleV2ManagerDialog::populateColorRamps()

int QgsStyleV2ManagerDialog::currentItemType()
{
int idx = cboItemType->currentIndex();
return cboItemType->itemData( idx ).toInt();
switch ( tabItemType->currentIndex() )
{
case 0: return QgsSymbolV2::Marker;
case 1: return QgsSymbolV2::Line;
case 2: return QgsSymbolV2::Fill;
case 3: return 3;
default: return 0;
}
}

QString QgsStyleV2ManagerDialog::currentItemName()
Expand Down
111 changes: 98 additions & 13 deletions src/ui/qgsstylev2managerdialogbase.ui
Expand Up @@ -6,29 +6,104 @@
<rect>
<x>0</x>
<y>0</y>
<width>300</width>
<height>369</height>
<width>625</width>
<height>395</height>
</rect>
</property>
<property name="windowTitle">
<string>Style Manager</string>
</property>
<layout class="QVBoxLayout">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Style item type</string>
<widget class="QTabWidget" name="tabItemType">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="buddy">
<cstring>cboItemType</cstring>
<property name="currentIndex">
<number>0</number>
</property>
<property name="iconSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="documentMode">
<bool>true</bool>
</property>
<widget class="QWidget" name="tabMarker">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/styleicons/style-point.png</normaloff>:/images/themes/default/styleicons/style-point.png</iconset>
</attribute>
<attribute name="title">
<string>Marker</string>
</attribute>
</widget>
<widget class="QWidget" name="tabLine">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/styleicons/style-line.png</normaloff>:/images/themes/default/styleicons/style-line.png</iconset>
</attribute>
<attribute name="title">
<string>Line</string>
</attribute>
</widget>
<widget class="QWidget" name="tabFill">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/styleicons/style-polygon.png</normaloff>:/images/themes/default/styleicons/style-polygon.png</iconset>
</attribute>
<attribute name="title">
<string>Fill</string>
</attribute>
</widget>
<widget class="QWidget" name="tabColorRamp">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="icon">
<iconset resource="../../images/images.qrc">
<normaloff>:/images/themes/default/styleicons/color.png</normaloff>:/images/themes/default/styleicons/color.png</iconset>
</attribute>
<attribute name="title">
<string>Color ramp</string>
</attribute>
</widget>
</widget>
</item>
<item>
<widget class="QComboBox" name="cboItemType"/>
</item>
<item>
<widget class="QListView" name="listItems">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>3</verstretch>
</sizepolicy>
</property>
<property name="editTriggers">
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
</property>
Expand Down Expand Up @@ -59,20 +134,29 @@
<property name="toolTip">
<string>Add item</string>
</property>
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnEditItem">
<property name="toolTip">
<string>Edit item</string>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnRemoveItem">
<property name="toolTip">
<string>Remove item</string>
</property>
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
Expand Down Expand Up @@ -103,14 +187,15 @@
</layout>
</widget>
<tabstops>
<tabstop>cboItemType</tabstop>
<tabstop>listItems</tabstop>
<tabstop>btnAddItem</tabstop>
<tabstop>btnEditItem</tabstop>
<tabstop>btnRemoveItem</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<resources>
<include location="../../images/images.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
Expand Down

0 comments on commit 87ca525

Please sign in to comment.