mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 08:49:30 -05:00
Only do the fake item hack if there are items in the list
This commit is contained in:
parent
d892213db1
commit
e17dbd4fdd
@ -62,7 +62,7 @@ class DropCountLabel(QtWidgets.QLabel):
|
|||||||
self.setStyleSheet('color: #ffffff; background-color: #f44449; font-weight: bold; padding: 5px 10px; border-radius: 10px;')
|
self.setStyleSheet('color: #ffffff; background-color: #f44449; font-weight: bold; padding: 5px 10px; border-radius: 10px;')
|
||||||
self.hide()
|
self.hide()
|
||||||
|
|
||||||
def dragLeaveEvent(self, event):
|
def dragEnterEvent(self, event):
|
||||||
self.hide()
|
self.hide()
|
||||||
event.accept()
|
event.accept()
|
||||||
|
|
||||||
@ -109,12 +109,13 @@ class FileList(QtWidgets.QListWidget):
|
|||||||
self.drop_here_image.setGeometry(0, 0, self.width(), self.height() - offset)
|
self.drop_here_image.setGeometry(0, 0, self.width(), self.height() - offset)
|
||||||
self.drop_here_text.setGeometry(0, offset, self.width(), self.height() - offset)
|
self.drop_here_text.setGeometry(0, offset, self.width(), self.height() - offset)
|
||||||
|
|
||||||
# Add and delete an empty item, to force all items to get redrawn
|
if self.count() > 0:
|
||||||
# This is ugly, but the only way I could figure out how to proceed
|
# Add and delete an empty item, to force all items to get redrawn
|
||||||
item = QtWidgets.QListWidgetItem('fake item')
|
# This is ugly, but the only way I could figure out how to proceed
|
||||||
self.addItem(item)
|
item = QtWidgets.QListWidgetItem('fake item')
|
||||||
self.takeItem(self.row(item))
|
self.addItem(item)
|
||||||
self.update()
|
self.takeItem(self.row(item))
|
||||||
|
self.update()
|
||||||
|
|
||||||
def dragEnterEvent(self, event):
|
def dragEnterEvent(self, event):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user