Skip to content

Commit 5063c66

Browse files
committedJun 19, 2015
Merge pull request #2146 from slarosa/new_sharing_icons
new icons for sharing in the stylemanager dialog
2 parents 61f39d6 + 22082d6 commit 5063c66

File tree

6 files changed

+1441
-141
lines changed

6 files changed

+1441
-141
lines changed
 

‎images/images.qrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,9 @@
274274
<file>themes/default/mActionSelectRadius.svg</file>
275275
<file>themes/default/mActionSelectRectangle.svg</file>
276276
<file>themes/default/mActionSetProjection.svg</file>
277+
<file>themes/default/mActionSharing.svg</file>
278+
<file>themes/default/mActionSharingExport.svg</file>
279+
<file>themes/default/mActionSharingImport.svg</file>
277280
<file>themes/default/mActionShowAllLayers.png</file>
278281
<file>themes/default/mActionShowAllLayers.svg</file>
279282
<file>themes/default/mActionShowBookmarks.png</file>
Lines changed: 415 additions & 0 deletions
Loading
Lines changed: 447 additions & 0 deletions
Loading
Lines changed: 447 additions & 0 deletions
Loading

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa
5757
tabItemType->setDocumentMode( true );
5858
searchBox->setPlaceholderText( tr( "Type here to filter symbols..." ) );
5959

60-
// setup icons
61-
btnAddItem->setIcon( QIcon( QgsApplication::iconPath( "symbologyAdd.png" ) ) );
62-
btnEditItem->setIcon( QIcon( QgsApplication::iconPath( "symbologyEdit.png" ) ) );
63-
btnRemoveItem->setIcon( QIcon( QgsApplication::iconPath( "symbologyRemove.png" ) ) );
64-
btnShare->setIcon( QIcon( QgsApplication::iconPath( "user.png" ) ) );
65-
6660
connect( this, SIGNAL( finished( int ) ), this, SLOT( onFinished() ) );
6761

6862
connect( listItems, SIGNAL( doubleClicked( const QModelIndex & ) ), this, SLOT( editItem() ) );
@@ -74,6 +68,8 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa
7468
QMenu *shareMenu = new QMenu( tr( "Share Menu" ), this );
7569
QAction *exportAction = shareMenu->addAction( tr( "Export" ) );
7670
QAction *importAction = shareMenu->addAction( tr( "Import" ) );
71+
exportAction->setIcon( QIcon( QgsApplication::iconPath( "mActionSharingExport.svg" ) ) );
72+
importAction->setIcon( QIcon( QgsApplication::iconPath( "mActionSharingImport.svg" ) ) );
7773
connect( exportAction, SIGNAL( triggered() ), this, SLOT( exportItems() ) );
7874
connect( importAction, SIGNAL( triggered() ), this, SLOT( importItems() ) );
7975
btnShare->setMenu( shareMenu );
@@ -1248,7 +1244,9 @@ void QgsStyleV2ManagerDialog::enableItemsForGroupingMode( bool enable )
12481244
// NOTE: if you ever change the layout name in the .ui file edit here too
12491245
for ( int i = 0; i < symbolBtnsLayout->count(); i++ )
12501246
{
1251-
symbolBtnsLayout->itemAt( i )->widget()->setEnabled( enable );
1247+
QWidget *w = qobject_cast<QWidget*>( symbolBtnsLayout->itemAt( i )->widget() );
1248+
if ( w )
1249+
w->setEnabled( enable );
12521250
}
12531251

12541252
}

‎src/ui/qgsstylev2managerdialogbase.ui

