Commit ddbcecc8 authored by Benjamin Mummery's avatar Benjamin Mummery 💻

Unified text size

parent d9476537
Pipeline #1063 failed
...@@ -64,6 +64,7 @@ class NativeUI(HEVClient, QMainWindow): ...@@ -64,6 +64,7 @@ class NativeUI(HEVClient, QMainWindow):
"background-disabled": QColor.fromRgb(15, 15, 15), "background-disabled": QColor.fromRgb(15, 15, 15),
"foreground-disabled": QColor.fromRgb(100, 100, 100), "foreground-disabled": QColor.fromRgb(100, 100, 100),
} }
self.text_size = "20pt"
self.iconpath = self.__find_icons() self.iconpath = self.__find_icons()
# database # database
...@@ -413,7 +414,7 @@ if __name__ == "__main__": ...@@ -413,7 +414,7 @@ if __name__ == "__main__":
dep.setGeometry(0, 0, 1920, 1080) dep.setGeometry(0, 0, 1920, 1080)
dep.setWindowFlags(QtCore.Qt.FramelessWindowHint) dep.setWindowFlags(QtCore.Qt.FramelessWindowHint)
elif args.debug > 0: elif args.debug > 0:
rescale = 0.7 rescale = 1
dep.setGeometry(0, 0, rescale * 1920, rescale * 1080) dep.setGeometry(0, 0, rescale * 1920, rescale * 1080)
dep.battery_signal.connect(dep.topBar.tab_battery.update_value) dep.battery_signal.connect(dep.topBar.tab_battery.update_value)
......
...@@ -27,7 +27,9 @@ class alarmList(QtWidgets.QWidget): ...@@ -27,7 +27,9 @@ class alarmList(QtWidgets.QWidget):
self.setSizePolicy( self.setSizePolicy(
QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
) )
self.setStyleSheet("background-color:white; font:15pt white;") self.setStyleSheet(
"background-color:white;" "font-size: " + NativeUI.text_size + ";"
)
iconpath_bell = os.path.join(NativeUI.iconpath, "bell-solid.png") iconpath_bell = os.path.join(NativeUI.iconpath, "bell-solid.png")
iconpath_bellReg = os.path.join(NativeUI.iconpath, "bell-regular.png") iconpath_bellReg = os.path.join(NativeUI.iconpath, "bell-regular.png")
......
...@@ -40,6 +40,7 @@ class alarmWidget(QtWidgets.QWidget): ...@@ -40,6 +40,7 @@ class alarmWidget(QtWidgets.QWidget):
textLabel.setText(self.alarmPayload["alarm_code"]) textLabel.setText(self.alarmPayload["alarm_code"])
textLabel.setFixedWidth(150) textLabel.setFixedWidth(150)
textLabel.setAlignment(QtCore.Qt.AlignCenter) textLabel.setAlignment(QtCore.Qt.AlignCenter)
textLabel.setStyleSheet("font-size: " + NativeUI.text_size + ";")
self.layout.addWidget(textLabel) self.layout.addWidget(textLabel)
self.setFixedHeight(40) self.setFixedHeight(40)
......
...@@ -34,6 +34,7 @@ class okButton( ...@@ -34,6 +34,7 @@ class okButton(
"background-color: " + NativeUI.colors["foreground"].name() + ";" "background-color: " + NativeUI.colors["foreground"].name() + ";"
"color: " + NativeUI.colors["background"].name() + ";" "color: " + NativeUI.colors["background"].name() + ";"
"border-color: " + NativeUI.colors["foreground"].name() + ";" "border-color: " + NativeUI.colors["foreground"].name() + ";"
"font-size: " + NativeUI.text_size + ";"
"border-radius: 8px;" "border-radius: 8px;"
"border:none" "border:none"
) )
...@@ -60,6 +61,7 @@ class cancelButton( ...@@ -60,6 +61,7 @@ class cancelButton(
"background-color: " + NativeUI.colors["foreground"].name() + ";" "background-color: " + NativeUI.colors["foreground"].name() + ";"
"color: " + NativeUI.colors["background"].name() + ";" "color: " + NativeUI.colors["background"].name() + ";"
"border-color: " + NativeUI.colors["foreground"].name() + ";" "border-color: " + NativeUI.colors["foreground"].name() + ";"
"font-size: " + NativeUI.text_size + ";"
"border-radius: 8px;" "border-radius: 8px;"
"border:none" "border:none"
) )
......
...@@ -18,23 +18,24 @@ from PySide2 import QtWidgets, QtGui, QtCore ...@@ -18,23 +18,24 @@ from PySide2 import QtWidgets, QtGui, QtCore
class selectorButton(QtWidgets.QPushButton): class selectorButton(QtWidgets.QPushButton):
def __init__(self, NativeUI, *args, **kwargs): def __init__(self, NativeUI, *args, **kwargs):
super(selectorButton, self).__init__(*args, **kwargs) super(selectorButton, self).__init__(*args, **kwargs)
fontsize = 20
style = ( style = (
"QPushButton{" "QPushButton{"
"font: " + str(fontsize) + "pt;" " font-size: " + NativeUI.text_size + ";"
"}" "}"
"QPushButton[selected='0']{" "QPushButton[selected='0']{"
"font: " + str(fontsize) + "pt;" " font-size: " + NativeUI.text_size + ";"
"color: " + NativeUI.colors["foreground"].name() + ";" " color: " + NativeUI.colors["foreground"].name() + ";"
"background-color: " + NativeUI.colors["background-enabled"].name() + ";" " background-color: " + NativeUI.colors["background-enabled"].name() + ";"
"border:none" " border:none"
"}" "}"
"QPushButton[selected='1']{" "QPushButton[selected='1']{"
"font: " + str(fontsize) + "pt;" " font-size: " + NativeUI.text_size + ";"
"color: " + NativeUI.colors["background"].name() + ";" " color: " + NativeUI.colors["background"].name() + ";"
"background-color: " + NativeUI.colors["foreground-disabled"].name() + ";" " background-color: "
"border:none" + NativeUI.colors["foreground-disabled"].name()
+ ";"
" border:none"
"}" "}"
) )
......
...@@ -75,7 +75,7 @@ class labelledSpin(QtWidgets.QWidget): ...@@ -75,7 +75,7 @@ class labelledSpin(QtWidgets.QWidget):
self.manuallyUpdated = False self.manuallyUpdated = False
layout = QtWidgets.QHBoxLayout() layout = QtWidgets.QHBoxLayout()
widgetList = [] widgetList = []
textStyle = "color:white; font: 16pt" textStyle = "color:white;" "font-size: " + NativeUI.text_size + ";"
if self.label != "": if self.label != "":
self.nameLabel = QtWidgets.QLabel(self.label) self.nameLabel = QtWidgets.QLabel(self.label)
...@@ -88,14 +88,30 @@ class labelledSpin(QtWidgets.QWidget): ...@@ -88,14 +88,30 @@ class labelledSpin(QtWidgets.QWidget):
self.simpleSpin.setSingleStep(self.step) self.simpleSpin.setSingleStep(self.step)
self.simpleSpin.setDecimals(self.decPlaces) self.simpleSpin.setDecimals(self.decPlaces)
self.simpleSpin.setStyleSheet( self.simpleSpin.setStyleSheet(
"""QDoubleSpinBox{ width:100px; font:16pt} "QDoubleSpinBox{"
QDoubleSpinBox[bgColour="0"]{background-color:white; } " width: 100px"
QDoubleSpinBox[bgColour="1"]{background-color:grey; } " font-size: " + NativeUI.text_size + ";"
QDoubleSpinBox[textColour="0"]{color:black} "}"
QDoubleSpinBox[textColour="1"]{color:red} "QDoubleSpinBox[bgColour='0']{"
QDoubleSpinBox::up-button{width:20; border:solid white; color:black } " background-color:white;"
QDoubleSpinBox::down-button{width:20; } "}"
""" "QDoubleSpinBox[bgColour='1']{"
" background-color:grey;"
"}"
"QDoubleSpinBox[textColour='0']{"
" color:black"
"}"
"QDoubleSpinBox[textColour='1']{"
" color:red"
"}"
"QDoubleSpinBox::up-button{"
" width:20;"
" border:solid white;"
" color:black"
"}"
"QDoubleSpinBox::down-button{"
" width:20;"
"}"
) )
self.simpleSpin.setProperty("textColour", "0") self.simpleSpin.setProperty("textColour", "0")
self.simpleSpin.setProperty("bgColour", "0") self.simpleSpin.setProperty("bgColour", "0")
......
...@@ -33,18 +33,18 @@ class TypeValuePopup(QtWidgets.QDialog): ...@@ -33,18 +33,18 @@ class TypeValuePopup(QtWidgets.QDialog):
self.lineEdit.setText("4") self.lineEdit.setText("4")
self.lineEdit.setStyleSheet( self.lineEdit.setStyleSheet(
"QLineEdit{" "QLineEdit{"
"font: 16pt;" " font-size: " + NativeUI.text_size + ";"
"background-color: white;" " background-color: white;"
"border-radius: 4px;" " border-radius: 4px;"
"}" "}"
"QLineEdit[colour = '0']{" "QLineEdit[colour = '0']{"
"color: green;" " color: green;"
"}" "}"
"QLineEdit[colour = '1']{" "QLineEdit[colour = '1']{"
"color: rgb(144, 231, 211);" " color: rgb(144, 231, 211);"
"}" "}"
"QLineEdit[colour = '2']{" "QLineEdit[colour = '2']{"
"color: red;" " color: red;"
"}" "}"
) )
self.lineEdit.setProperty("colour", "1") self.lineEdit.setProperty("colour", "1")
......
...@@ -52,8 +52,9 @@ class TabStartStopStandbyButtons(QtWidgets.QWidget): ...@@ -52,8 +52,9 @@ class TabStartStopStandbyButtons(QtWidgets.QWidget):
+ NativeUI.colors["background-enabled"].name() + NativeUI.colors["background-enabled"].name()
+ ";" + ";"
"border-color: " + NativeUI.colors["foreground"].name() + ";" "border-color: " + NativeUI.colors["foreground"].name() + ";"
"font-size: 20pt;" "font-size: " + NativeUI.text_size + ";"
"color: " + NativeUI.colors["foreground"].name() + ";" + "border:none" "color: " + NativeUI.colors["foreground"].name() + ";"
"border:none"
) )
button.setFixedSize(self.__button_size) button.setFixedSize(self.__button_size)
......
...@@ -98,7 +98,7 @@ class TemplateSetValues(QtWidgets.QWidget): ...@@ -98,7 +98,7 @@ class TemplateSetValues(QtWidgets.QWidget):
self.titleLabel.setStyleSheet( self.titleLabel.setStyleSheet(
"background-color:" + self.NativeUI.colors["background"].name() + ";" "background-color:" + self.NativeUI.colors["background"].name() + ";"
"color:" + self.NativeUI.colors["foreground"].name() + ";" "color:" + self.NativeUI.colors["foreground"].name() + ";"
"font: 20pt;" "font-size: " + self.NativeUI.text_size + ";"
) )
self.titleLabel.setAlignment(QtCore.Qt.AlignCenter) self.titleLabel.setAlignment(QtCore.Qt.AlignCenter)
grid.addWidget(self.titleLabel, i, 0, 1, 6) grid.addWidget(self.titleLabel, i, 0, 1, 6)
......
...@@ -107,7 +107,6 @@ class MainView(QWidget): ...@@ -107,7 +107,6 @@ class MainView(QWidget):
class TabNormalExpertButtons(QWidget): class TabNormalExpertButtons(QWidget):
def __init__(self, NativeUI, *args, **kwargs): def __init__(self, NativeUI, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
font_size = 20
button_size = QSize(150, 50) button_size = QSize(150, 50)
self.NativeUI = NativeUI self.NativeUI = NativeUI
layout = QHBoxLayout() layout = QHBoxLayout()
...@@ -123,19 +122,19 @@ class TabNormalExpertButtons(QWidget): ...@@ -123,19 +122,19 @@ class TabNormalExpertButtons(QWidget):
for button in self.buttons: for button in self.buttons:
button.setStyleSheet( button.setStyleSheet(
"QPushButton{" "QPushButton{"
"color: " + NativeUI.colors["foreground"].name() + ";" " color: " + NativeUI.colors["foreground"].name() + ";"
"font-size: " + str(font_size) + "pt;" " font-size: " + NativeUI.text_size + ";"
"background-color: " " background-color: "
+ NativeUI.colors["background-enabled"].name() + NativeUI.colors["background-enabled"].name()
+ ";" + ";"
"border-color: " + NativeUI.colors["background"].name() + ";" " border-color: " + NativeUI.colors["background"].name() + ";"
"border:none" " border:none"
"}" "}"
"QPushButton:disabled{" "QPushButton:disabled{"
"background-color: " " background-color: "
+ NativeUI.colors["background-disabled"].name() + NativeUI.colors["background-disabled"].name()
+ ";" + ";"
"border:none" " border:none"
"}" "}"
) )
button.setFixedSize(button_size) button.setFixedSize(button_size)
......
...@@ -31,9 +31,11 @@ class customButton(QtWidgets.QPushButton): ...@@ -31,9 +31,11 @@ class customButton(QtWidgets.QPushButton):
super().__init__() super().__init__()
# self.setIcon(icon) # self.setIcon(icon)
self.setStyleSheet( self.setStyleSheet(
"border:none; background-image:url('" "border:none;"
+ iconPath "background-image:url('" + iconPath + "');"
+ "');height:100px;width:100px" "font-size: " + self.NativeUI.text_size + ";"
"height:100px;"
"width:100px;"
) )
......
...@@ -31,8 +31,8 @@ class TabHistoryButtons(QtWidgets.QWidget): ...@@ -31,8 +31,8 @@ class TabHistoryButtons(QtWidgets.QWidget):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.NativeUI = NativeUI self.NativeUI = NativeUI
self.__button_size = QSize(50, 50) button_size = 60
self.__button_font_size = 20 self.__button_size = QSize(button_size, button_size)
self.button_sixty = HistoryButton("60s", signal_value=60) self.button_sixty = HistoryButton("60s", signal_value=60)
self.button_thirty = HistoryButton("30s", signal_value=30) self.button_thirty = HistoryButton("30s", signal_value=30)
...@@ -49,13 +49,13 @@ class TabHistoryButtons(QtWidgets.QWidget): ...@@ -49,13 +49,13 @@ class TabHistoryButtons(QtWidgets.QWidget):
for button in self.buttons: for button in self.buttons:
button.setStyleSheet( button.setStyleSheet(
"QPushButton{" "QPushButton{"
"background-color: " + NativeUI.colors["background"].name() + ";" " background-color: " + NativeUI.colors["background"].name() + ";"
"border-color: " + NativeUI.colors["background"].name() + ";" " border-color: " + NativeUI.colors["background"].name() + ";"
"color: " + NativeUI.colors["foreground"].name() + ";" " color: " + NativeUI.colors["foreground"].name() + ";"
"font-size: " + str(self.__button_font_size) + "px;" " font-size: " + NativeUI.text_size + ";"
"}" "}"
"QPushButton:disabled{" "QPushButton:disabled{"
"background-color: " " background-color: "
+ NativeUI.colors["background-disabled"].name() + NativeUI.colors["background-disabled"].name()
+ ";" + ";"
"}" "}"
......
...@@ -53,10 +53,13 @@ class Measurements_Block(QtWidgets.QWidget): ...@@ -53,10 +53,13 @@ class Measurements_Block(QtWidgets.QWidget):
"measurement type %s is not a recognised parameter" % measurement[2] "measurement type %s is not a recognised parameter" % measurement[2]
) )
label = QtWidgets.QLabel("Measurements") # label = QtWidgets.QLabel("Measurements")
label.setAlignment(QtCore.Qt.AlignCenter) # label.setAlignment(QtCore.Qt.AlignCenter)
label.setStyleSheet("color: grey; font-size: 15px") # label.setStyleSheet(
layout.addWidget(label) # "color: grey;"
# "font-size: " + NativeUI.text_size + ";"
# )
# layout.addWidget(label)
# Compute max number of items per column # Compute max number of items per column
max_col_length = int(len(widget_list) / (columns)) max_col_length = int(len(widget_list) / (columns))
...@@ -112,10 +115,9 @@ class MeasurementWidget(QtWidgets.QWidget): ...@@ -112,10 +115,9 @@ class MeasurementWidget(QtWidgets.QWidget):
**kwargs **kwargs
): ):
super(MeasurementWidget, self).__init__(*args, **kwargs) super(MeasurementWidget, self).__init__(*args, **kwargs)
width = 150 width = 250
height = 100 height = 120
labelheight = 25 labelheight = 35
border_radius = 5
self.NativeUI = NativeUI self.NativeUI = NativeUI
self.key = key self.key = key
...@@ -133,13 +135,11 @@ class MeasurementWidget(QtWidgets.QWidget): ...@@ -133,13 +135,11 @@ class MeasurementWidget(QtWidgets.QWidget):
self.name_display.setAlignment(QtCore.Qt.AlignCenter) self.name_display.setAlignment(QtCore.Qt.AlignCenter)
self.name_display.setStyleSheet( self.name_display.setStyleSheet(
"color: " + self.NativeUI.colors["foreground"].name() + ";" "color: " + self.NativeUI.colors["foreground"].name() + ";"
"background-color: " "background-color:"
+ self.NativeUI.colors["background-disabled"].name() + self.NativeUI.colors["background-enabled"].name()
+ ";" + ";"
"border-style: outset;" "border: none;"
"border-width: 1px;" "font-size: " + NativeUI.text_size + ";"
"border-color:" + self.NativeUI.colors["foreground"].name() + ";"
"border-radius: " + str(border_radius) + "px;"
) )
self.name_display.setFixedSize(width, labelheight) self.name_display.setFixedSize(width, labelheight)
self.name_display.setFont(QtGui.QFont("SansSerif", 10)) self.name_display.setFont(QtGui.QFont("SansSerif", 10))
...@@ -147,15 +147,10 @@ class MeasurementWidget(QtWidgets.QWidget): ...@@ -147,15 +147,10 @@ class MeasurementWidget(QtWidgets.QWidget):
self.value_display.setAlignment(QtCore.Qt.AlignCenter) self.value_display.setAlignment(QtCore.Qt.AlignCenter)
self.value_display.setStyleSheet( self.value_display.setStyleSheet(
"color: black;" "color: black;"
"background-color: lightblue;" "background-color: " + self.NativeUI.colors["foreground"].name() + ";"
"border-style: outset;" "border: none;"
"border-width: 1px;"
"border-color: black;"
"border-radius: " + str(border_radius) + "px;"
)
self.value_display.setFixedSize(
width + border_radius, height - labelheight + border_radius
) )
self.value_display.setFixedSize(width, height - labelheight)
self.value_display.setFont(QtGui.QFont("SansSerif", 20)) self.value_display.setFont(QtGui.QFont("SansSerif", 20))
# Layout # Layout
...@@ -225,12 +220,12 @@ class TabMeasurements(Measurements_Block): ...@@ -225,12 +220,12 @@ class TabMeasurements(Measurements_Block):
def __init__(self, NativeUI, *args, **kwargs): def __init__(self, NativeUI, *args, **kwargs):
measurements = [ measurements = [
("P_plateau [cmH2O]", "plateau_pressure", "cycle"), ("P<sub>Plateau</sub> [cmH<sub>2</sub>O]", "plateau_pressure", "cycle"),
("RR", "respiratory_rate", "cycle"), ("RR", "respiratory_rate", "cycle"),
("FIO2 [%]", "fiO2_percent", "cycle"), ("FIO<sub>2</sub> [%]", "fiO2_percent", "cycle"),
("VTE [mL]", "exhaled_tidal_volume", "cycle"), ("VTE [mL]", "exhaled_tidal_volume", "cycle"),
("MVE [L/min]", "exhaled_minute_volume", "cycle"), ("MVE [<sup>L</sup>/<sub>min</sub>]", "exhaled_minute_volume", "cycle"),
("PEEP [cmH2O]", "peep", "readback"), ("PEEP [cmH<sub>2</sub>O]", "peep", "readback"),
] ]
super().__init__( super().__init__(
......
...@@ -39,9 +39,11 @@ class SpinButton(QtWidgets.QFrame): ...@@ -39,9 +39,11 @@ class SpinButton(QtWidgets.QFrame):
labelBgColour = "rgb(60,58,60)" labelBgColour = "rgb(60,58,60)"
self.label.setStyleSheet( self.label.setStyleSheet(
"font: 16pt; color:white; background-color:" "font-size: " + NativeUI.text_size + ";"
+ labelBgColour "color:white;"
+ "; border-radius:4px; border: 2px solid white " "background-color:" + labelBgColour + ";"
"border-radius:4px;"
"border: 2px solid white"
) )
self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setAlignment(QtCore.Qt.AlignCenter)
self.layout.addWidget(self.label) self.layout.addWidget(self.label)
...@@ -53,27 +55,25 @@ class SpinButton(QtWidgets.QFrame): ...@@ -53,27 +55,25 @@ class SpinButton(QtWidgets.QFrame):
# ) # override is defined in 'eventFilter'. ensures lineEdit responds to double mouse click # ) # override is defined in 'eventFilter'. ensures lineEdit responds to double mouse click
self.doubleSpin.lineEdit().setStyleSheet("border:blue;") self.doubleSpin.lineEdit().setStyleSheet("border:blue;")
boxStyleString = """QDoubleSpinBox{ boxStyleString = (
border:none; "QDoubleSpinBox{"
background-color: black; " border:none;"
font: 16pt large 'Times New Roman'; " background-color: black;"
height:60px; " font: " + NativeUI.text_size + " large 'Times New Roman';"
} " height: 60px;"
QDoubleSpinBox[colour="0"] { "}"
color:green; "QDoubleSpinBox[colour='0'] {"
} " color:green;"
QDoubleSpinBox[colour="1"] { "}"
color:rgb(144,231,211); "QDoubleSpinBox[colour='1'] {"
} " color:rgb(144,231,211);"
QDoubleSpinBox[colour="2"] { "}"
color:red; "QDoubleSpinBox[colour='2'] {"
} " color:red;"
""" "}"
)
upButtonStyleString = """QDoubleSpinBox::up-button{
height:30; upButtonStyleString = "QDoubleSpinBox::up-button{" "height:30;" "width:40;" "}"
width:40;
} """
# upButtonPressedStyleString = ( # upButtonPressedStyleString = (
# "QDoubleSpinBox::up-button:pressed{ border:orange;}" # "QDoubleSpinBox::up-button:pressed{ border:orange;}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment