Skip to content

Commit

Permalink
💄 Update tabwidget size
Browse files Browse the repository at this point in the history
  • Loading branch information
NoaSecond committed May 29, 2024
1 parent ecf17e6 commit a31f836
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def bind_settings(MainWindow):
pushButton_LogOnOff.clicked.connect(
lambda: log_action("Logging is turned on" if pushButton_LogOnOff.isChecked() else "Logging is turned off"))


def refresh_ports():
"""
Refreshes the list of available ports in the GUI.
Expand All @@ -129,7 +130,7 @@ def refresh_ports():
listWidget_PortList.clear()
item = QtWidgets.QListWidgetItem("Refreshing...")
listWidget_PortList.addItem(item)
ports = list_available_ports()
ports = list_available_ports()
if not ports:
listWidget_PortList.clear()
item = QtWidgets.QListWidgetItem("No device detected")
Expand All @@ -140,12 +141,18 @@ def refresh_ports():
item = QtWidgets.QListWidgetItem(port)
listWidget_PortList.addItem(item)


if __name__ == "__main__":
app = QtWidgets.QApplication([])
MainWindow = loadUiWidget("GUI.ui")
MainWindow.showFullScreen()
MainWindow.showMaximized()

# Resize tabWidget to screen size in width and 95% of screen size in height
tabWidget = MainWindow.findChild(QtWidgets.QTabWidget, "tabWidget")
tabWidget.resize(QtWidgets.QApplication.primaryScreen().availableSize())
tabWidget.resize(MainWindow.width(), int(QtWidgets.QApplication.primaryScreen().availableSize().height() * 0.95))

# Settings
settings = Settings()
load_settings(MainWindow)
Expand All @@ -169,5 +176,5 @@ def refresh_ports():
pushButton_Refresh = MainWindow.findChild(
QtWidgets.QPushButton, "pushButton_Refresh")
pushButton_Refresh.clicked.connect(refresh_ports)

sys.exit(app.exec())

0 comments on commit a31f836

Please sign in to comment.