commit 0dc0953e7c569cfe50f4a72750d0c37ed044ba2b
parent 5dcc4bc15a109d6dd30086917629efa664b66515
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Fri, 5 Jun 2026 21:51:17 +0300
feat(gui): add SVG toolbar icon (C2)
Diffstat:
2 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/profile_interpreter/icon.svg b/profile_interpreter/icon.svg
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ viewBox="0 0 24 24"
+ width="24"
+ height="24"
+ version="1.1"
+ id="svg4"
+ sodipodi:docname="icon.svg"
+ inkscape:version="1.4.4 (dcaf3e7, 2026-05-05)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="namedview4"
+ pagecolor="#ffffff"
+ bordercolor="#000000"
+ borderopacity="0.25"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:zoom="13.831529"
+ inkscape:cx="-6.6153206"
+ inkscape:cy="3.9402729"
+ inkscape:window-width="1728"
+ inkscape:window-height="1056"
+ inkscape:window-x="0"
+ inkscape:window-y="33"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg4" />
+ <path
+ d="m 2,14 c 4,0 6,-7 10,-7 4,0 6,4 10,4 V 21 H 2 Z"
+ fill="#ecf0f1"
+ stroke="#7f8c8d"
+ stroke-width="1.5"
+ stroke-linejoin="round"
+ id="path1"
+ sodipodi:nodetypes="cscccc" />
+ <path
+ d="m 2,14 c 4,0 6,-7 10,-7 4,0 6,4 10,4"
+ fill="none"
+ stroke="#2c3e50"
+ stroke-width="2"
+ id="path2" />
+ <circle
+ cx="6"
+ cy="11.5"
+ r="2"
+ fill="#2ecc71"
+ stroke="#ffffff"
+ stroke-width="1"
+ id="circle2" />
+ <circle
+ cx="12"
+ cy="7"
+ r="2"
+ fill="#e74c3c"
+ stroke="#ffffff"
+ stroke-width="1"
+ id="circle3" />
+ <circle
+ cx="17"
+ cy="9.5"
+ r="2"
+ fill="#2ecc71"
+ stroke="#ffffff"
+ stroke-width="1"
+ id="circle4" />
+ <path
+ d="m 12.275378,8.2685255 5.447511,5.1490155 -2.191977,0.674326 1.150519,3.132196 -1.65227,0.49753 -1.101513,-2.985179 -2.203026,0.99506 z"
+ fill="#2c3e50"
+ stroke="#ffffff"
+ stroke-width="1.04693"
+ stroke-linejoin="round"
+ id="path4"
+ sodipodi:nodetypes="cccccccc"
+ style="fill:#000000;fill-opacity:1" />
+</svg>
diff --git a/profile_interpreter/profile_interpreter.py b/profile_interpreter/profile_interpreter.py
@@ -15,8 +15,10 @@ The conversion path is:
"""
import math
+import os
from qgis.PyQt.QtCore import Qt, QPointF
+from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QAction
try:
@@ -127,7 +129,8 @@ class ProfileInterpreterPlugin:
self._layer = None
def initGui(self):
- self._action = QAction('Interpret on Profile', self.iface.mainWindow())
+ icon_path = os.path.join(os.path.dirname(__file__), 'icon.svg')
+ self._action = QAction(QIcon(icon_path), 'Interpret on Profile', self.iface.mainWindow())
self._action.setCheckable(True)
self._action.toggled.connect(self._set_active)
self.iface.addPluginToMenu(MENU, self._action)