Skip to content

Commit 50baf82

Browse files
author
timlinux
committedJan 1, 2006
Added accessor to qgisapp to get themepath
Started fixing icons in mapcomposer dialog (still in progress) More ui fixups git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4450 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

6 files changed

+144
-112
lines changed

6 files changed

+144
-112
lines changed
 

‎src/composer/qgscomposer.cpp

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@
3131
#include <Q3Picture>
3232
#include <QPrinter>
3333
#include <QSettings>
34-
34+
#include <QIcon>
35+
#include <QPixmap>
36+
#include <QToolBar>
3537
#include <iostream>
3638

3739
QgsComposer::QgsComposer( QgisApp *qgis): Q3MainWindow()
3840
{
3941
setupUi(this);
42+
setupTheme(qgis->themePath());
4043
connect(fileOpenAction, SIGNAL(activated()), this, SLOT(fileOpen()));
4144
connect(fileSaveAsAction, SIGNAL(activated()), this, SLOT(fileSaveAs()));
4245

@@ -79,6 +82,25 @@ QgsComposer::~QgsComposer()
7982
{
8083
}
8184

85+
void QgsComposer::setupTheme(QString thePath)
86+
{
87+
/**
88+
actionZoomFull->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
89+
actionZoomIn->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
90+
actionZoomOut->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
91+
actionRefresh->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
92+
actionPrint->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
93+
actionImage->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
94+
actionSvg->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
95+
actionSelectItem->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
96+
actionAddMap->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
97+
actionAddVectorLegend->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
98+
actionAddLabel->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
99+
actionAddScalebar->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
100+
actionAddPicture->setIconSet(QIcon(QPixmap(thePath + "/mActionFileNew.png")));
101+
*/
102+
}
103+
82104
void QgsComposer::open ( void )
83105
{
84106
if ( mFirstTime ) {
@@ -828,3 +850,4 @@ bool QgsComposer::readXML( QDomNode & node )
828850

829851
return true;
830852
}
853+

‎src/composer/qgscomposer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ public slots:
147147
void newProject();
148148

149149
private:
150+
//! Set teh pixmap / icons on the toolbar buttons
151+
void setupTheme(QString thePath);
150152
//! remove widget childrens
151153
void removeWidgetChildren ( QWidget *w );
152154

‎src/qgisapp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,11 @@ void QgisApp::createStatusBar()
818818
statusBar()->showMessage(tr("Ready"));
819819
}
820820

821+
QString QgisApp::themePath()
822+
{
823+
return mAppDir +"/share/qgis/themes/" + mThemeName + "/";
824+
}
825+
821826

822827
void QgisApp::setTheme(QString theThemeName)
823828
{

‎src/qgisapp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ public slots:
173173
void about();
174174
//! Add a raster layer to the map (will prompt user for filename using dlg )
175175
void addRasterLayer();
176+
//! Get the path to the active theme dir
177+
QString themePath();
176178
//#ifdef HAVE_POSTGRESQL
177179
//! Add a databaselayer to the map
178180
void addDatabaseLayer();

‎src/ui/qgscomposerlabelbase.ui

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,37 @@
2323
<property name="windowTitle" >
2424
<string>Label Options</string>
2525
</property>
26-
<layout class="QVBoxLayout" >
26+
<layout class="QGridLayout" >
2727
<property name="margin" >
28-
<number>10</number>
28+
<number>9</number>
2929
</property>
3030
<property name="spacing" >
3131
<number>6</number>
3232
</property>
33-
<item>
34-
<widget class="QLineEdit" name="mTextLineEdit" >
35-
<property name="sizePolicy" >
36-
<sizepolicy>
37-
<hsizetype>5</hsizetype>
38-
<vsizetype>0</vsizetype>
39-
<horstretch>0</horstretch>
40-
<verstretch>0</verstretch>
41-
</sizepolicy>
33+
<item row="3" column="0" >
34+
<spacer>
35+
<property name="orientation" >
36+
<enum>Qt::Vertical</enum>
37+
</property>
38+
<property name="sizeType" >
39+
<enum>QSizePolicy::Expanding</enum>
40+
</property>
41+
<property name="sizeHint" >
42+
<size>
43+
<width>16</width>
44+
<height>23</height>
45+
</size>
46+
</property>
47+
</spacer>
48+
</item>
49+
<item row="2" column="0" >
50+
<widget class="QCheckBox" name="mBoxCheckBox" >
51+
<property name="text" >
52+
<string>Box</string>
4253
</property>
4354
</widget>
4455
</item>
45-
<item>
56+
<item row="1" column="0" >
4657
<widget class="QPushButton" name="mFontButton" >
4758
<property name="sizePolicy" >
4859
<sizepolicy>
@@ -57,29 +68,18 @@
5768
</property>
5869
</widget>
5970
</item>
60-
<item>
61-
<widget class="QCheckBox" name="mBoxCheckBox" >
62-
<property name="text" >
63-
<string>Box</string>
71+
<item row="0" column="0" >
72+
<widget class="QLineEdit" name="mTextLineEdit" >
73+
<property name="sizePolicy" >
74+
<sizepolicy>
75+
<hsizetype>5</hsizetype>
76+
<vsizetype>0</vsizetype>
77+
<horstretch>0</horstretch>
78+
<verstretch>0</verstretch>
79+
</sizepolicy>
6480
</property>
6581
</widget>
6682
</item>
67-
<item>
68-
<spacer>
69-
<property name="orientation" >
70-
<enum>Qt::Vertical</enum>
71-
</property>
72-
<property name="sizeType" >
73-
<enum>QSizePolicy::Expanding</enum>
74-
</property>
75-
<property name="sizeHint" >
76-
<size>
77-
<width>16</width>
78-
<height>23</height>
79-
</size>
80-
</property>
81-
</spacer>
82-
</item>
8383
</layout>
8484
</widget>
8585
<layoutdefault spacing="6" margin="11" />

‎src/ui/qgscontcoldialogbase.ui

Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -17,71 +17,58 @@
1717
</property>
1818
<layout class="QGridLayout" >
1919
<property name="margin" >
20-
<number>10</number>
20+
<number>9</number>
2121
</property>
2222
<property name="spacing" >
2323
<number>6</number>
2424
</property>
25-
<item row="0" column="0" >
26-
<widget class="QLabel" name="classvarlabel" >
27-
<property name="minimumSize" >
25+
<item row="0" column="3" >
26+
<spacer>
27+
<property name="orientation" >
28+
<enum>Qt::Horizontal</enum>
29+
</property>
30+
<property name="sizeType" >
31+
<enum>QSizePolicy::Expanding</enum>
32+
</property>
33+
<property name="sizeHint" >
2834
<size>
29-
<width>0</width>
30-
<height>20</height>
35+
<width>141</width>
36+
<height>21</height>
3137
</size>
3238
</property>
33-
<property name="text" >
34-
<string>Classification Field:</string>
35-
</property>
36-
</widget>
39+
</spacer>
3740
</item>
38-
<item row="1" column="0" >
39-
<widget class="QLabel" name="mincolorlabel" >
41+
<item row="0" column="1" colspan="2" >
42+
<widget class="QComboBox" name="classificationComboBox" >
4043
<property name="minimumSize" >
4144
<size>
4245
<width>0</width>
4346
<height>20</height>
4447
</size>
4548
</property>
46-
<property name="text" >
47-
<string>Minimum Value:</string>
48-
</property>
4949
</widget>
5050
</item>
51-
<item row="3" column="0" >
52-
<widget class="QLabel" name="outlinewidthlabel" >
51+
<item row="1" column="2" >
52+
<widget class="QToolButton" name="btnMinValue" >
5353
<property name="minimumSize" >
5454
<size>
55-
<width>0</width>
56-
<height>20</height>
55+
<width>22</width>
56+
<height>22</height>
5757
</size>
5858
</property>
59-
<property name="text" >
60-
<string>Outline Width:</string>
61-
</property>
62-
</widget>
63-
</item>
64-
<item row="3" column="1" >
65-
<widget class="QSpinBox" name="outlinewidthspinbox" />
66-
</item>
67-
<item row="3" column="2" colspan="2" >
68-
<spacer>
69-
<property name="orientation" >
70-
<enum>Qt::Horizontal</enum>
71-
</property>
72-
<property name="sizeType" >
73-
<enum>QSizePolicy::Expanding</enum>
74-
</property>
75-
<property name="sizeHint" >
59+
<property name="maximumSize" >
7660
<size>
77-
<width>111</width>
78-
<height>20</height>
61+
<width>22</width>
62+
<height>22</height>
7963
</size>
8064
</property>
81-
</spacer>
65+
<property name="text" >
66+
<string>...</string>
67+
</property>
68+
</widget>
8269
</item>
83-
<item row="2" column="1" >
84-
<widget class="QLabel" name="lblMaxValue" >
70+
<item row="1" column="1" >
71+
<widget class="QLabel" name="lblMinValue" >
8572
<property name="sizePolicy" >
8673
<sizepolicy>
8774
<hsizetype>1</hsizetype>
@@ -113,6 +100,19 @@
113100
</property>
114101
</widget>
115102
</item>
103+
<item row="2" column="0" >
104+
<widget class="QLabel" name="maxcolorlabel" >
105+
<property name="minimumSize" >
106+
<size>
107+
<width>0</width>
108+
<height>20</height>
109+
</size>
110+
</property>
111+
<property name="text" >
112+
<string>Maximum Value:</string>
113+
</property>
114+
</widget>
115+
</item>
116116
<item row="2" column="2" >
117117
<widget class="QToolButton" name="btnMaxValue" >
118118
<property name="minimumSize" >
@@ -132,21 +132,8 @@
132132
</property>
133133
</widget>
134134
</item>
135-
<item row="2" column="0" >
136-
<widget class="QLabel" name="maxcolorlabel" >
137-
<property name="minimumSize" >
138-
<size>
139-
<width>0</width>
140-
<height>20</height>
141-
</size>
142-
</property>
143-
<property name="text" >
144-
<string>Maximum Value:</string>
145-
</property>
146-
</widget>
147-
</item>
148-
<item row="1" column="1" >
149-
<widget class="QLabel" name="lblMinValue" >
135+
<item row="2" column="1" >
136+
<widget class="QLabel" name="lblMaxValue" >
150137
<property name="sizePolicy" >
151138
<sizepolicy>
152139
<hsizetype>1</hsizetype>
@@ -178,50 +165,63 @@
178165
</property>
179166
</widget>
180167
</item>
181-
<item row="1" column="2" >
182-
<widget class="QToolButton" name="btnMinValue" >
183-
<property name="minimumSize" >
168+
<item row="3" column="2" colspan="2" >
169+
<spacer>
170+
<property name="orientation" >
171+
<enum>Qt::Horizontal</enum>
172+
</property>
173+
<property name="sizeType" >
174+
<enum>QSizePolicy::Expanding</enum>
175+
</property>
176+
<property name="sizeHint" >
184177
<size>
185-
<width>22</width>
186-
<height>22</height>
178+
<width>111</width>
179+
<height>20</height>
187180
</size>
188181
</property>
189-
<property name="maximumSize" >
182+
</spacer>
183+
</item>
184+
<item row="3" column="1" >
185+
<widget class="QSpinBox" name="outlinewidthspinbox" />
186+
</item>
187+
<item row="3" column="0" >
188+
<widget class="QLabel" name="outlinewidthlabel" >
189+
<property name="minimumSize" >
190190
<size>
191-
<width>22</width>
192-
<height>22</height>
191+
<width>0</width>
192+
<height>20</height>
193193
</size>
194194
</property>
195195
<property name="text" >
196-
<string>...</string>
196+
<string>Outline Width:</string>
197197
</property>
198198
</widget>
199199
</item>
200-
<item row="0" column="1" colspan="2" >
201-
<widget class="QComboBox" name="classificationComboBox" >
200+
<item row="1" column="0" >
201+
<widget class="QLabel" name="mincolorlabel" >
202202
<property name="minimumSize" >
203203
<size>
204204
<width>0</width>
205205
<height>20</height>
206206
</size>
207207
</property>
208+
<property name="text" >
209+
<string>Minimum Value:</string>
210+
</property>
208211
</widget>
209212
</item>
210-
<item row="0" column="3" >
211-
<spacer>
212-
<property name="orientation" >
213-
<enum>Qt::Horizontal</enum>
214-
</property>
215-
<property name="sizeType" >
216-
<enum>QSizePolicy::Expanding</enum>
217-
</property>
218-
<property name="sizeHint" >
213+
<item row="0" column="0" >
214+
<widget class="QLabel" name="classvarlabel" >
215+
<property name="minimumSize" >
219216
<size>
220-
<width>141</width>
221-
<height>21</height>
217+
<width>0</width>
218+
<height>20</height>
222219
</size>
223220
</property>
224-
</spacer>
221+
<property name="text" >
222+
<string>Classification Field:</string>
223+
</property>
224+
</widget>
225225
</item>
226226
</layout>
227227
</widget>

0 commit comments

Comments
 (0)
Please sign in to comment.