Skip to content

Commit 92e2d73

Browse files
author
wonder
committedDec 14, 2010
Better style manager dialog with icons from Robert Szczepanek.
git-svn-id: http://svn.osgeo.org/qgis/trunk@14913 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 132aeb2 commit 92e2d73

File tree

7 files changed

+115
-18
lines changed

7 files changed

+115
-18
lines changed
 

‎images/images.qrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@
279279
<file>themes/default/propertyicons/rendering.png</file>
280280
<file>themes/default/propertyicons/symbology.png</file>
281281
<file>themes/default/propertyicons/transparency.png</file>
282+
<file>themes/default/styleicons/color.png</file>
283+
<file>themes/default/styleicons/style-point.png</file>
284+
<file>themes/default/styleicons/style-line.png</file>
285+
<file>themes/default/styleicons/style-polygon.png</file>
282286
<file>icons/qgis-icon-16x16.png</file>
283287
<file>icons/qgis-icon-60x60.png</file>
284288
<file>themes/gis/mActionAddArrow.png</file>
1.15 KB
Loading
1.16 KB
Loading
730 Bytes
Loading
940 Bytes
Loading

‎src/gui/symbology-ng/qgsstylev2managerdialog.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa
4444

4545
populateTypes();
4646

47-
connect( cboItemType, SIGNAL( currentIndexChanged( int ) ), this, SLOT( populateList() ) );
47+
connect( tabItemType, SIGNAL( currentChanged( int ) ), this, SLOT( populateList() ) );
4848

4949
populateList();
5050

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

66+
// no counting of style items
67+
/*
6668
int markerCount = 0, lineCount = 0, fillCount = 0;
6769
6870
QStringList symbolNames = mStyle->symbolNames();
@@ -86,7 +88,7 @@ void QgsStyleV2ManagerDialog::populateTypes()
8688
8789
// update current index to previous selection
8890
cboItemType->setCurrentIndex( current );
89-
91+
*/
9092
}
9193

9294
void QgsStyleV2ManagerDialog::populateList()
@@ -154,8 +156,14 @@ void QgsStyleV2ManagerDialog::populateColorRamps()
154156

155157
int QgsStyleV2ManagerDialog::currentItemType()
156158
{
157-
int idx = cboItemType->currentIndex();
158-
return cboItemType->itemData( idx ).toInt();
159+
switch ( tabItemType->currentIndex() )
160+
{
161+
case 0: return QgsSymbolV2::Marker;
162+
case 1: return QgsSymbolV2::Line;
163+
case 2: return QgsSymbolV2::Fill;
164+
case 3: return 3;
165+
default: return 0;
166+
}
159167
}
160168

161169
QString QgsStyleV2ManagerDialog::currentItemName()

‎src/ui/qgsstylev2managerdialogbase.ui

