Skip to content

Commit ca726f3

Browse files
author
Arunmozhi
committed
fixed the menu and grid in the style manager
1 parent cbd71fa commit ca726f3

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

src/gui/symbology-ng/qgsstylev2managerdialog.cpp

+22-2
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,15 @@ void QgsStyleV2ManagerDialog::populateGroups()
616616
setBold( projectSymbols );
617617
model->appendRow( projectSymbols );
618618

619+
/* TODO
620+
*
619621
QStandardItem *recent = new QStandardItem( "Recently Used" );
620622
recent->setData( "recent" );
621623
recent->setEditable( false );
622624
setBold( recent );
623625
model->appendRow( recent );
626+
*
627+
*/
624628

625629
QStandardItem *group = new QStandardItem( "" ); //require empty name to get first order groups
626630
group->setData( "groups" );
@@ -1111,9 +1115,23 @@ void QgsStyleV2ManagerDialog::grouptreeContextMenu( const QPoint& point )
11111115
{
11121116
QPoint globalPos = groupTree->viewport()->mapToGlobal( point );
11131117

1118+
QModelIndex index = groupTree->indexAt( point );
1119+
QgsDebugMsg( "Now you clicked : " + index.data().toString() );
1120+
11141121
QMenu groupMenu;
1115-
groupMenu.addAction( "Add Group" );
1116-
groupMenu.addAction( "Remove Group" );
1122+
1123+
if ( index.parent().isValid() && ( index.data( Qt::UserRole + 1 ).toString() != "ungrouped" ) )
1124+
{
1125+
if ( index.parent().data( Qt::UserRole + 1 ).toString() == "smartgroups" )
1126+
{
1127+
groupMenu.addAction( "Edit Group" );
1128+
}
1129+
else // it must be a group
1130+
{
1131+
groupMenu.addAction( "Add Group" );
1132+
}
1133+
groupMenu.addAction( "Remove Group" );
1134+
}
11171135

11181136
QAction* selectedItem = groupMenu.exec( globalPos );
11191137

@@ -1123,6 +1141,8 @@ void QgsStyleV2ManagerDialog::grouptreeContextMenu( const QPoint& point )
11231141
addGroup();
11241142
else if ( selectedItem->text() == "Remove Group" )
11251143
removeGroup();
1144+
else if ( selectedItem->text() == "Edit Group" )
1145+
editSmartgroupAction();
11261146
}
11271147
}
11281148

src/ui/qgsstylev2managerdialogbase.ui

+9
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,18 @@
207207
<property name="spacing">
208208
<number>5</number>
209209
</property>
210+
<property name="gridSize">
211+
<size>
212+
<width>75</width>
213+
<height>83</height>
214+
</size>
215+
</property>
210216
<property name="viewMode">
211217
<enum>QListView::IconMode</enum>
212218
</property>
219+
<property name="wordWrap">
220+
<bool>true</bool>
221+
</property>
213222
</widget>
214223
</item>
215224
<item row="4" column="1" colspan="2">

0 commit comments

Comments
 (0)