Better style manager dialog with icons from Robert Szczepanek.

git-svn-id: http://svn.osgeo.org/qgis/trunk@14913 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
wonder 2010-12-14 22:09:39 +00:00
parent 132aeb243a
commit 92e2d73585
7 changed files with 115 additions and 18 deletions

View File

@ -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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 940 B

View File

@ -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();
@ -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();
@ -86,7 +88,7 @@ void QgsStyleV2ManagerDialog::populateTypes()
// update current index to previous selection
cboItemType->setCurrentIndex( current );
*/
}
void QgsStyleV2ManagerDialog::populateList()
@ -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()

View File

@ -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>
@ -59,6 +134,9 @@
<property name="toolTip">
<string>Add item</string>
</property>
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
@ -66,6 +144,9 @@
<property name="toolTip">
<string>Edit item</string>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
@ -73,6 +154,9 @@
<property name="toolTip">
<string>Remove item</string>
</property>
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
@ -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>