Skip to content

Commit

Permalink
Respect icon size in attribute table, use svg icons
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 20, 2016
1 parent 33d64dc commit 8261275
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions src/app/qgsattributetabledialog.cpp
Expand Up @@ -99,6 +99,21 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid

QSettings settings;

int size = settings.value( "/IconSize", 16 ).toInt();
if ( size > 32 )
{
size -= 16;
}
else if ( size == 32 )
{
size = 24;
}
else
{
size = 16;
}
mToolbar->setIconSize( QSize( size, size ) );

// Initialize the window geometry
restoreGeometry( settings.value( "/Windows/BetterAttributeTable/geometry" ).toByteArray() );

Expand Down Expand Up @@ -188,10 +203,11 @@ QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWid
columnBoxInit();
updateTitle();

mActionRemoveSelection->setIcon( QgsApplication::getThemeIcon( "/mActionUnselectAttributes.png" ) );
mActionRemoveSelection->setIcon( QgsApplication::getThemeIcon( "/mActionDeselectAll.svg" ) );
mActionSelectAll->setIcon( QgsApplication::getThemeIcon( "/mActionSelectAll.svg" ) );
mActionSelectedToTop->setIcon( QgsApplication::getThemeIcon( "/mActionSelectedToTop.png" ) );
mActionCopySelectedRows->setIcon( QgsApplication::getThemeIcon( "/mActionCopySelected.png" ) );
mActionCopySelectedRows->setIcon( QgsApplication::getThemeIcon( "/mActionEditCopy.svg" ) );
mActionPasteFeatures->setIcon( QgsApplication::getThemeIcon( "/mActionEditPaste.svg" ) );
mActionZoomMapToSelectedRows->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.svg" ) );
mActionPanMapToSelectedRows->setIcon( QgsApplication::getThemeIcon( "/mActionPanToSelected.svg" ) );
mActionInvertSelection->setIcon( QgsApplication::getThemeIcon( "/mActionInvertSelection.svg" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsattributetabledialog.ui
Expand Up @@ -183,8 +183,8 @@
<addaction name="mActionCopySelectedRows"/>
<addaction name="mActionPasteFeatures"/>
<addaction name="separator"/>
<addaction name="mActionRemoveAttribute"/>
<addaction name="mActionAddAttribute"/>
<addaction name="mActionRemoveAttribute"/>
<addaction name="mActionOpenFieldCalculator"/>
<addaction name="separator"/>
<addaction name="mActionSetStyles"/>
Expand Down

0 comments on commit 8261275

Please sign in to comment.