Lines changed: 98 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,104 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>300</width>
10-
<height>369</height>
9+
<width>625</width>
10+
<height>395</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Style Manager</string>
1515
</property>
16-
<layout class="QVBoxLayout">
16+
<layout class="QVBoxLayout" name="verticalLayout">
1717
<item>
18-
<widget class="QLabel" name="label">
19-
<property name="text">
20-
<string>Style item type</string>
18+
<widget class="QTabWidget" name="tabItemType">
19+
<property name="sizePolicy">
20+
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
21+
<horstretch>0</horstretch>
22+
<verstretch>0</verstretch>
23+
</sizepolicy>
2124
</property>
22-
<property name="buddy">
23-
<cstring>cboItemType</cstring>
25+
<property name="currentIndex">
26+
<number>0</number>
2427
</property>
28+
<property name="iconSize">
29+
<size>
30+
<width>22</width>
31+
<height>22</height>
32+
</size>
33+
</property>
34+
<property name="documentMode">
35+
<bool>true</bool>
36+
</property>
37+
<widget class="QWidget" name="tabMarker">
38+
<property name="sizePolicy">
39+
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
40+
<horstretch>0</horstretch>
41+
<verstretch>0</verstretch>
42+
</sizepolicy>
43+
</property>
44+
<attribute name="icon">
45+
<iconset resource="../../images/images.qrc">
46+
<normaloff>:/images/themes/default/styleicons/style-point.png</normaloff>:/images/themes/default/styleicons/style-point.png</iconset>
47+
</attribute>
48+
<attribute name="title">
49+
<string>Marker</string>
50+
</attribute>
51+
</widget>
52+
<widget class="QWidget" name="tabLine">
53+
<property name="sizePolicy">
54+
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
55+
<horstretch>0</horstretch>
56+
<verstretch>0</verstretch>
57+
</sizepolicy>
58+
</property>
59+
<attribute name="icon">
60+
<iconset resource="../../images/images.qrc">
61+
<normaloff>:/images/themes/default/styleicons/style-line.png</normaloff>:/images/themes/default/styleicons/style-line.png</iconset>
62+
</attribute>
63+
<attribute name="title">
64+
<string>Line</string>
65+
</attribute>
66+
</widget>
67+
<widget class="QWidget" name="tabFill">
68+
<property name="sizePolicy">
69+
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
70+
<horstretch>0</horstretch>
71+
<verstretch>0</verstretch>
72+
</sizepolicy>
73+
</property>
74+
<attribute name="icon">
75+
<iconset resource="../../images/images.qrc">
76+
<normaloff>:/images/themes/default/styleicons/style-polygon.png</normaloff>:/images/themes/default/styleicons/style-polygon.png</iconset>
77+
</attribute>
78+
<attribute name="title">
79+
<string>Fill</string>
80+
</attribute>
81+
</widget>
82+
<widget class="QWidget" name="tabColorRamp">
83+
<property name="sizePolicy">
84+
<sizepolicy hsizetype="Preferred" vsizetype="Ignored">
85+
<horstretch>0</horstretch>
86+
<verstretch>0</verstretch>
87+
</sizepolicy>
88+
</property>
89+
<attribute name="icon">
90+
<iconset resource="../../images/images.qrc">
91+
<normaloff>:/images/themes/default/styleicons/color.png</normaloff>:/images/themes/default/styleicons/color.png</iconset>
92+
</attribute>
93+
<attribute name="title">
94+
<string>Color ramp</string>
95+
</attribute>
96+
</widget>
2597
</widget>
2698
</item>
27-
<item>
28-
<widget class="QComboBox" name="cboItemType"/>
29-
</item>
3099
<item>
31100
<widget class="QListView" name="listItems">
101+
<property name="sizePolicy">
102+
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
103+
<horstretch>0</horstretch>
104+
<verstretch>3</verstretch>
105+
</sizepolicy>
106+
</property>
32107
<property name="editTriggers">
33108
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
34109
</property>
@@ -59,20 +134,29 @@
59134
<property name="toolTip">
60135
<string>Add item</string>
61136
</property>
137+
<property name="text">
138+
<string>Add</string>
139+
</property>
62140
</widget>
63141
</item>
64142
<item>
65143
<widget class="QPushButton" name="btnEditItem">
66144
<property name="toolTip">
67145
<string>Edit item</string>
68146
</property>
147+
<property name="text">
148+
<string>Edit</string>
149+
</property>
69150
</widget>
70151
</item>
71152
<item>
72153
<widget class="QPushButton" name="btnRemoveItem">
73154
<property name="toolTip">
74155
<string>Remove item</string>
75156
</property>
157+
<property name="text">
158+
<string>Remove</string>
159+
</property>
76160
</widget>
77161
</item>
78162
<item>
@@ -103,14 +187,15 @@
103187
</layout>
104188
</widget>
105189
<tabstops>
106-
<tabstop>cboItemType</tabstop>
107190
<tabstop>listItems</tabstop>
108191
<tabstop>btnAddItem</tabstop>
109192
<tabstop>btnEditItem</tabstop>
110193
<tabstop>btnRemoveItem</tabstop>
111194
<tabstop>buttonBox</tabstop>
112195
</tabstops>
113-
<resources/>
196+
<resources>
197+
<include location="../../images/images.qrc"/>
198+
</resources>
114199
<connections>
115200
<connection>
116201
<sender>buttonBox</sender>

0 commit comments

Comments
 (0)
Please sign in to comment.