From 8d59c9d20bcb319927bbb4f8adfbf3a0d83115a4 Mon Sep 17 00:00:00 2001 From: afnanramadhan <13521011@std.stei.itb.ac.id> Date: Thu, 13 Apr 2023 02:15:07 +0700 Subject: [PATCH] refactor: rapihin navbar --- src/listlatihan2.py | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/listlatihan2.py b/src/listlatihan2.py index fc746e6..5a69e78 100644 --- a/src/listlatihan2.py +++ b/src/listlatihan2.py @@ -14,10 +14,6 @@ button_color = '#174728' text_color = '#EEEEE2' card_color = '#D2DCC4' -imgPath = None -descLat = None -titleLat = None - class listLatihan2(QWidget): @@ -75,29 +71,32 @@ class listLatihan2(QWidget): background-color: {background}; border: none; border-radius: 20px; + font-weight: bold; }} ''') homeButton.setFont(buttonFont) - homeButton.setFixedSize(96, 42) #pake ini buat kalau dia buletan - homeButton.move(507, 58) + homeButton.move(507, 53) + homeButton.setFixedSize(96, 42) homeButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) # tombol customize customizeButton = QPushButton(self) - customizeButton.setText('Customize') + customizeButton.setText('Customize') customizeButton.setStyleSheet(f''' QPushButton {{ color: {text_color}; background-color: {background}; border: none; border-radius: 20px; + font-weight: bold; }} ''') customizeButton.setFont(buttonFont) customizeButton.move(649, 58) customizeButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) + customizeButton.clicked.connect(self.customWindow) # tombol plan planButton = QPushButton(self) @@ -108,29 +107,34 @@ class listLatihan2(QWidget): background-color: {background}; border: none; border-radius: 20px; + font-weight: bold; }} ''') planButton.setFont(buttonFont) planButton.move(807, 58) planButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) + planButton.clicked.connect(self.planWindow) # tombol list listButton = QPushButton(self) listButton.setText('List') - listButton.setFixedSize(96, 42) listButton.setStyleSheet(f''' QPushButton {{ color: {text_color}; background-color: {button_color}; border: none; border-radius: 20px; + font-weight: bold; }} ''') listButton.setFont(buttonFont) - listButton.move(870, 53) + listButton.setFixedSize(96, 42) + listButton.move(875, 53) listButton.setCursor( QCursor(Qt.CursorShape.PointingHandCursor)) + listButton.clicked.connect(self.listWindow) + # tombol history historyButton = QPushButton(self) @@ -141,6 +145,7 @@ class listLatihan2(QWidget): background-color: {background}; border: none; border-radius: 20px; + font-weight: bold; }} ''') historyButton.setFont(buttonFont) @@ -152,6 +157,7 @@ class listLatihan2(QWidget): profilePhoto = QLabel(self) profilePhoto.setPixmap(QPixmap('img/profile-dashboard.png')) profilePhoto.move(1133, 45) + #Membuat scroll area @@ -224,7 +230,7 @@ class listLatihan2(QWidget): desc = QLabel(card) t = f'<font style="font-size:12px;font-family="Sogoe UI;">{self.listLat[count][2]}' if(len(t)> 200): - t = t[0:200]+f" <font color='blue';>See More..." + t = t[0:200]+f" <font color='#174728';;><b>See More...<b>" desc.setText(t) desc.move(10, 170) @@ -248,6 +254,14 @@ class listLatihan2(QWidget): scroll.setWidget(scrollWidget) + def customWindow(self): + self.switch.emit("customize", {}) + + def planWindow(self): + self.switch.emit("plan", {}) + + def listWindow(self): + self.switch.emit("listLatihan", {}) class MyPopup(QDialog): def __init__(self, count, listLat): @@ -327,6 +341,8 @@ class MyPopup(QDialog): desc.move(420, 180) desc.setWordWrap(True) desc.setFixedWidth(410) + + -- GitLab