VIS-50 #15

Merged
s416067 merged 2 commits from VIS-50 into master 2021-02-01 17:36:40 +01:00
Showing only changes of commit 17194ad19b - Show all commits

View File

@ -182,7 +182,7 @@ class formatHelp(QLabel):
with open(scriptPath + os.path.sep + 'static/help.txt', 'r', encoding='utf-8') as file:
help_text = file.read().replace('\n', '')
self.setText(help_text)
self.setStyleSheet("padding-left: 20px; padding-right: 20px; padding-top: 10px; padding-bottom: 10px; font-size:32px;")
self.setStyleSheet("padding-left: 20px; padding-right: 20px; padding-top: 10px; padding-bottom: 10px; font-size:32px; background-color: white;")
self.adjustSize()
@ -198,6 +198,25 @@ class MainWindow(QMainWindow):
def showHelp(self):
label = formatHelp()
self.setCentralWidget(label)
def showHomepage(self):
# Upload file button + instructions on homepage
label = QLabel('Welcome to VisionScore! Use the button below to upload a file and start analyzing it. If you need further help, please click the "help" item in the menu above.', self)
label.setFont(QFont('Arial', 14))
label.setStyleSheet('color: white;')
label.adjustSize()
label.move(200,200)
shadow = QGraphicsDropShadowEffect()
shadow.setBlurRadius(10)
shadow.setOffset(2)
label.setGraphicsEffect(shadow)
button = QPushButton('Upload file', self)
button.setToolTip('This is an example button')
button.move(850,270)
button.setFixedSize(220, 50)
button.clicked.connect(self.showUploadFile)
# Show raw uploaded files
def showInputLibrary(self):
@ -228,34 +247,7 @@ class MainWindow(QMainWindow):
self.setWindowTitle('VisionScore')
scriptDir = os.path.dirname(os.path.realpath(__file__))
self.setWindowIcon(QIcon(scriptDir + os.path.sep + 'static/v_logo.jpg'))
# Background gradient
p = QPalette()
gradient = QLinearGradient(0, 0, 0, 1000)
gradient.setColorAt(0.0, QColor(105, 126, 255))
gradient.setColorAt(0.4, QColor(215, 137, 255))
gradient.setColorAt(1.0, QColor(255, 204, 120))
p.setBrush(QPalette.Window, QBrush(gradient))
self.setPalette(p)
# Upload file button + instructions on homepage
label = QLabel('Welcome to VisionScore! Use the button below to upload a file and start analyzing it. If you need further help, please click the "help" item in the menu above.', self)
label.setFont(QFont('Arial', 14))
label.setStyleSheet('color: white;')
label.adjustSize()
label.move(200,200)
shadow = QGraphicsDropShadowEffect()
shadow.setBlurRadius(10)
shadow.setOffset(2)
label.setGraphicsEffect(shadow)
button = QPushButton('Upload file', self)
button.setToolTip('This is an example button')
button.move(850,270)
button.setFixedSize(220, 50)
button.clicked.connect(self.showUploadFile)
self.showHomepage()
# File menu
menuBar = self.menuBar()