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