Skip to content

Commit

Permalink
Always refresh preview on showEvent and add tooltip and statustip to …
Browse files Browse the repository at this point in the history
…explain clicking will force a refresh Colorbleed#33
  • Loading branch information
BigRoy committed May 12, 2017
1 parent 7a4f56e commit 0b00f54
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions capture_gui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,16 @@ def __init__(self, options_getter, validator, parent=None):
QtWidgets.QWidget.__init__(self, parent=parent)

# Add attributes
self.initialized = False
self.options_getter = options_getter
self.validator = validator
self.preview = ClickLabel()
self.preview.setFixedWidth(self.preview_width)
self.preview.setFixedHeight(self.preview_height)

tip = "Click to force a refresh"
self.preview.setToolTip(tip)
self.preview.setStatusTip(tip)

# region Build
self.layout = QtWidgets.QVBoxLayout()
self.layout.setAlignment(QtCore.Qt.AlignHCenter)
Expand Down Expand Up @@ -104,10 +107,7 @@ def refresh(self):

def showEvent(self, event):
"""Initialize when shown"""
if not self.initialized:
self.refresh()

self.initialized = True
self.refresh()
event.accept()


Expand Down

0 comments on commit 0b00f54

Please sign in to comment.