Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
JP committed Jul 29, 2019
1 parent fc8f3ef commit 3cb0d2e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GraphicsView.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ def __init__(self, parent=None):
self.window_min, self.window_max = 0, 255
self.shift = 0
self.scroll = None
self.make_windowing_optional = False
self.current_language = 'en_GB'
self.context_menu = QMenu()
self.make_windowing_optional = False
if self.make_windowing_optional:
self.use_windowing_action = QAction('Use Windowing')
self.use_windowing_action.setCheckable(True)
self.use_windowing_action.setChecked(True)
self.use_windowing_action.toggled.connect(self.on_use_windowing_action)
self.context_menu.addAction(self.use_windowing_action)
self.reset_window_action = QAction('Reset Window')
self.reset_window_action.setCheckable(False)
self.reset_window_action.triggered.connect(self.on_reset_window_action)
self.context_menu = QMenu()
if self.make_windowing_optional:
self.context_menu.addAction(self.use_windowing_action)
self.context_menu.addAction(self.reset_window_action)

def set_image(self, image, update_values=False):
Expand Down Expand Up @@ -71,10 +71,10 @@ def contextMenuEvent(self, event):

def on_use_windowing_action(self):
if not self.use_windowing_action.isChecked():
self.on_reset_windowing_action()
self.on_reset_window_action()

def on_reset_window_action(self):
self.update_values_from_image(self.image) # TODO: check
self.update_values_from_image(self.image)
self.update()

def change_language(self, lang):
Expand Down

0 comments on commit 3cb0d2e

Please sign in to comment.