2
2
3
3
from typing import TYPE_CHECKING , Callable , cast
4
4
5
+ from qgis .core import QgsApplication
5
6
from qgis .PyQt .QtCore import QCoreApplication , Qt , QTranslator
6
7
from qgis .PyQt .QtGui import QIcon
7
8
from qgis .PyQt .QtWidgets import QAction , QWidget
@@ -44,6 +45,7 @@ def __init__(self) -> None:
44
45
self .menu = Plugin .name
45
46
46
47
self .toolbar = iface .addToolBar ("ARHO Toolbar" )
48
+ self .toolbar .setToolButtonStyle (Qt .ToolButtonTextBesideIcon )
47
49
48
50
def add_action (
49
51
self ,
@@ -135,9 +137,15 @@ def initGui(self) -> None: # noqa N802
135
137
136
138
iface .mapCanvas ().mapToolSet .connect (self .templater .digitize_map_tool .deactivate )
137
139
140
+ # icons to consider:
141
+ # icon=QgsApplication.getThemeIcon("mActionStreamingDigitize.svg"),
142
+ # icon=QgsApplication.getThemeIcon("mIconGeometryCollectionLayer.svg"),
143
+ # icon=QgsApplication.getThemeIcon("mActionSharingExport.svg"),
144
+
138
145
# Add main plugin action to the toolbar
139
146
self .new_land_use_plan_action = self .add_action (
140
147
text = "Luo uusi kaava" ,
148
+ icon = QgsApplication .getThemeIcon ("mActionNewMap.svg" ),
141
149
triggered_callback = self .add_new_plan ,
142
150
add_to_menu = True ,
143
151
add_to_toolbar = True ,
@@ -146,6 +154,7 @@ def initGui(self) -> None: # noqa N802
146
154
147
155
self .load_land_use_plan_action = self .add_action (
148
156
text = "Lataa/avaa kaavaa" ,
157
+ icon = QgsApplication .getThemeIcon ("mActionFileOpen.svg" ),
149
158
triggered_callback = self .load_existing_land_use_plan ,
150
159
parent = iface .mainWindow (),
151
160
add_to_menu = True ,
@@ -155,6 +164,7 @@ def initGui(self) -> None: # noqa N802
155
164
156
165
self .template_dock_action = self .add_action (
157
166
text = "Kaavakohdetemplaatit" ,
167
+ icon = QgsApplication .getThemeIcon ("mIconFieldGeometry.svg" ),
158
168
toggled_callback = self .toggle_template_dock ,
159
169
checkable = True ,
160
170
add_to_menu = True ,
@@ -163,13 +173,15 @@ def initGui(self) -> None: # noqa N802
163
173
164
174
self .new_plan_regulation_group = self .add_action (
165
175
text = "Luo kaavamääräysryhmä" ,
176
+ icon = QgsApplication .getThemeIcon ("mActionAddManualTable.svg" ),
166
177
triggered_callback = self .open_plan_regulation_group_form ,
167
178
add_to_menu = True ,
168
179
add_to_toolbar = True ,
169
180
)
170
181
171
182
self .serialize_plan_action = self .add_action (
172
183
text = "Tallenna kaava JSON" ,
184
+ icon = QgsApplication .getThemeIcon ("mActionFileSaveAs.svg" ),
173
185
triggered_callback = self .serialize_plan ,
174
186
add_to_menu = True ,
175
187
add_to_toolbar = True ,
0 commit comments