Skip to content
Permalink
Browse files
Better style manager dialog with icons from Robert Szczepanek.
git-svn-id: http://svn.osgeo.org/qgis/trunk@14913 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Dec 14, 2010
1 parent 132aeb2 commit 92e2d7358506cd0757cbf26484acb1a1279c960c
@@ -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>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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()
@@ -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,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>
@@ -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>

0 comments on commit 92e2d73

Please sign in to comment.