Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 d6e2985
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d6e2985

Please sign in to comment.