From 6b43ebf94ec3c8c6bb4a6cae2c65fc589546ed73 Mon Sep 17 00:00:00 2001 From: Daniel Gretzke Date: Sun, 8 Sep 2019 20:42:40 +0200 Subject: [PATCH] fixed size list items --- plug_py/plug.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plug_py/plug.py b/plug_py/plug.py index 492322c..9da7f2b 100644 --- a/plug_py/plug.py +++ b/plug_py/plug.py @@ -1,6 +1,6 @@ # ui libraries from PyQt5.QtGui import QPalette, QFont -from PyQt5.QtCore import QThread, QObject, pyqtSignal, pyqtSlot, Qt, QEvent +from PyQt5.QtCore import QThread, QObject, pyqtSignal, pyqtSlot, Qt, QEvent, QSize from PyQt5.QtWidgets import QApplication, QMainWindow, QScrollerProperties, QScroller, QListWidgetItem # ethereum library @@ -78,6 +78,7 @@ def __init__(self, parent=None): # setup input list scroller for i in range(2): item = QListWidgetItem("") + item.setSizeHint(QSize(80, 28)) fontOptions = QFont() fontOptions.setPixelSize(22) item.setFont(fontOptions) @@ -86,6 +87,7 @@ def __init__(self, parent=None): for i in range(24): item = QListWidgetItem(str(i+1)) + item.setSizeHint(QSize(80, 28)) fontOptions = QFont() fontOptions.setPixelSize(22) item.setFont(fontOptions) @@ -94,6 +96,7 @@ def __init__(self, parent=None): for i in range(2): item = QListWidgetItem("") + item.setSizeHint(QSize(80, 28)) fontOptions = QFont() fontOptions.setPixelSize(22) item.setFont(fontOptions) @@ -141,8 +144,8 @@ def updateHourList(self, position): numItems = 23 max = 645 position = round(position*numItems/max) - #self.ui.hourList.setCurrentRow(position+2) - #self.ui.hourList.verticalScrollBar().setValue(position*max/numItems) + # self.ui.hourList.setCurrentRow(position+2) + # self.ui.hourList.verticalScrollBar().setValue(position*max/numItems) if position == 0: self.ui.hourLabel.setText("hour") else: