summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouie S <louie@example.com>2023-09-16 09:36:14 -0400
committerLouie S <louie@example.com>2023-09-16 09:36:14 -0400
commit76a1b6384301a9a8e37b1176f83f55b2827b2d16 (patch)
tree332779c6044134273bc08594892f98975f6c32e5
parent87b36b9a8e98b6c63f5ee8f08e58057285dc819a (diff)
Change groups_hbox to a grid layout
-rwxr-xr-xassignment-list.py18
1 files changed, 8 insertions, 10 deletions
diff --git a/assignment-list.py b/assignment-list.py
index 6266d77..daac800 100755
--- a/assignment-list.py
+++ b/assignment-list.py
@@ -1,7 +1,7 @@
#!/usr/bin/python3
import sys
import time
-from PyQt5.QtWidgets import QAction, QApplication, QHBoxLayout, QLabel, QMainWindow, QMenu, QMessageBox, QScrollArea, QToolBar, QVBoxLayout, QWidget
+from PyQt5.QtWidgets import QAction, QApplication, QGridLayout, QHBoxLayout, QLabel, QMainWindow, QMenu, QMessageBox, QScrollArea, QToolBar, QVBoxLayout, QWidget
from PyQt5.QtGui import QCursor, QFont
from PyQt5.QtCore import QDate, Qt
from config import Config
@@ -75,13 +75,13 @@ class AssignmentList(QMainWindow):
title_h_box.addWidget(title)
title_h_box.addStretch()
- self.groups_hbox = QHBoxLayout()
- self.groups_hbox.setContentsMargins(20, 5, 20, 5)
+ self.groups_layout = QGridLayout()
+ self.groups_layout.setContentsMargins(20, 5, 20, 5)
self.drawGroups()
v_box = QVBoxLayout()
v_box.addLayout(title_h_box)
- v_box.addLayout(self.groups_hbox)
+ v_box.addLayout(self.groups_layout)
v_box.addStretch()
main_widget.setLayout(v_box)
@@ -201,7 +201,7 @@ class AssignmentList(QMainWindow):
def drawGroups(self):
"""
- Redraw the groups_hbox
+ Redraw the groups_layout
"""
# Remove all children from layout
def recursiveClear(layout):
@@ -212,7 +212,7 @@ class AssignmentList(QMainWindow):
elif child.layout():
recursiveClear(child)
- recursiveClear(self.groups_hbox)
+ recursiveClear(self.groups_layout)
# Sort the groups
Globals.groups = sorted(Globals.groups, key=lambda g: g.id)
@@ -247,10 +247,8 @@ class AssignmentList(QMainWindow):
column_left.addStretch()
column_right.addStretch()
- self.groups_hbox.addLayout(column_left)
- self.groups_hbox.addStretch()
- self.groups_hbox.addLayout(column_right)
- self.groups_hbox.addStretch()
+ self.groups_layout.addLayout(column_left, 0, 0)
+ self.groups_layout.addLayout(column_right, 0, 1)
def drawEntries(self, group_id):
"""