Skip to content

Commit

Permalink
Added label to state meaning of radiobutton values.
Browse files Browse the repository at this point in the history
  • Loading branch information
selbs committed Jul 24, 2023
1 parent 2753eb8 commit d731a57
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 32 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,10 @@ Your progress through the folder of images is shown in the progress bar at the b
| <kbd>N</kbd> or <kbd>Space</kbd> | Next image |
| <kbd>+</kbd> / <kbd>=</kbd> | Zoom in |
| <kbd>-</kbd> / <kbd>_</kbd> | Zoom out |
| <kbd>I</kbd> | Invert colours |
| <kbd>R</kbd> | Rotate images right |
| <kbd>L</kbd> | Rotate images left |
| <kbd>S</kbd> | Save |
| <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Q</kbd> | Quit |
| <kbd>Cmd</kbd> + Scroll | Contrast |
| <kbd>Shift</kbd> + Scroll | Brightness |

Note: <kbd>Cmd</kbd> + Scroll and <kbd>Shift</kbd> + Scroll are only currently available on Mac OS X.

Expand Down
58 changes: 29 additions & 29 deletions speedy_iqa/main_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,33 +513,33 @@ def backup_file(self) -> List[str]:

return backup_files

def wheelEvent(self, event: QWheelEvent):
"""
Override the wheelEvent function to allow for scrolling with the mouse wheel to change the windowing parameters.
- Ctrl/Cmd + Scroll: Change window width
- Shift + Scroll: Change window center
:param event: The wheelEvent function to override
:type event: QWheelEvent
"""
if event.modifiers() == Qt.KeyboardModifier.ControlModifier: # check if Ctrl key is pressed
delta = event.angleDelta().y() # get the scroll direction
if delta > 0:
# increase window width
self.window_width_slider.setValue(self.window_width_slider.value() + 10)
elif delta < 0:
# decrease window width
self.window_width_slider.setValue(self.window_width_slider.value() - 10)
elif event.modifiers() == Qt.KeyboardModifier.ShiftModifier: # check if Shft key is pressed
delta = event.angleDelta().y() # get the scroll direction
if delta > 0:
# increase window width
self.window_center_slider.setValue(self.window_center_slider.value() + 5)
elif delta < 0:
# decrease window width
self.window_center_slider.setValue(self.window_center_slider.value() - 5)
else:
super().wheelEvent(event)
# def wheelEvent(self, event: QWheelEvent):
# """
# Override the wheelEvent function to allow for scrolling with the mouse wheel to change the windowing parameters.
# - Ctrl/Cmd + Scroll: Change window width
# - Shift + Scroll: Change window center
#
# :param event: The wheelEvent function to override
# :type event: QWheelEvent
# """
# if event.modifiers() == Qt.KeyboardModifier.ControlModifier: # check if Ctrl key is pressed
# delta = event.angleDelta().y() # get the scroll direction
# if delta > 0:
# # increase window width
# self.window_width_slider.setValue(self.window_width_slider.value() + 10)
# elif delta < 0:
# # decrease window width
# self.window_width_slider.setValue(self.window_width_slider.value() - 10)
# elif event.modifiers() == Qt.KeyboardModifier.ShiftModifier: # check if Shft key is pressed
# delta = event.angleDelta().y() # get the scroll direction
# if delta > 0:
# # increase window width
# self.window_center_slider.setValue(self.window_center_slider.value() + 5)
# elif delta < 0:
# # decrease window width
# self.window_center_slider.setValue(self.window_center_slider.value() - 5)
# else:
# super().wheelEvent(event)

def open_config_yml(self) -> Dict:
"""
Expand Down Expand Up @@ -1209,8 +1209,8 @@ def keyPressEvent(self, event: QKeyEvent):
self.zoom_out()
elif event.key() == Qt.Key.Key_Plus or event.key() == Qt.Key.Key_Equal:
self.zoom_in()
elif event.key() == Qt.Key.Key_I:
self.invert_colours()
# elif event.key() == Qt.Key.Key_I:
# self.invert_colours()
elif event.key() == Qt.Key.Key_R:
self.rotate_image_right()
elif event.key() == Qt.Key.Key_L:
Expand Down

0 comments on commit d731a57

Please sign in to comment.