Lines changed: 124 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ QMenu::item:selected { background-color: gray; } */
2020
</string>
2121
</property>
2222
<layout class="QGridLayout" name="gridLayout">
23+
<property name="margin">
24+
<number>6</number>
25+
</property>
2326
<item row="3" column="0">
2427
<widget class="QSplitter" name="mSplitter">
2528
<property name="orientation">
@@ -122,39 +125,10 @@ QMenu::item:selected { background-color: gray; } */
122125
</sizepolicy>
123126
</property>
124127
<layout class="QGridLayout" name="gridLayout_3">
125-
<property name="leftMargin">
126-
<number>4</number>
127-
</property>
128-
<property name="topMargin">
129-
<number>0</number>
130-
</property>
131-
<property name="rightMargin">
128+
<property name="margin">
132129
<number>0</number>
133130
</property>
134-
<property name="bottomMargin">
135-
<number>0</number>
136-
</property>
137-
<item row="0" column="0">
138-
<spacer name="horizontalSpacer">
139-
<property name="orientation">
140-
<enum>Qt::Horizontal</enum>
141-
</property>
142-
<property name="sizeHint" stdset="0">
143-
<size>
144-
<width>350</width>
145-
<height>20</height>
146-
</size>
147-
</property>
148-
</spacer>
149-
</item>
150-
<item row="0" column="1">
151-
<widget class="QgsFilterLineEdit" name="searchBox">
152-
<property name="text">
153-
<string/>
154-
</property>
155-
</widget>
156-
</item>
157-
<item row="1" column="0" colspan="2">
131+
<item row="1" column="0">
158132
<widget class="QTabWidget" name="tabItemType">
159133
<property name="sizePolicy">
160134
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@@ -233,7 +207,7 @@ QMenu::item:selected { background-color: gray; } */
233207
</widget>
234208
</widget>
235209
</item>
236-
<item row="2" column="0" colspan="2">
210+
<item row="2" column="0">
237211
<widget class="QListView" name="listItems">
238212
<property name="sizePolicy">
239213
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@@ -273,144 +247,160 @@ QMenu::item:selected { background-color: gray; } */
273247
</property>
274248
</widget>
275249
</item>
276-
<item row="3" column="0" colspan="2">
277-
<layout class="QHBoxLayout" name="horizontalLayout_2">
250+
<item row="2" column="1">
251+
<layout class="QVBoxLayout" name="symbolBtnsLayout">
278252
<item>
279-
<widget class="QLabel" name="label">
280-
<property name="font">
281-
<font>
282-
<weight>75</weight>
283-
<bold>true</bold>
284-
</font>
253+
<widget class="QToolButton" name="btnAddItem">
254+
<property name="minimumSize">
255+
<size>
256+
<width>0</width>
257+
<height>0</height>
258+
</size>
259+
</property>
260+
<property name="toolTip">
261+
<string>Add item</string>
285262
</property>
286263
<property name="text">
287-
<string>Tags</string>
264+
<string/>
265+
</property>
266+
<property name="icon">
267+
<iconset resource="../../images/images.qrc">
268+
<normaloff>:/images/themes/default/symbologyAdd.png</normaloff>:/images/themes/default/symbologyAdd.png</iconset>
269+
</property>
270+
<property name="popupMode">
271+
<enum>QToolButton::InstantPopup</enum>
272+
</property>
273+
<property name="autoRaise">
274+
<bool>true</bool>
288275
</property>
289276
</widget>
290277
</item>
291278
<item>
292-
<widget class="QLineEdit" name="tagsLineEdit"/>
279+
<widget class="QToolButton" name="btnRemoveItem">
280+
<property name="toolTip">
281+
<string>Remove item</string>
282+
</property>
283+
<property name="text">
284+
<string/>
285+
</property>
286+
<property name="icon">
287+
<iconset resource="../../images/images.qrc">
288+
<normaloff>:/images/themes/default/symbologyRemove.png</normaloff>:/images/themes/default/symbologyRemove.png</iconset>
289+
</property>
290+
<property name="autoRaise">
291+
<bool>true</bool>
292+
</property>
293+
</widget>
293294
</item>
294-
</layout>
295-
</item>
296-
<item row="4" column="0" colspan="2">
297-
<layout class="QHBoxLayout" name="horizontalLayout">
298295
<item>
299-
<spacer name="horizontalSpacer_2">
296+
<spacer name="verticalSpacer">
300297
<property name="orientation">
301-
<enum>Qt::Horizontal</enum>
298+
<enum>Qt::Vertical</enum>
302299
</property>
303300
<property name="sizeHint" stdset="0">
304301
<size>
305-
<width>40</width>
306-
<height>20</height>
302+
<width>20</width>
303+
<height>40</height>
307304
</size>
308305
</property>
309306
</spacer>
310307
</item>
311308
<item>
312-
<layout class="QHBoxLayout" name="symbolBtnsLayout">
313-
<property name="spacing">
314-
<number>6</number>
309+
<widget class="QToolButton" name="btnEditItem">
310+
<property name="toolTip">
311+
<string>Edit item</string>
315312
</property>
316-
<property name="leftMargin">
317-
<number>0</number>
313+
<property name="text">
314+
<string/>
318315
</property>
319-
<item>
320-
<widget class="QToolButton" name="btnAddItem">
321-
<property name="minimumSize">
322-
<size>
323-
<width>0</width>
324-
<height>0</height>
325-
</size>
326-
</property>
327-
<property name="toolTip">
328-
<string>Add item</string>
329-
</property>
330-
<property name="text">
331-
<string/>
332-
</property>
333-
<property name="popupMode">
334-
<enum>QToolButton::InstantPopup</enum>
335-
</property>
336-
</widget>
337-
</item>
338-
<item>
339-
<widget class="QToolButton" name="btnEditItem">
340-
<property name="toolTip">
341-
<string>Edit item</string>
342-
</property>
343-
<property name="text">
344-
<string>Edit</string>
345-
</property>
346-
<property name="toolButtonStyle">
347-
<enum>Qt::ToolButtonTextBesideIcon</enum>
348-
</property>
349-
</widget>
350-
</item>
351-
<item>
352-
<widget class="QToolButton" name="btnRemoveItem">
353-
<property name="toolTip">
354-
<string>Remove item</string>
355-
</property>
356-
<property name="text">
357-
<string/>
358-
</property>
359-
</widget>
360-
</item>
361-
<item>
362-
<widget class="QToolButton" name="btnShare">
363-
<property name="minimumSize">
364-
<size>
365-
<width>0</width>
366-
<height>16</height>
367-
</size>
368-
</property>
369-
<property name="text">
370-
<string>Share</string>
371-
</property>
372-
<property name="popupMode">
373-
<enum>QToolButton::InstantPopup</enum>
374-
</property>
375-
<property name="toolButtonStyle">
376-
<enum>Qt::ToolButtonTextBesideIcon</enum>
377-
</property>
378-
</widget>
379-
</item>
380-
</layout>
316+
<property name="icon">
317+
<iconset resource="../../images/images.qrc">
318+
<normaloff>:/images/themes/default/mActionProjectProperties.png</normaloff>:/images/themes/default/mActionProjectProperties.png</iconset>
319+
</property>
320+
<property name="toolButtonStyle">
321+
<enum>Qt::ToolButtonIconOnly</enum>
322+
</property>
323+
<property name="autoRaise">
324+
<bool>true</bool>
325+
</property>
326+
</widget>
381327
</item>
382328
<item>
383-
<spacer name="horizontalSpacer_3">
384-
<property name="orientation">
385-
<enum>Qt::Horizontal</enum>
386-
</property>
387-
<property name="sizeHint" stdset="0">
329+
<widget class="QToolButton" name="btnShare">
330+
<property name="minimumSize">
388331
<size>
389-
<width>40</width>
390-
<height>20</height>
332+
<width>0</width>
333+
<height>16</height>
391334
</size>
392335
</property>
393-
</spacer>
394-
</item>
395-
<item>
396-
<widget class="QDialogButtonBox" name="buttonBox">
397-
<property name="orientation">
398-
<enum>Qt::Horizontal</enum>
336+
<property name="text">
337+
<string/>
338+
</property>
339+
<property name="icon">
340+
<iconset resource="../../images/images.qrc">
341+
<normaloff>:/images/themes/default/mActionSharing.svg</normaloff>:/images/themes/default/mActionSharing.svg</iconset>
342+
</property>
343+
<property name="popupMode">
344+
<enum>QToolButton::InstantPopup</enum>
399345
</property>
400-
<property name="standardButtons">
401-
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
346+
<property name="toolButtonStyle">
347+
<enum>Qt::ToolButtonIconOnly</enum>
402348
</property>
403-
<property name="centerButtons">
404-
<bool>false</bool>
349+
<property name="autoRaise">
350+
<bool>true</bool>
405351
</property>
406352
</widget>
407353
</item>
408354
</layout>
409355
</item>
356+
<item row="0" column="0" colspan="2">
357+
<layout class="QHBoxLayout" name="horizontalLayout_3">
358+
<item>
359+
<widget class="QgsFilterLineEdit" name="searchBox">
360+
<property name="text">
361+
<string/>
362+
</property>
363+
</widget>
364+
</item>
365+
<item>
366+
<layout class="QHBoxLayout" name="horizontalLayout_2">
367+
<item>
368+
<widget class="QLabel" name="label">
369+
<property name="font">
370+
<font>
371+
<weight>75</weight>
372+
<bold>true</bold>
373+
</font>
374+
</property>
375+
<property name="text">
376+
<string>Tags</string>
377+
</property>
378+
</widget>
379+
</item>
380+
<item>
381+
<widget class="QLineEdit" name="tagsLineEdit"/>
382+
</item>
383+
</layout>
384+
</item>
385+
</layout>
386+
</item>
410387
</layout>
411388
</widget>
412389
</widget>
413390
</item>
391+
<item row="4" column="0">
392+
<widget class="QDialogButtonBox" name="buttonBox">
393+
<property name="orientation">
394+
<enum>Qt::Horizontal</enum>
395+
</property>
396+
<property name="standardButtons">
397+
<set>QDialogButtonBox::Close|QDialogButtonBox::Help</set>
398+
</property>
399+
<property name="centerButtons">
400+
<bool>false</bool>
401+
</property>
402+
</widget>
403+
</item>
414404
</layout>
415405
</widget>
416406
<customwidgets>

0 commit comments

Comments
 (0)
Please sign in to comment.