From be446998c17ff2978b8e735a3c0c18e9d59574db Mon Sep 17 00:00:00 2001 From: Agnibho Mondal Date: Fri, 1 Sep 2023 21:47:01 +0530 Subject: [PATCH] Added toolbar icons --- resource/icon_open.svg | 105 ++++++++++++++++++++++++++++++ resource/icon_refresh.svg | 120 +++++++++++++++++++++++++++++++++++ resource/icon_render.svg | 128 +++++++++++++++++++++++++++++++++++++ resource/icon_save.svg | 130 ++++++++++++++++++++++++++++++++++++++ window.py | 24 +++++-- 5 files changed, 502 insertions(+), 5 deletions(-) create mode 100644 resource/icon_open.svg create mode 100644 resource/icon_refresh.svg create mode 100644 resource/icon_render.svg create mode 100644 resource/icon_save.svg diff --git a/resource/icon_open.svg b/resource/icon_open.svg new file mode 100644 index 0000000..dc40fc3 --- /dev/null +++ b/resource/icon_open.svg @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Paperface 2 + 2006-12-26T00:00:00 + + https://openclipart.org/detail/24799/-by--24799 + + + Anonymous + + + + + + + + + + + diff --git a/resource/icon_refresh.svg b/resource/icon_refresh.svg new file mode 100644 index 0000000..b63232a --- /dev/null +++ b/resource/icon_refresh.svg @@ -0,0 +1,120 @@ + + + + + Reload icon + + + + + + + + + + + image/svg+xml + + + + Openclipart + + + Reload icon + 2012-07-06T14:30:15 + https://openclipart.org/detail/171074/reload-icon-by-mlampret-171074 + + + mlampret + + + + + black + free + icon + icons + recycle + reload + simple + + + + simple reload / recycle icon + + + + + + + + + diff --git a/resource/icon_render.svg b/resource/icon_render.svg new file mode 100644 index 0000000..3074f67 --- /dev/null +++ b/resource/icon_render.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Printer icon + 2006-12-26T00:00:00 + + https://openclipart.org/detail/24825/-by--24825 + + + Anonymous + + + + + + + + + + + diff --git a/resource/icon_save.svg b/resource/icon_save.svg new file mode 100644 index 0000000..9502b23 --- /dev/null +++ b/resource/icon_save.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + Floppy disk icon + 2006-12-26T00:00:00 + + https://openclipart.org/detail/24502/-by--24502 + + + Anonymous + + + + + + + + + + + diff --git a/window.py b/window.py index ac9bece..e9220f3 100644 --- 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 . 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) -- 2.39.2