Smaller Toolbar Icons for QGIS
Do you have a small resolution screen and want to use QGIS? Then you know the problem of toolbars using up precious screen estate.
In QGIS 1.7
You find the option to make icons smaller (16×16) or bigger (32×32) in the options dialog:
If you are running a version of QGIS < 1.7
You can change the size of toolbar icons to any value you like – smaller or bigger than by default. And this is how it’s done (in Python console):
from PyQt4.QtGui import QToolBar from PyQt4.QtCore import QSize toolbars = qgis.utils.iface.mainWindow().findChildren(QToolBar) for toolbar in toolbars: toolbar.setIconSize(QSize(16,16))
All toolbar icons will be scaled down to 16×16 pixels.
Kudos to Webrian on forum.qgis.org for this tip and to Nathan for pointing out how to access all toolbars.
thanks, can this tip be made permanent ?? When I restart qgis the icons are reset to default-size…
I wrote a quick and dirty plugin that scales all accessible toolbar icons to 16×16. I can mail it to you if you want.
yes please email me yout plugin
Good tip. One thing however, this won’t scale any toolbars that are made by plugins eg GRASS plugin toolbar. What you can do however is something like this:
from PyQt4.QtGui import QToolBar
from PyQt4.QtCore import QSize
toolbars = qgis.utils.iface.mainWindow().findChildren(QToolBar)
for toolbar in toolbars:
This will loop all the toolbars in the QGIS window and set there icons to 16 x 16.
Thanks Nathan! That’s great!
Much better than having to call the toolbars by name. I’ll update my post.
Good news. I sent a patch in a day ago to allow the user to set the size (16,24,32) in the options dialog, and Garry committed it to trunk so the options will be there in v1.7. :)
That’s great! Thanks for sharing!
can you also mail me that plugin
thanks in advance
Please install 1.7, then you don’t need a plugin to do this. The functionality has been added to QGIS main application.