]> Softwares of Agnibho - medscript.git/commitdiff
Added stylesheet
authorAgnibho Mondal <mondal@agnibho.com>
Fri, 15 Sep 2023 21:51:43 +0000 (03:21 +0530)
committerAgnibho Mondal <mondal@agnibho.com>
Fri, 15 Sep 2023 21:51:43 +0000 (03:21 +0530)
medscript.py
renderbox.py
resource/style.qss [new file with mode: 0644]
window.py

index 7c0bd27f6cda18022a47c505345e3a330d51a031..0659c46d1ace9cf2a8045daf8c161fcbd0bd79e9 100644 (file)
@@ -5,11 +5,13 @@
 # MedScript is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 # You should have received a copy of the GNU General Public License along with MedScript. If not, see <https://www.gnu.org/licenses/>.
 
-import sys
+import sys, os
 from PyQt6.QtWidgets import QApplication
 from window import MainWindow
 
 if __name__=="__main__":
     app=QApplication(sys.argv)
+    with open(os.path.join("resource", "style.qss")) as qss:
+        app.setStyleSheet(qss.read())
     window=MainWindow()
     sys.exit(app.exec())
index c0f19a045e09860e68df9754a4647478f156e0a9..037b9de7a6144d342c16f3b8ad483165e0798c61 100644 (file)
@@ -5,9 +5,9 @@
 # MedScript is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 # You should have received a copy of the GNU General Public License along with MedScript. If not, see <https://www.gnu.org/licenses/>.
 
-from PyQt6.QtWidgets import QWidget, QMainWindow, QToolBar, QFileDialog, QComboBox, QSizePolicy
+from PyQt6.QtWidgets import QWidget, QMainWindow, QToolBar, QFileDialog, QComboBox, QPushButton, QSizePolicy
 from PyQt6.QtWebEngineWidgets import QWebEngineView
-from PyQt6.QtGui import QAction, QIcon, QPageLayout, QPageSize
+from PyQt6.QtGui import QIcon, QPageLayout, QPageSize
 from PyQt6.QtCore import QUrl, QMarginsF
 from PyQt6.QtPrintSupport import QPrinter, QPrintDialog
 import os
@@ -35,15 +35,15 @@ class RenderBox(QMainWindow):
 
         self.printer=QPrinter(QPrinter.PrinterMode.HighResolution)
 
-        action_pdf=QAction("Save PDF", self)
-        action_pdf.setShortcut("Ctrl+S")
-        action_pdf.triggered.connect(self.cmd_pdf)
-        action_print=QAction("Print Document", self)
-        action_print.setShortcut("Ctrl+P")
-        action_print.triggered.connect(self.cmd_print)
-        action_close=QAction("Close Window", self)
-        action_close.setShortcut("Ctrl+Q")
-        action_close.triggered.connect(self.hide)
+        button_pdf=QPushButton("Save PDF", self)
+        button_pdf.setShortcut("Ctrl+S")
+        button_pdf.clicked.connect(self.cmd_pdf)
+        button_print=QPushButton("Print Document", self)
+        button_print.setShortcut("Ctrl+P")
+        button_print.clicked.connect(self.cmd_print)
+        button_close=QPushButton("Close Window", self)
+        button_close.setShortcut("Ctrl+Q")
+        button_close.clicked.connect(self.hide)
 
         page_size=[]
         for size in QPageSize.PageSizeId:
@@ -53,12 +53,12 @@ class RenderBox(QMainWindow):
 
         toolbar=QToolBar("View Toolbar", floatable=False, movable=False)
         toolbar.addWidget(self.input_size)
-        toolbar.addAction(action_pdf)
+        toolbar.addWidget(button_pdf)
         spacer=QWidget(self)
         spacer.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
         toolbar.addWidget(spacer)
-        toolbar.addAction(action_print)
-        toolbar.addAction(action_close)
+        toolbar.addWidget(button_print)
+        toolbar.addWidget(button_close)
         self.addToolBar(toolbar)
 
         self.webview=QWebEngineView()
