diff options
author | pravindalve | 2020-06-11 10:12:14 +0530 |
---|---|---|
committer | GitHub | 2020-06-11 10:12:14 +0530 |
commit | ced055b07a31720d12a7efce1f7c5c0c388d03a5 (patch) | |
tree | 5fde7b957c48647edbe0b6400a9699e27c0a6f02 /src | |
parent | 150b7bb892ed82521a5b00372e6a9f3eefce243f (diff) | |
parent | 3784ed1902d6eeb24d69d44d9158153065b850bb (diff) | |
download | Chemical-PFD-ced055b07a31720d12a7efce1f7c5c0c388d03a5.tar.gz Chemical-PFD-ced055b07a31720d12a7efce1f7c5c0c388d03a5.tar.bz2 Chemical-PFD-ced055b07a31720d12a7efce1f7c5c0c388d03a5.zip |
Merge pull request #14 from Blakeinstein/master
UI update with qss file.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/python/main.py | 29 | ||||
-rw-r--r-- | src/main/python/utils/app.py | 12 | ||||
-rw-r--r-- | src/main/python/utils/dialogs.py | 1 | ||||
-rw-r--r-- | src/main/python/utils/fileWindow.py | 14 | ||||
-rw-r--r-- | src/main/python/utils/tabs.py | 22 | ||||
-rw-r--r-- | src/main/python/utils/toolbar.py | 40 | ||||
-rw-r--r-- | src/main/resources/base/Compressors/Centrifugal Compressor.svg | 123 | ||||
-rw-r--r-- | src/main/resources/base/Compressors/Ejector Compressor.svg | 66 | ||||
-rw-r--r-- | src/main/resources/base/Compressors/Fan.svg | 109 | ||||
-rw-r--r-- | src/main/resources/base/Compressors/Positive Displacement Compressor.svg | 94 | ||||
-rw-r--r-- | src/main/resources/base/Compressors/Reciprocating Compressor.svg | 99 | ||||
-rw-r--r-- | src/main/resources/base/Compressors/Turbine.svg | 104 | ||||
-rw-r--r-- | src/main/resources/base/app.qss | 187 | ||||
-rw-r--r-- | src/main/resources/base/ui/close.svg | 60 |
14 files changed, 288 insertions, 672 deletions
diff --git a/src/main/python/main.py b/src/main/python/main.py index ed64570..9def7fb 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -60,11 +60,6 @@ class appWindow(QMainWindow): # self.resize(1280, 720) #set collapse dim self.mdi.subWindowActivated.connect(self.tabSwitched) self.readSettings() - - def updateMenuBar(self): - # used to update menu bar undo-redo buttons to current scene - self.undo.triggered.connect(self.activeScene.painter.undoAction.trigger()) - self.redo.triggered.connect(self.activeScene.painter.redoAction.trigger()) def createToolbar(self): #place holder for toolbar with fixed width, layout may change @@ -76,13 +71,14 @@ class appWindow(QMainWindow): self.toolbar.populateToolbar() def toolButtonClicked(self, object): - currentDiagram = self.mdi.currentSubWindow().tabber.currentWidget().painter - if currentDiagram: - graphic = getattr(shapes, object['object'])(*map(lambda x: int(x) if x.isdigit() else x, object['args'])) - # graphic.setPen(QPen(Qt.black, 2)) - # graphic.setFlags(QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsMovable) - currentDiagram.addItemPlus(graphic) - graphic.setPos(20, 20) + if self.mdi.currentSubWindow(): + currentDiagram = self.mdi.currentSubWindow().tabber.currentWidget().painter + if currentDiagram: + graphic = getattr(shapes, object['object'])(*map(lambda x: int(x) if x.isdigit() else x, object['args'])) + # graphic.setPen(QPen(Qt.black, 2)) + # graphic.setFlags(QGraphicsItem.ItemIsSelectable | QGraphicsItem.ItemIsMovable) + currentDiagram.addItemPlus(graphic) + graphic.setPos(20, 20) def newProject(self): #call to create a new file inside mdi area @@ -93,7 +89,6 @@ class appWindow(QMainWindow): project.newDiagram() #create a new tab in the new file # project.resizeHandler() project.fileCloseEvent.connect(self.fileClosed) #closed file signal to switch to sub window view - project.tabChangeEvent.connect(self.updateMenuBar) if self.count > 1: #switch to tab view if needed self.mdi.setViewMode(QMdiArea.TabbedView) project.show() @@ -110,7 +105,6 @@ class appWindow(QMainWindow): project.__setstate__(projectData) project.resizeHandler() project.fileCloseEvent.connect(self.fileClosed) - project.tabChangeEvent.connect(self.updateMenuBar) project.show() if self.count > 1: # self.tabSpace.setVisible(True) @@ -218,12 +212,7 @@ class appWindow(QMainWindow): else: return event.accept() - - elif event.key() == Qt.Key_Delete or event.key() == Qt.Key_Backspace: - for item in reversed(self.mdi.activeSubWindow().tabber.currentWidget().painter.selectedItems()): - # self.mdi.currentSubWindow().tabber.currentWidget().deleteItem(item) - pass - #donot delete, to manage undo redo + if __name__ == '__main__': # 1. Instantiate ApplicationContext diff --git a/src/main/python/utils/app.py b/src/main/python/utils/app.py index 4cc8228..96a45b0 100644 --- a/src/main/python/utils/app.py +++ b/src/main/python/utils/app.py @@ -3,7 +3,9 @@ Declare fbs application so that it can be imported in other modules. """ from fbs_runtime.application_context.PyQt5 import ApplicationContext -from PyQt5.QtCore import QSettings +from PyQt5.QtCore import QSettings, pyqtProperty +from PyQt5.QtGui import QIcon +from PyQt5.QtWidgets import QWidget from json import JSONEncoder, dumps, loads, dump, load from os.path import join @@ -15,6 +17,9 @@ def fileImporter(*file): # Helper function to fetch files from src/main/resources return app.get_resource(join(*file)) +with open(fileImporter("app.qss"), "r") as stylesheet: + app.app.setStyleSheet(stylesheet.read()) + class JSON_Encoder: def _encode(obj): @@ -52,6 +57,9 @@ class JSON_Typer(JSONEncoder): def encode(self, obj): return super(JSON_Typer, self).encode(self._encode(obj)) - + + +importer = pyqtProperty(str, fileImporter) + shapeGrips = {} lines = {}
\ No newline at end of file diff --git a/src/main/python/utils/dialogs.py b/src/main/python/utils/dialogs.py index 79685c5..f2c4eb9 100644 --- a/src/main/python/utils/dialogs.py +++ b/src/main/python/utils/dialogs.py @@ -58,7 +58,6 @@ class paperDims(QDialog): super(paperDims, self).exec_() self.deleteLater() #remove from memory #if ok was pressed return value else return None - print(self.landscapeCheckBox.isChecked()) return (self.returnCanvasSize, self.returnCanvasPPI, self.landscapeCheckBox.isChecked()) if self.result() else None class sideViewSwitchDialog(QDialog): diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py index e0f5652..ba0b6e9 100644 --- a/src/main/python/utils/fileWindow.py +++ b/src/main/python/utils/fileWindow.py @@ -61,20 +61,6 @@ class fileWindow(QMdiSubWindow): self.sideView.setInteractive(False) self.sideViewCloseButton = QPushButton('×', self.sideView) self.sideViewCloseButton.setFlat(True) - self.sideViewCloseButton.setStyleSheet("""QPushButton{ - background: rgba(214, 54, 40, 50%); - border: 1px groove white; - border-radius: 2px; - font-size: 18px; - font-weight: Bold; - padding: 1px 2px 3px 3px; - color: rgba(255, 255, 255, 50%); - } - QPushButton:Hover{ - background: rgba(214, 54, 40, 90%); - color: rgba(255, 255, 255, 90%); - } - """) self.sideViewCloseButton.setFixedSize(20, 20) self.moveSideViewCloseButton() self.sideViewCloseButton.clicked.connect(lambda: setattr(self, 'sideViewTab', None)) diff --git a/src/main/python/utils/tabs.py b/src/main/python/utils/tabs.py index 5196557..1431db2 100644 --- a/src/main/python/utils/tabs.py +++ b/src/main/python/utils/tabs.py @@ -41,19 +41,9 @@ class customTabWidget(QTabWidget): self.plusButton = QPushButton('+', self) #create the new tab button #style the new tab button self.plusButton.setFlat(True) - self.plusButton.setStyleSheet(""" - QPushButton{ - background: rgba(230, 230, 227, 0%); - padding: 1px; - border: 0px solid #E6E6E3; - - } - QPushButton:hover{ - background: rgba(230, 230, 227, 60%); - }""") #and parent it to the widget to add it at 0, 0 - self.plusButton.setFixedSize(35, 25) #set dimensions + self.plusButton.setFixedSize(25, 25) #set dimensions self.plusButton.clicked.connect(self.plusClicked.emit) #emit signal on click #set flags self.setMovable(True) @@ -64,23 +54,17 @@ class customTabWidget(QTabWidget): self.tab.nameChanged.connect(self.changeWidgetName) #set custom stylesheet for the widget area - self.setStyleSheet("""QTabWidget::pane { - margin: 0px,1px,1px,1px; - border: 2px solid #E6E6E3; - border-radius: 7px; - padding: 1px; - background-color: #E6E6E3;}""") def movePlusButton(self): #move the new tab button to correct location size = sum([self.tab.tabRect(i).width() for i in range(self.tab.count())]) # calculate width of all tabs - h = max(self.tab.geometry().bottom() - self.plusButton.height(), 0) #align with bottom of tabbar + h = max(self.tab.geometry().bottom() - self.plusButton.height()-10, -5) #align with bottom of tabbar w = self.tab.width() if size > w: #if all the tabs do not overflow the tab bar, add at the end self.plusButton.move(w-self.plusButton.width(), h) else: - self.plusButton.move(size-3, h) + self.plusButton.move(size+5, h) def changeWidgetName(self, index, newName): self.widget(index).setObjectName(newName)
\ No newline at end of file diff --git a/src/main/python/utils/toolbar.py b/src/main/python/utils/toolbar.py index 90b46fb..beac867 100644 --- a/src/main/python/utils/toolbar.py +++ b/src/main/python/utils/toolbar.py @@ -2,11 +2,11 @@ from fbs_runtime.application_context.PyQt5 import ApplicationContext from PyQt5.QtCore import QSize, Qt, pyqtSignal, QMimeData from PyQt5.QtGui import QIcon, QDrag from PyQt5.QtWidgets import (QBoxLayout, QDockWidget, QGridLayout, QLineEdit, - QScrollArea, QToolButton, QWidget, QApplication, QStyle, QLabel) + QScrollArea, QToolButton, QWidget, QStyle, QLabel) from re import search, IGNORECASE from .data import toolbarItems -from .app import fileImporter +from .app import fileImporter, app from .layout import flowLayout # resourceManager = ApplicationContext() #Used to load images, mainly toolbar icons @@ -39,14 +39,14 @@ class toolbar(QDockWidget): #create a scrollable area to house all buttons self.diagArea = QScrollArea(self) - self.diagArea.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) + self.diagArea.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) self.diagArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.diagArea.setWidgetResizable(True) self.layout.addWidget(self.diagArea, stretch=1) self.diagAreaWidget = QWidget(self.diagArea) #inner widget for scroll area #custom layout for inner widget self.diagAreaLayout = flowLayout(self.diagAreaWidget) - + self.diagAreaLayout.setSizeConstraint(flowLayout.SetMinimumSize) self.setWidget(self.widget) #set main widget to dockwidget def clearLayout(self): @@ -81,18 +81,25 @@ class toolbar(QDockWidget): parent = self.parentWidget() #used to get parent dimensions self.layout.setDirection(QBoxLayout.TopToBottom) # here so that a horizontal toolbar can be implemented later # self.setFixedHeight(self.height()) #span available height - width = self.width() - QApplication.style().pixelMetric(QStyle.PM_ScrollBarExtent) + self.searchBox.setMinimumWidth(.15*parent.width()) + width = self.width() + scrollBar = self.diagArea.verticalScrollBar() + height = self.diagAreaLayout.heightForWidth(width) + if scrollBar.isVisible(): + width -= app.app.style().pixelMetric(QStyle.PM_ScrollBarExtent) # the following line, sets the required height for the current width, so that blank space doesnt occur - self.diagAreaWidget.setMinimumHeight(self.diagAreaLayout.heightForWidth(width)) - self.setMinimumWidth(.17*parent.width()) #12% of parent width + self.diagAreaWidget.setMinimumHeight(height) + self.setMinimumWidth(.18*parent.width()) #12% of parent width # self.setMinimumWidth(self.diagAreaLayout.minimumSize().width()) #12% of parent width self.diagAreaWidget.setLayout(self.diagAreaLayout) self.diagArea.setWidget(self.diagAreaWidget) for _, label in self.toolbarLabelDict.items(): - label.setFixedSize(width, 20) - + label.setFixedWidth(width) + + def resizeEvent(self, event): + self.resize() def toolbarItems(self, itemClasses): #helper functions to create required buttons @@ -139,7 +146,7 @@ class toolbarButton(QToolButton): #handles drag if not (event.buttons() and Qt.LeftButton): return #ignore if left click is not held - if (event.pos() - self.dragStartPosition).manhattanLength() < QApplication.startDragDistance(): + if (event.pos() - self.dragStartPosition).manhattanLength() < app.app.startDragDistance(): return #check if mouse was dragged enough, manhattan length is a rough and quick method in qt drag = QDrag(self) #create drag object @@ -155,17 +162,8 @@ class toolbarButton(QToolButton): def minimumSizeHint(self): #defines button size return QSize(40, 40) - + class sectionLabel(QLabel): def __init__(self, *args): - super(sectionLabel, self).__init__(*args) - self.setAlignment(Qt.AlignHCenter) - self.setStyleSheet(""" - QLabel{ - background-color: #E6E6E3; - border: 2px solid gray; - border-left: 0px; - background-clip: padding; - } - """)
\ No newline at end of file + super(sectionLabel, self).__init__(*args)
\ No newline at end of file diff --git a/src/main/resources/base/Compressors/Centrifugal Compressor.svg b/src/main/resources/base/Compressors/Centrifugal Compressor.svg deleted file mode 100644 index 15ae554..0000000 --- a/src/main/resources/base/Compressors/Centrifugal Compressor.svg +++ /dev/null @@ -1,123 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - sodipodi:docname="Centrifugal Compressor.svg" - inkscape:version="1.0 (4035a4fb49, 2020-05-01)" - id="svg989" - version="1.1" - viewBox="0 0 39.831303 20.844073" - height="20.844072mm" - width="39.831303mm"> - <defs - id="defs983"> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient4621" - id="linearGradient4623" - x1="552.6012" - y1="62.347649" - x2="557.84564" - y2="62.347649" - gradientUnits="userSpaceOnUse" - gradientTransform="translate(-432.22912,85.871922)" /> - <linearGradient - id="linearGradient4621" - osb:paint="solid"> - <stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop4619" /> - </linearGradient> - </defs> - <sodipodi:namedview - inkscape:window-maximized="0" - inkscape:window-y="0" - inkscape:window-x="157" - inkscape:window-height="1020" - inkscape:window-width="1741" - showgrid="false" - inkscape:document-rotation="0" - inkscape:current-layer="layer1" - inkscape:document-units="mm" - inkscape:cy="65.68083" - inkscape:cx="89.712248" - inkscape:zoom="3.959798" - inkscape:pageshadow="2" - inkscape:pageopacity="0.0" - borderopacity="1.0" - bordercolor="#666666" - pagecolor="#ffffff" - id="base" /> - <metadata - id="metadata986"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - transform="translate(-85.917679,-137.82627)" - id="layer1" - inkscape:groupmode="layer" - inkscape:label="Layer 1"> - <g - id="g1606"> - <path - inkscape:connector-curvature="0" - id="path3798" - d="m 96.20808,137.99608 20.59969,5.19717 v 10.20535 l -20.59969,5.10268 z" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <path - inkscape:connector-curvature="0" - id="path3800" - d="M 96.25532,145.63828 H 86.04997 v 5.10268 H 96.3498" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <path - inkscape:connector-curvature="0" - id="path3802" - d="m 116.68966,148.22506 h 3.59077" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <path - inkscape:connector-curvature="0" - id="path3806" - d="m 102.64232,137.9183 v 1.68714" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <path - inkscape:connector-curvature="0" - id="path3810" - d="m 110.9019,137.90158 v 3.9215" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <rect - style="fill:#ffffff;stroke:url(#linearGradient4623);stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - y="145.73911" - x="120.37206" - height="4.9609375" - width="5.2444196" - id="rect3812" /> - <text - id="text4627" - y="149.72087" - x="121.21709" - style="font-style:normal;font-weight:normal;font-size:4.23333px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" - xml:space="preserve"><tspan - style="font-size:4.23333px;stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - y="149.72087" - x="121.21709" - id="tspan4625" - sodipodi:role="line">M</tspan></text> - </g> - </g> -</svg> diff --git a/src/main/resources/base/Compressors/Ejector Compressor.svg b/src/main/resources/base/Compressors/Ejector Compressor.svg deleted file mode 100644 index cb345d1..0000000 --- a/src/main/resources/base/Compressors/Ejector Compressor.svg +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - id="svg983" - version="1.1" - viewBox="0 0 24.561319 6.5105553" - height="6.5105553mm" - width="24.561319mm"> - <defs - id="defs977"> - <linearGradient - xlink:href="#linearGradient5003" - id="linearGradient5005" - x1="523.9151" - y1="136.07031" - x2="530.93091" - y2="136.07031" - gradientUnits="userSpaceOnUse" - gradientTransform="matrix(0.9248707,0,0,0.9248707,-356.29188,11.161605)" /> - <linearGradient - id="linearGradient5003" - osb:paint="solid"> - <stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop5001" /> - </linearGradient> - </defs> - <metadata - id="metadata980"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - transform="translate(-128.12939,-133.68995)" - id="layer1"> - <g - style="stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - id="g1575"> - <rect - y="133.95006" - x="128.26189" - height="6.1179466" - width="6.4887304" - id="rect4999" - style="fill:#ffffff;stroke:url(#linearGradient5005);stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" /> - <path - id="path5007" - d="m 134.83292,138.79118 17.72492,1.07719 -0.0246,-6.03313 -17.72329,1.67043" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - </g> - </g> -</svg> diff --git a/src/main/resources/base/Compressors/Fan.svg b/src/main/resources/base/Compressors/Fan.svg deleted file mode 100644 index b23a097..0000000 --- a/src/main/resources/base/Compressors/Fan.svg +++ /dev/null @@ -1,109 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - id="svg1609" - version="1.1" - viewBox="0 0 22.314726 10.768025" - height="10.768025mm" - width="22.314726mm"> - <defs - id="defs1603"> - <linearGradient - xlink:href="#linearGradient5019" - id="linearGradient5021" - x1="526.4541" - y1="146.42702" - x2="537.41211" - y2="146.42702" - gradientUnits="userSpaceOnUse" - gradientTransform="translate(-217.02286,-18.174328)" /> - <linearGradient - id="linearGradient5019" - osb:paint="solid"> - <stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop5017" /> - </linearGradient> - <linearGradient - xlink:href="#linearGradient5019" - id="linearGradient5025" - gradientUnits="userSpaceOnUse" - x1="526.4541" - y1="146.42702" - x2="537.41211" - y2="146.42702" - gradientTransform="translate(-205.93117,-18.174328)" /> - <linearGradient - xlink:href="#linearGradient5019" - id="linearGradient5035" - gradientUnits="userSpaceOnUse" - x1="550.97614" - y1="119.36598" - x2="555.65332" - y2="119.36598" - gradientTransform="translate(-232.85061,15.414093)" /> - </defs> - <metadata - id="metadata1606"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - transform="translate(-87.872402,-124.6398)" - id="layer1"> - <g - style="stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - id="g5850" - transform="translate(-221.42632,-1.7097248)"> - <ellipse - ry="1.7706606" - rx="5.4790258" - cy="128.25269" - cx="314.91025" - id="path5015" - style="fill:#ffffff;stroke:url(#linearGradient5021);stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" /> - <ellipse - style="fill:#ffffff;stroke:url(#linearGradient5025);stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - id="ellipse5023" - cx="326.00192" - cy="128.25269" - rx="5.4790258" - ry="1.7706606" /> - <path - id="path5027" - d="m 320.45616,128.48655 v 4.00904" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <rect - style="fill:#ffffff;stroke:url(#linearGradient5035);stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - id="rect5029" - width="4.6772165" - height="4.4099469" - x="318.12555" - y="132.5751" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.52778px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" - x="318.94144" - y="136.06596" - id="text5033"><tspan - id="tspan5031" - x="318.94144" - y="136.06596" - style="font-size:3.52778px;stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none">M</tspan></text> - </g> - </g> -</svg> diff --git a/src/main/resources/base/Compressors/Positive Displacement Compressor.svg b/src/main/resources/base/Compressors/Positive Displacement Compressor.svg deleted file mode 100644 index 99802b2..0000000 --- a/src/main/resources/base/Compressors/Positive Displacement Compressor.svg +++ /dev/null @@ -1,94 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - id="svg1647" - version="1.1" - viewBox="0 0 19.206747 19.125592" - height="19.125591mm" - width="19.206747mm"> - <defs - id="defs1641"> - <linearGradient - xlink:href="#linearGradient4635" - id="linearGradient4637" - x1="532.47394" - y1="91.475433" - x2="540.97839" - y2="91.475433" - gradientUnits="userSpaceOnUse" - gradientTransform="translate(-393.96549,71.734459)" /> - <linearGradient - id="linearGradient4635" - osb:paint="solid"> - <stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop4633" /> - </linearGradient> - <marker - orient="auto" - refY="0" - refX="0" - id="Arrow2Lstart" - style="overflow:visible"> - <path - id="path4665" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" - transform="matrix(1.1,0,0,1.1,1.1,0)" /> - </marker> - <marker - orient="auto" - refY="0" - refX="0" - id="Arrow2Lend" - style="overflow:visible"> - <path - id="path4668" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> - </marker> - </defs> - <metadata - id="metadata1644"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - transform="translate(-133.31128,-156.841)" - id="layer1"> - <g - style="stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - id="g2332"> - <path - id="path4629" - d="m 133.31128,173.98222 h 4.06326 v -17.00893 h 11.24479 l -0.0236,17.03255 3.9215,-0.0236" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <rect - y="162.07596" - x="138.50845" - height="2.2678571" - width="8.5044641" - id="rect4631" - style="fill:#ffffff;stroke:url(#linearGradient4637);stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" /> - <path - id="path4639" - d="m 142.76069,164.43832 v 11.52827" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - </g> - </g> -</svg> diff --git a/src/main/resources/base/Compressors/Reciprocating Compressor.svg b/src/main/resources/base/Compressors/Reciprocating Compressor.svg deleted file mode 100644 index 521e144..0000000 --- a/src/main/resources/base/Compressors/Reciprocating Compressor.svg +++ /dev/null @@ -1,99 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - inkscape:version="1.0 (4035a4fb49, 2020-05-01)" - sodipodi:docname="Reciprocating Compressor.svg" - width="29.586315mm" - height="14.722171mm" - viewBox="0 0 29.586315 14.722171" - version="1.1" - id="svg2363"> - <sodipodi:namedview - inkscape:current-layer="svg2363" - inkscape:window-maximized="1" - inkscape:window-y="-11" - inkscape:window-x="-11" - inkscape:cy="41.59944" - inkscape:cx="37.179616" - inkscape:zoom="4.7773942" - showgrid="false" - id="namedview17" - inkscape:window-height="986" - inkscape:window-width="1920" - inkscape:pageshadow="2" - inkscape:pageopacity="0" - guidetolerance="10" - gridtolerance="10" - objecttolerance="10" - borderopacity="1" - bordercolor="#666666" - pagecolor="#ffffff" /> - <defs - id="defs2357"> - <linearGradient - gradientTransform="translate(-526.19954,-108.91903)" - gradientUnits="userSpaceOnUse" - y2="119.36598" - x2="555.65332" - y1="119.36598" - x1="550.97614" - id="linearGradient4993" - xlink:href="#linearGradient4991" /> - <linearGradient - osb:paint="solid" - id="linearGradient4991"> - <stop - id="stop4989" - offset="0" - style="stop-color:#000000;stop-opacity:1;" /> - </linearGradient> - </defs> - <metadata - id="metadata2360"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - id="g862"> - <path - id="path4975" - d="m 0.132291,7.03037 v 7.55951 h 21.54465 V 6.93587 h -7.55951 V 0.1323 h -7.08708 v 6.61458 h -6.89806 z" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - id="path4985" - d="m 21.769811,10.48035 h 2.93995" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="8.2419739" - x="24.776596" - height="4.4099469" - width="4.6772165" - id="rect4987" - style="fill:#ffffff;stroke:url(#linearGradient4993);stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" /> - <text - id="text4997" - y="11.732819" - x="25.592484" - style="font-style:normal;font-weight:normal;font-size:3.52778px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-size:3.52778px;stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - y="11.732819" - x="25.592484" - id="tspan4995">M</tspan></text> - </g> -</svg> diff --git a/src/main/resources/base/Compressors/Turbine.svg b/src/main/resources/base/Compressors/Turbine.svg deleted file mode 100644 index 6383f61..0000000 --- a/src/main/resources/base/Compressors/Turbine.svg +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - id="svg2245" - version="1.1" - viewBox="0 0 36.083744 21.067864" - height="21.067863mm" - width="36.083744mm"> - <defs - id="defs2239"> - <linearGradient - xlink:href="#linearGradient4991" - id="linearGradient5043" - gradientUnits="userSpaceOnUse" - gradientTransform="translate(-479.53566,-43.473745)" - x1="550.97614" - y1="119.36598" - x2="555.65332" - y2="119.36598" /> - <linearGradient - id="linearGradient4991" - osb:paint="solid"> - <stop - style="stop-color:#000000;stop-opacity:1;" - offset="0" - id="stop4989" /> - </linearGradient> - <marker - orient="auto" - refY="0" - refX="0" - id="marker5089" - style="overflow:visible"> - <path - id="path5087" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> - </marker> - <marker - orient="auto" - refY="0" - refX="0" - id="marker5055" - style="overflow:visible"> - <path - id="path5053" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" - d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" - transform="matrix(-1.1,0,0,-1.1,-1.1,0)" /> - </marker> - </defs> - <metadata - id="metadata2242"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - transform="translate(-40.166464,-64.768355)" - id="layer1"> - <g - style="stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - id="g2942"> - <path - id="path5037" - d="m 61.76161,64.939784 -21.40111,5.59931 -0.0611,9.85655 21.42882,5.27186 z" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <path - id="path5039" - d="m 61.69806,75.864944 0.68965,0.0167 9.10387,0.006" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" /> - <rect - y="73.687271" - x="71.440491" - height="4.4099469" - width="4.6772165" - id="rect5041" - style="fill:#ffffff;stroke:url(#linearGradient5043);stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" /> - <text - id="text5047" - y="77.204559" - x="72.593079" - style="font-style:normal;font-weight:normal;font-size:3.52778px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.8;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none" - xml:space="preserve"><tspan - style="font-size:3.52778px;stroke-width:0.8;stroke-miterlimit:4;stroke-dasharray:none" - y="77.204559" - x="72.593079" - id="tspan5045">T</tspan></text> - </g> - </g> -</svg> diff --git a/src/main/resources/base/app.qss b/src/main/resources/base/app.qss new file mode 100644 index 0000000..0d6e912 --- /dev/null +++ b/src/main/resources/base/app.qss @@ -0,0 +1,187 @@ +QLineEdit { + color: #ffffff; + background-color: #b6b6b6; + selection-color: black; + selection-background-color: #5e90fa; + /* Padding and margin defined */ + border-style: solid; + border: 1px solid #b6b6b6; /* border top color defined after QAbstractSpinBox, QLineEdit and QComboBox */ + border-top-color: #a2a2a0; /* Creates an inset effect inside the elements */ + padding: 2px 6px 2px 6px; /* This makes text colour work on QComboBox */ + margin: 0px 2px 0px 2px; + border-radius: 3px; +} + +QLineEdit:focus{ + border-color: #7cabf9; +} + +QTabBar { + qproperty-drawBase: 0; + left: 5px; + background-color: transparent; +} + +QTabBar:focus { + border: 0px transparent black; +} + +QTabBar::close-button { + padding: 0px; + margin: 0px; + border-radius: 2px; + background-image: url("src/main/resources/base/ui/close.svg"); + background-position: center center; + background-repeat: none; +} + +QTabBar::close-button:hover { + background-color: #7cabf9; +} + +QTabBar::close-button:pressed { + background-color: #adc5ed; +} + +QTabBar::scroller { /* the width of the scroll buttons */ + width: 20px; +} + +QTabBar::tab:top, +QTabBar::tab:bottom { + color: black; + border: 1px solid #b6b6b6; + border-left-color: #e6e6e6; + border-right-width: 0px; + background-color: white; + padding:0px 15px; +} + +QTabBar::tab:top:first, +QTabBar::tab:bottom:first { + border-top-left-radius: 6px; + border-bottom-left-radius: 6px; +} + +QTabBar::tab:top:last, +QTabBar::tab:bottom:last { + border-top-right-radius: 6px; + border-bottom-right-radius: 6px; + border-right-width: 1px; +} + +QTabBar::tab:top:selected, +QTabBar::tab:bottom:selected { + color: black; + background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #3874f2, stop:1 #5e90fa); + border-color: #3874f2; +} + +QTabBar::tab:top:!selected:hover, +QTabBar::tab:bottom:!selected:hover { + color: black; +} + +QTabBar::tab:top:only-one , +QTabBar::tab:bottom:only-one { + border: 1px solid #1b3774; + border-radius: 6px; +} + +QDockWidget { + color: #828282; + border: 1px solid #e6e6e6; +} + +QDockWidget::float-button { + border: 1px transparent #e6e6e6; + border-radius: 2px; + background: transparent; + subcontrol-origin: padding; + subcontrol-position: right center; +} +QDockWidget::float-button { + right: 4px; +} + +QDockWidget::float-button:hover { + background: #f5f5f5; +} + +QDockWidget::float-button:pressed { + /*padding: 1px -1px -1px 1px;*/ + background-color: #e0e0e0; +} + +QToolButton { + color: #f2f2f2; + text-align: center; + background-color: rgba(213, 213, 213, 0); + border: 1px solid #828282; + outline: none; +} + +QToolButton:hover, +QToolButton:focus { + color: black; + background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #3874f2, stop:1 #5e90fa); + border-color: #3874f2; +} + +QToolButton:disabled, +QToolButton:disabled:checked { + color: #b6b6b6; + background-color: #e6e6e6; + border-color: #b6b6b6; +} + +QToolButton:pressed { + border-color: #7cabf9; +} + +QToolButton:checked { + background-color: #5e90fa; + border-color: #3874f2; +} + +sectionLabel{ + border-style: solid; + border-color: grey; + padding-bottom: 3px; + margin-bottom: 3px; + margin-top: 5px; + text-align: left; + border-width: 0px 0px 2px 0px; +} + +customView QPushButton{ + background: rgba(214, 54, 40, 50%); + border: 1px groove white; + border-radius: 2px; + font-size: 18px; + font-weight: Bold; + padding: 1px 2px 3px 3px; + color: rgba(255, 255, 255, 50%); +} +customView QPushButton:Hover{ + background: rgba(214, 54, 40, 90%); + color: rgba(255, 255, 255, 90%); +} + +customTabWidget QPushButton{ + background: rgba(230, 230, 227, 0%); + padding: 1px; + border: 0px solid #E6E6E3; + border-radius: 10px; + top: -5px; +} +customTabWidget QPushButton:hover{ + background: rgba(230, 230, 227, 60%); +} + +customTabWidget::pane { + margin: 0px,1px,1px,1px; + border: 2px solid #E6E6E3; + border-radius: 7px; + padding: 1px; + background-color: #E6E6E3;} diff --git a/src/main/resources/base/ui/close.svg b/src/main/resources/base/ui/close.svg new file mode 100644 index 0000000..cb1c174 --- /dev/null +++ b/src/main/resources/base/ui/close.svg @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + inkscape:version="1.0 (4035a4fb49, 2020-05-01)" + sodipodi:docname="close.svg" + id="svg4" + version="1.1" + viewBox="0 0 10 10"><metadata + id="metadata10"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> +</metadata> +<defs + id="defs8" /> +<sodipodi:namedview + inkscape:current-layer="svg4" + inkscape:window-maximized="1" + inkscape:window-y="-9" + inkscape:window-x="-9" + inkscape:cy="7.585194" + inkscape:cx="2.5623729" + inkscape:zoom="42.1" + showgrid="false" + id="namedview6" + inkscape:window-height="1013" + inkscape:window-width="1920" + inkscape:pageshadow="2" + inkscape:pageopacity="0" + guidetolerance="10" + gridtolerance="10" + objecttolerance="10" + borderopacity="1" + bordercolor="#666666" + pagecolor="#ffffff" /> +<text + id="text2" /> +2 y=8>×<text + id="text837" + y="11.016971" + x="-2.6576188" + style="font-style:normal;font-weight:normal;font-size:18.834px;line-height:1.25;font-family:sans-serif;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.470852" + xml:space="preserve"><tspan + style="stroke-width:0.470852" + y="11.016971" + x="-2.6576188" + id="tspan835" + sodipodi:role="line">×</tspan></text> +</svg> |