]> Softwares of Agnibho - medscript.git/commitdiff
Added toolbar icons
authorAgnibho Mondal <mondal@agnibho.com>
Fri, 1 Sep 2023 16:17:01 +0000 (21:47 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Fri, 1 Sep 2023 16:17:01 +0000 (21:47 +0530)
resource/icon_open.svg [new file with mode: 0644]
resource/icon_refresh.svg [new file with mode: 0644]
resource/icon_render.svg [new file with mode: 0644]
resource/icon_save.svg [new file with mode: 0644]
window.py

diff --git a/resource/icon_open.svg b/resource/icon_open.svg
new file mode 100644 (file)
index 0000000..dc40fc3
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   id="svg1468"
+   sodipodi:docname="Anonymous_Paperface_2.svg"
+   viewBox="0 0 187.5 187.5"
+   sodipodi:version="0.32"
+   version="1.0"
+   y="0"
+   x="0"
+   inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+   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"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:dc="http://purl.org/dc/elements/1.1/">
+  <defs
+     id="defs1" />
+  <sodipodi:namedview
+     id="base"
+     bordercolor="#666666"
+     inkscape:pageshadow="2"
+     inkscape:window-width="957"
+     pagecolor="#ffffff"
+     inkscape:zoom="1.8346667"
+     borderopacity="1.0"
+     inkscape:current-layer="svg1468"
+     inkscape:cx="93.477469"
+     inkscape:cy="93.477469"
+     inkscape:window-height="1053"
+     inkscape:pageopacity="0.0"
+     inkscape:showpageshadow="2"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:window-x="961"
+     inkscape:window-y="2"
+     inkscape:window-maximized="0" />
+  <g
+     id="layer1"
+     transform="matrix(2.208678,0,0,1.7010882,-107.04774,-55.017522)">
+    <g
+       id="g2809"
+       transform="matrix(0.78726,0,0,0.78726,374.44,-151.98)">
+      <path
+         id="rect2752"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.75;stroke-linecap:round;stroke-linejoin:round"
+         d="m -412,236.36 h 104 v 136 h -62 l -42,-44 z" />
+      <path
+         id="path2755"
+         style="fill:none;stroke:#000000;stroke-width:3.75"
+         d="m -411.75,327.52 42.22,-6.27 -0.42,51.41" />
+      <path
+         id="path2757"
+         style="fill:none;stroke:#000000;stroke-width:2.8"
+         d="m -379.98,362.63 -0.42,-30.51" />
+      <path
+         id="path2759"
+         style="fill:none;stroke:#000000;stroke-width:2.8581"
+         d="m -388.76,351.29 -0.41,-17.86" />
+      <path
+         id="path2761"
+         style="fill:none;stroke:#000000;stroke-width:2.8"
+         d="m -397.21,341.31 -0.42,-6.68" />
+    </g>
+  </g>
+  <metadata
+     id="metadata1">
+    <rdf:RDF>
+      <cc:Work>
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+        <dc:publisher>
+          <cc:Agent
+             rdf:about="http://openclipart.org/">
+            <dc:title>Openclipart</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:title>Paperface 2</dc:title>
+        <dc:date>2006-12-26T00:00:00</dc:date>
+        <dc:description />
+        <dc:source>https://openclipart.org/detail/24799/-by--24799</dc:source>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Anonymous</dc:title>
+          </cc:Agent>
+        </dc:creator>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+</svg>
diff --git a/resource/icon_refresh.svg b/resource/icon_refresh.svg
new file mode 100644 (file)
index 0000000..b63232a
--- /dev/null
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   id="svg2"
+   sodipodi:docname="icon_refresh.svg"
+   viewBox="0 0 187.99999 188"
+   version="1.1"
+   inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+   width="188"
+   height="188"
+   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"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:dc="http://purl.org/dc/elements/1.1/">
+  <title
+     id="title1">Reload icon</title>
+  <defs
+     id="defs1" />
+  <sodipodi:namedview
+     id="base"
+     bordercolor="#666666"
+     inkscape:pageshadow="2"
+     inkscape:window-y="2"
+     fit-margin-left="0"
+     pagecolor="#ffffff"
+     fit-margin-top="0"
+     inkscape:window-maximized="1"
+     inkscape:zoom="1.7904509"
+     inkscape:window-x="961"
+     inkscape:window-height="1053"
+     showgrid="false"
+     borderopacity="1.0"
+     inkscape:current-layer="layer1"
+     inkscape:cx="41.330371"
+     inkscape:cy="115.33408"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:window-width="957"
+     inkscape:pageopacity="0.0"
+     inkscape:document-units="px"
+     inkscape:showpageshadow="2"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1">
+    <inkscape:grid
+       id="grid3766"
+       dotted="true"
+       originy="-682.61218"
+       enabled="true"
+       originx="-344.9375"
+       visible="false"
+       snapvisiblegridlinesonly="true"
+       type="xygrid"
+       empspacing="5"
+       spacingy="1"
+       spacingx="1"
+       units="px" />
+  </sodipodi:namedview>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     transform="translate(-344.94,-314.12)">
+    <path
+       id="path3768"
+       style="color:#000000;text-indent:0;text-transform:none;fill:none;fill-opacity:1;stroke:#000000;stroke-width:3.36943;stroke-opacity:1"
+       inkscape:connector-curvature="0"
+       d="m 531.38247,315.05072 -31.10786,24.14426 c -16.36017,-13.4019 -37.37033,-21.54267 -60.19071,-21.54267 -51.57597,0 -93.96106,41.40823 -93.96106,91.78813 0,50.38323 42.3885,90.85233 93.96106,90.85233 40.43169,0 75.17703,-24.82562 88.31562,-59.84112 l -33.66466,-8.01323 c -9.00918,20.75374 -29.88672,35.07078 -54.65096,35.07078 -33.15023,0 -59.44754,-25.68749 -59.44754,-58.07276 0,-32.38361 26.2956,-59.00856 59.44754,-59.00856 12.29962,0 23.60106,3.72022 33.02546,9.99073 l -30.78808,23.93611 89.06221,16.13103 v -85.44069 z" />
+  </g>
+  <metadata
+     id="metadata1">
+    <rdf:RDF>
+      <cc:Work>
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:publisher>
+          <cc:Agent
+             rdf:about="http://openclipart.org/">
+            <dc:title>Openclipart</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:title>Reload icon</dc:title>
+        <dc:date>2012-07-06T14:30:15</dc:date>
+        <dc:source>https://openclipart.org/detail/171074/reload-icon-by-mlampret-171074</dc:source>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>mlampret</dc:title>
+          </cc:Agent>
+        </dc:creator>
+        <dc:subject>
+          <rdf:Bag>
+            <rdf:li>black</rdf:li>
+            <rdf:li>free</rdf:li>
+            <rdf:li>icon</rdf:li>
+            <rdf:li>icons</rdf:li>
+            <rdf:li>recycle</rdf:li>
+            <rdf:li>reload</rdf:li>
+            <rdf:li>simple</rdf:li>
+          </rdf:Bag>
+        </dc:subject>
+        <cc:license
+           rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
+        <dc:description>simple reload / recycle icon</dc:description>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+</svg>
diff --git a/resource/icon_render.svg b/resource/icon_render.svg
new file mode 100644 (file)
index 0000000..3074f67
--- /dev/null
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   id="svg1468"
+   sodipodi:docname="Anonymous_Printer_icon.svg"
+   viewBox="0 0 187.5 187.5"
+   sodipodi:version="0.32"
+   version="1.0"
+   y="0"
+   x="0"
+   inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+   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"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:dc="http://purl.org/dc/elements/1.1/">
+  <defs
+     id="defs1" />
+  <sodipodi:namedview
+     id="base"
+     bordercolor="#666666"
+     inkscape:pageshadow="2"
+     inkscape:window-width="957"
+     pagecolor="#ffffff"
+     inkscape:zoom="1.8346667"
+     inkscape:window-x="961"
+     borderopacity="1.0"
+     inkscape:current-layer="svg1468"
+     inkscape:cx="93.477469"
+     inkscape:cy="93.477469"
+     inkscape:window-y="2"
+     inkscape:window-height="1053"
+     inkscape:pageopacity="0.0"
+     inkscape:showpageshadow="2"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:window-maximized="0" />
+  <g
+     id="layer1"
+     transform="matrix(1.2574598,0,0,1.359346,-22.838086,-31.124845)">
+    <g
+       id="g2388"
+       transform="translate(-527.55,-379)">
+      <rect
+         id="rect2352"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.1212;stroke-linecap:round;stroke-linejoin:round"
+         rx="10"
+         ry="10"
+         height="58.320999"
+         width="145.8"
+         y="448.85999"
+         x="547.29999" />
+      <rect
+         id="rect2356"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.1212;stroke-linecap:round;stroke-linejoin:round"
+         height="39.464001"
+         width="87.325996"
+         y="498.72"
+         x="576.53998" />
+      <path
+         id="path2358"
+         style="fill:none;stroke:#000000;stroke-width:4.0576;stroke-linecap:round"
+         d="M 561.88,468.75 H 677.2" />
+      <rect
+         id="rect2360"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.1212;stroke-linecap:round;stroke-linejoin:round"
+         height="44.549"
+         width="87.482002"
+         y="404.06"
+         x="576.46002" />
+      <path
+         id="path2362"
+         style="fill:none;stroke:#000000;stroke-width:2.0808"
+         d="m 587.07,527.07 h 66.27" />
+      <path
+         id="path2364"
+         style="fill:none;stroke:#000000;stroke-width:2.0808"
+         d="m 587.07,520.44 h 66.27" />
+      <path
+         id="path2366"
+         style="fill:none;stroke:#000000;stroke-width:2.0808"
+         d="m 587.07,513.81 h 66.27" />
+      <path
+         id="path2368"
+         style="fill:none;stroke:#000000;stroke-width:2.0808"
+         d="m 587.07,507.19 h 66.27" />
+    </g>
+  </g>
+  <metadata
+     id="metadata1">
+    <rdf:RDF>
+      <cc:Work>
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+        <dc:publisher>
+          <cc:Agent
+             rdf:about="http://openclipart.org/">
+            <dc:title>Openclipart</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:title>Printer icon</dc:title>
+        <dc:date>2006-12-26T00:00:00</dc:date>
+        <dc:description />
+        <dc:source>https://openclipart.org/detail/24825/-by--24825</dc:source>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Anonymous</dc:title>
+          </cc:Agent>
+        </dc:creator>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+</svg>
diff --git a/resource/icon_save.svg b/resource/icon_save.svg
new file mode 100644 (file)
index 0000000..9502b23
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   id="svg1468"
+   sodipodi:docname="Anonymous_Floppy_disk_icon.svg"
+   viewBox="0 0 187.5 187.5"
+   sodipodi:version="0.32"
+   version="1.0"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   y="0"
+   x="0"
+   inkscape:version="1.3 (0e150ed6c4, 2023-07-21)"
+   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"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:dc="http://purl.org/dc/elements/1.1/">
+  <defs
+     id="defs1" />
+  <sodipodi:namedview
+     id="base"
+     bordercolor="#666666"
+     inkscape:pageshadow="2"
+     inkscape:window-width="957"
+     pagecolor="#ffffff"
+     inkscape:zoom="1.8346667"
+     inkscape:window-x="961"
+     showgrid="false"
+     borderopacity="1.0"
+     inkscape:current-layer="svg1468"
+     inkscape:cx="93.477469"
+     inkscape:cy="93.477469"
+     inkscape:window-y="2"
+     inkscape:window-height="1053"
+     inkscape:pageopacity="0.0"
+     inkscape:showpageshadow="2"
+     inkscape:pagecheckerboard="0"
+     inkscape:deskcolor="#d1d1d1"
+     inkscape:window-maximized="0" />
+  <g
+     id="layer1"
+     transform="matrix(1.6722896,0,0,1.6528135,-62.011974,-59.380917)">
+    <g
+       id="g2098"
+       transform="translate(11.649,12.217)">
+      <rect
+         id="rect2052"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.063;stroke-linejoin:round"
+         rx="2.97"
+         ry="2.8871"
+         height="110.2"
+         width="108.4"
+         y="25.341"
+         x="27.357" />
+      <rect
+         id="rect2054"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.063;stroke-linejoin:round"
+         rx="2.0453999"
+         ry="1.4744999"
+         height="56.282001"
+         width="74.653"
+         y="25.702999"
+         x="44.497002" />
+      <rect
+         id="rect2056"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.063;stroke-linejoin:round"
+         rx="1.8157001"
+         ry="1.2523"
+         height="31.224001"
+         width="50.282001"
+         y="104.02"
+         x="54.873001" />
+      <rect
+         id="rect2060"
+         style="fill:#ffffff;stroke:#000000;stroke-width:3.063;stroke-linejoin:round"
+         rx="1.8157001"
+         ry="1.2523"
+         height="31.224001"
+         width="38.050999"
+         y="104.02"
+         x="54.419998" />
+      <rect
+         id="rect2058"
+         style="fill:#000000"
+         height="20.587"
+         width="9.9589005"
+         y="108.85"
+         x="59.660999" />
+    </g>
+  </g>
+  <metadata
+     id="metadata1">
+    <rdf:RDF>
+      <cc:Work>
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <cc:license
+           rdf:resource="http://creativecommons.org/licenses/publicdomain/" />
+        <dc:publisher>
+          <cc:Agent
+             rdf:about="http://openclipart.org/">
+            <dc:title>Openclipart</dc:title>
+          </cc:Agent>
+        </dc:publisher>
+        <dc:title>Floppy disk icon</dc:title>
+        <dc:date>2006-12-26T00:00:00</dc:date>
+        <dc:description />
+        <dc:source>https://openclipart.org/detail/24502/-by--24502</dc:source>
+        <dc:creator>
+          <cc:Agent>
+            <dc:title>Anonymous</dc:title>
+          </cc:Agent>
+        </dc:creator>
+      </cc:Work>
+      <cc:License
+         rdf:about="http://creativecommons.org/licenses/publicdomain/">
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Reproduction" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#Distribution" />
+        <cc:permits
+           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+      </cc:License>
+    </rdf:RDF>
+  </metadata>
+</svg>
index ac9bece2e49b7b68c69b58c1b59ff29191b94906..e9220f3a100e7e047e07120e8ff9e8b48bb76d1b 100644 (file)
--- a/window.py
+++ b/window.py
@@ -6,7 +6,7 @@
 # You should have received a copy of the GNU General Public License along with MedScript. If not, see <https://www.gnu.org/licenses/>.
 
 import os, sys, datetime, dateutil.parser, webbrowser
-from PyQt6.QtCore import QDateTime, pyqtSignal
+from PyQt6.QtCore import QDateTime, QSize, pyqtSignal
 from PyQt6.QtWidgets import QWidget, QMainWindow, QMessageBox, QLabel, QPushButton, QLineEdit, QTextEdit, QDateTimeEdit, QListWidget, QComboBox, QCheckBox, QVBoxLayout, QHBoxLayout, QFormLayout, QToolBar, QTabWidget, QStatusBar, QFileDialog
 from PyQt6.QtGui import QAction, QIcon
 from pathlib import Path
@@ -191,20 +191,33 @@ class MainWindow(QMainWindow):
         self.setWindowTitle("MedScript")
         self.setGeometry(100, 100, 600, 400)
 
+        icon_open=QIcon("resource/icon_open.svg")
+        icon_save=QIcon("resource/icon_save.svg")
+        icon_render=QIcon("resource/icon_render.svg")
+        icon_refresh=QIcon("resource/icon_refresh.svg")
+
         action_new=QAction("New", self)
         action_new.triggered.connect(self.cmd_new)
         action_open=QAction("Open", self)
+        action_open2=QAction(icon_open, "Open", self)
         action_open.triggered.connect(self.cmd_open)
+        action_open2.triggered.connect(self.cmd_open)
         action_save=QAction("Save", self)
+        action_save2=QAction(icon_save, "Save", self)
         action_save.triggered.connect(self.cmd_save)
+        action_save2.triggered.connect(self.cmd_save)
         action_save_as=QAction("Save As", self)
         action_save_as.triggered.connect(self.cmd_save_as)
         action_refresh=QAction("Refresh", self)
+        action_refresh2=QAction(icon_refresh, "Refresh", self)
         action_refresh.triggered.connect(self.cmd_refresh)
+        action_refresh2.triggered.connect(self.cmd_refresh)
         action_quit=QAction("Quit", self)
         action_quit.triggered.connect(self.cmd_quit)
         action_render=QAction("Render", self)
+        action_render2=QAction(icon_render, "Render", self)
         action_render.triggered.connect(self.cmd_render)
+        action_render2.triggered.connect(self.cmd_render)
         action_prescriber=QAction("Prescriber", self)
         action_prescriber.triggered.connect(self.cmd_prescriber)
         action_about=QAction("About", self)
@@ -228,10 +241,11 @@ class MainWindow(QMainWindow):
         menu_help.addAction(action_help)
 
         toolbar=QToolBar("Main Toolbar", floatable=False, movable=False)
-        toolbar.addAction(action_open)
-        toolbar.addAction(action_save)
-        toolbar.addAction(action_refresh)
-        toolbar.addAction(action_render)
+        toolbar.setIconSize(QSize(16, 16))
+        toolbar.addAction(action_open2)
+        toolbar.addAction(action_save2)
+        toolbar.addAction(action_refresh2)
+        toolbar.addAction(action_render2)
         self.addToolBar(toolbar)
 
         tab_info=QWidget(self)