diff --git a/resource/style.qss b/resource/style.qss
new file mode 100644 (file)
index 0000000..f6f8b63
--- /dev/null
@@ -0,0 +1,7 @@
+QLabel, QLineEdit, QTextEdit, QPushButton, QCheckBox, QComboBox {
+font-size: 14px;
+}
+
+.info_head {
+font-weight: bold;
+}
index 3a7e09cbcdd7e1d8841704f28430dbdff46f6588..78091eaea7b4e84dd2926c32f5b4eccceab54b05 100644 (file)
--- a/window.py
+++ b/window.py
@@ -502,6 +502,7 @@ class MainWindow(QMainWindow):
         spacer.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
         toolbar.addWidget(spacer)
         self.label_prescriber=QLabel(self)
+        self.label_prescriber=QLabel(self)
         toolbar.addWidget(self.label_prescriber)
         self.addToolBar(toolbar)
 
@@ -552,6 +553,7 @@ class MainWindow(QMainWindow):
         layout_note=QVBoxLayout(tab_note)
         layout_note2=QHBoxLayout()
         label_note=QLabel("Clinical Notes")
+        label_note.setProperty("class", "info_head")
         self.input_note_preset=QComboBox(self)
         self.input_note_preset.addItems(self.preset_note.data.keys())
         self.input_note_preset.setCurrentIndex(-1)
@@ -572,6 +574,7 @@ class MainWindow(QMainWindow):
         layout_report=QVBoxLayout(tab_report)
         layout_report2=QHBoxLayout()
         label_report=QLabel("Available Reports")
+        label_report.setProperty("class", "info_head")
         self.input_report_preset=QComboBox(self)
         self.input_report_preset.addItems(self.preset_report.data.keys())
         self.input_report_preset.setCurrentIndex(-1)
@@ -592,6 +595,7 @@ class MainWindow(QMainWindow):
         layout_advice=QVBoxLayout(tab_advice)
         layout_advice2=QHBoxLayout()
         label_advice=QLabel("Advice")
+        label_advice.setProperty("class", "info_head")
         self.input_advice_preset=QComboBox(self)
         self.input_advice_preset.addItems(self.preset_advice.data.keys())
         self.input_advice_preset.setCurrentIndex(-1)
@@ -612,6 +616,7 @@ class MainWindow(QMainWindow):
         layout_investigation=QVBoxLayout(tab_investigation)
         layout_investigation2=QHBoxLayout()
         label_investigation=QLabel("Recommended Investigations")
+        label_investigation.setProperty("class", "info_head")
         self.input_investigation_preset=QComboBox(self)
         self.input_investigation_preset.addItems(self.preset_investigation.data.keys())
         self.input_investigation_preset.setCurrentIndex(-1)
@@ -632,6 +637,7 @@ class MainWindow(QMainWindow):
         layout_medication=QVBoxLayout(tab_medication)
         layout_medication2=QHBoxLayout()
         label_medication=QLabel("Medication Advice")
+        label_medication.setProperty("class", "info_head")
         self.input_medication_preset=QComboBox(self)
         self.input_medication_preset.addItems(self.preset_medication.data.keys())
         self.input_medication_preset.setCurrentIndex(-1)
@@ -652,6 +658,7 @@ class MainWindow(QMainWindow):
         layout_additional=QVBoxLayout(tab_additional)
         layout_additional2=QHBoxLayout()
         label_additional=QLabel("Additional Advice")
+        label_additional.setProperty("class", "info_head")
         self.input_additional_preset=QComboBox(self)
         self.input_additional_preset.addItems(self.preset_additional.data.keys())
         self.input_additional_preset.setCurrentIndex(-1)
@@ -672,6 +679,7 @@ class MainWindow(QMainWindow):
         layout_attachment=QVBoxLayout(tab_attachment)
         layout_attachment2=QHBoxLayout()
         label_attachment=QLabel("Attached files")
+        label_attachment.setProperty("class", "info_head")
         self.input_attachment=QListWidget(self)
         button_add=QPushButton("Add")
         button_add.clicked.connect(self.add_attachment)