Skip to content

Commit

Permalink
fixed size list items
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Gretzke committed Sep 8, 2019
1 parent b169668 commit 6b43ebf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions plug_py/plug.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 6b43ebf

Please sign in to comment.