Skip to content
Permalink
Browse files

Fix invalid icon sizes in processing model builder

While the toolbar buttons were shown in the correct size, the
actual icon image in the buttons was not correctly scaling to
match the button size.

Hardcoding the svg icons in the py file seems to be the only
way to avoid this.
  • Loading branch information
nyalldawson committed Aug 6, 2017
1 parent cad54f2 commit d6e2985c08ba37593932ae28044cb79c4fe1d1a0
Showing with 28 additions and 5 deletions.
  1. +28 −5 python/plugins/processing/modeler/ModelerDialog.py
@@ -81,6 +81,34 @@ def __init__(self, model=None):
except:
pass

self.mToolbar.setIconSize(iface.iconSize())
self.mActionOpen.setIcon(
QgsApplication.getThemeIcon('/mActionFileOpen.svg'))
self.mActionSave.setIcon(
QgsApplication.getThemeIcon('/mActionFileSave.svg'))
self.mActionSaveAs.setIcon(
QgsApplication.getThemeIcon('/mActionFileSaveAs.svg'))
self.mActionZoomActual.setIcon(
QgsApplication.getThemeIcon('/mActionZoomActual.svg'))
self.mActionZoomIn.setIcon(
QgsApplication.getThemeIcon('/mActionZoomIn.svg'))
self.mActionZoomOut.setIcon(
QgsApplication.getThemeIcon('/mActionZoomOut.svg'))
self.mActionExportImage.setIcon(
QgsApplication.getThemeIcon('/mActionSaveMapAsImage.svg'))
self.mActionZoomToItems.setIcon(
QgsApplication.getThemeIcon('/mActionZoomFullExtent.svg'))
self.mActionExportPdf.setIcon(
QgsApplication.getThemeIcon('/mActionSaveAsPDF.svg'))
self.mActionExportSvg.setIcon(
QgsApplication.getThemeIcon('/mActionSaveAsSVG.svg'))
self.mActionExportPython.setIcon(
QgsApplication.getThemeIcon('/mActionSaveAsPython.svg'))
self.mActionEditHelp.setIcon(
QgsApplication.getThemeIcon('/mActionEditHelpContent.svg'))
self.mActionRun.setIcon(
QgsApplication.getThemeIcon('/mActionStart.svg'))

self.addDockWidget(Qt.LeftDockWidgetArea, self.propertiesDock)
self.addDockWidget(Qt.LeftDockWidgetArea, self.inputsDock)
self.addDockWidget(Qt.LeftDockWidgetArea, self.algorithmsDock)
@@ -219,11 +247,6 @@ def _mimeDataAlgorithm(items):
ctrlEquals = QShortcut(QKeySequence("Ctrl+="), self)
ctrlEquals.activated.connect(self.zoomIn)

try:
iconSize = int(settings.value("IconSize", 24))
except:
iconSize = 24
self.mToolbar.setIconSize(QSize(iconSize, iconSize))
self.mActionOpen.triggered.connect(self.openModel)
self.mActionSave.triggered.connect(self.save)
self.mActionSaveAs.triggered.connect(self.saveAs)

0 comments on commit d6e2985

Please sign in to comment.
You can’t perform that action at this time.