Skip to content

Commit efb717d

Browse files
committed
add QGIS icons for each toolbar action
1 parent 3f7706d commit efb717d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

arho_feature_template/plugin.py

+12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from typing import TYPE_CHECKING, Callable, cast
44

5+
from qgis.core import QgsApplication
56
from qgis.PyQt.QtCore import QCoreApplication, Qt, QTranslator
67
from qgis.PyQt.QtGui import QIcon
78
from qgis.PyQt.QtWidgets import QAction, QWidget
@@ -44,6 +45,7 @@ def __init__(self) -> None:
4445
self.menu = Plugin.name
4546

4647
self.toolbar = iface.addToolBar("ARHO Toolbar")
48+
self.toolbar.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
4749

4850
def add_action(
4951
self,
@@ -135,9 +137,15 @@ def initGui(self) -> None: # noqa N802
135137

136138
iface.mapCanvas().mapToolSet.connect(self.templater.digitize_map_tool.deactivate)
137139

140+
# icons to consider:
141+
# icon=QgsApplication.getThemeIcon("mActionStreamingDigitize.svg"),
142+
# icon=QgsApplication.getThemeIcon("mIconGeometryCollectionLayer.svg"),
143+
# icon=QgsApplication.getThemeIcon("mActionSharingExport.svg"),
144+
138145
# Add main plugin action to the toolbar
139146
self.new_land_use_plan_action = self.add_action(
140147
text="Luo uusi kaava",
148+
icon=QgsApplication.getThemeIcon("mActionNewMap.svg"),
141149
triggered_callback=self.add_new_plan,
142150
add_to_menu=True,
143151
add_to_toolbar=True,
@@ -146,6 +154,7 @@ def initGui(self) -> None: # noqa N802
146154

147155
self.load_land_use_plan_action = self.add_action(
148156
text="Lataa/avaa kaavaa",
157+
icon=QgsApplication.getThemeIcon("mActionFileOpen.svg"),
149158
triggered_callback=self.load_existing_land_use_plan,
150159
parent=iface.mainWindow(),
151160
add_to_menu=True,
@@ -155,6 +164,7 @@ def initGui(self) -> None: # noqa N802
155164

156165
self.template_dock_action = self.add_action(
157166
text="Kaavakohdetemplaatit",
167+
icon=QgsApplication.getThemeIcon("mIconFieldGeometry.svg"),
158168
toggled_callback=self.toggle_template_dock,
159169
checkable=True,
160170
add_to_menu=True,
@@ -163,13 +173,15 @@ def initGui(self) -> None: # noqa N802
163173

164174
self.new_plan_regulation_group = self.add_action(
165175
text="Luo kaavamääräysryhmä",
176+
icon=QgsApplication.getThemeIcon("mActionAddManualTable.svg"),
166177
triggered_callback=self.open_plan_regulation_group_form,
167178
add_to_menu=True,
168179
add_to_toolbar=True,
169180
)
170181

171182
self.serialize_plan_action = self.add_action(
172183
text="Tallenna kaava JSON",
184+
icon=QgsApplication.getThemeIcon("mActionFileSaveAs.svg"),
173185
triggered_callback=self.serialize_plan,
174186
add_to_menu=True,
175187
add_to_toolbar=True,

0 commit comments

Comments
 (0)