aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2018-04-13 17:01:06 +0100
committerjwansek <eddie.atten.ea29@gmail.com>2018-04-13 17:01:06 +0100
commitc4092889bcaea1a7783fb70c23d2197de7f93afb (patch)
tree10fc3a082a300e8b4a7cd1517d9892b1b6c20f92
parentcb95e987d26fc2d0b1f741d0be86a5d4a873daeb (diff)
downloadeehph2-c4092889bcaea1a7783fb70c23d2197de7f93afb.tar.gz
eehph2-c4092889bcaea1a7783fb70c23d2197de7f93afb.zip
Made the image refresh on minmize/maximize so it always fits in the window
-rw-r--r--EEHPH2_app.py46
-rw-r--r--LICENSE.txt4
-rw-r--r--inno/EEHPH2_installer.exebin16983940 -> 16743611 bytes
-rw-r--r--setup.py2
4 files changed, 50 insertions, 2 deletions
diff --git a/EEHPH2_app.py b/EEHPH2_app.py
index 0ea8dc9..f41ac2e 100644
--- a/EEHPH2_app.py
+++ b/EEHPH2_app.py
@@ -83,6 +83,8 @@ class App(tk.Tk):
imageMenu.add_command(label='Flip image', accelerator = "F", image = self.__icon_flip, compound = tk.LEFT, command=self.img_viewer.buttons.flip)
menu.add_command(label = "Source", underline = 0, command = lambda: webbrowser.open_new("https://github.com/jwansek/eehph2"))
+ self.new_state = "normal"
+
self.bind('<Left>', self.img_viewer.buttons.backwards)
self.bind('<Right>', self.img_viewer.buttons.forwards)
self.bind('<space>', self.img_viewer.buttons.fullscreen)
@@ -95,6 +97,38 @@ class App(tk.Tk):
self.bind('<R>', self.img_viewer.buttons.anticlockwise)
self.bind('<f>', self.img_viewer.buttons.flip)
self.bind('<Control-e>', self.img_viewer.edit_image)
+ self.bind('<F5>', self.refresh)
+ self.bind('<Configure>', self.__on_config)
+
+ def __on_config(self, event = None):
+ """Event for when the app is resized.
+
+ Keyword Arguments:
+ event {event} -- Done to make the app work with events (default: {None})
+ """
+
+ self.old_state = self.new_state # assign the old state value
+ self.new_state = self.state() # get the new state value
+
+ if self.new_state == 'zoomed':
+ #maximise event
+ self.refresh()
+ elif self.new_state == 'normal' and self.old_state == 'zoomed':
+ #restore event
+ self.refresh()
+
+
+ def refresh(self, event = None):
+ """Reloads the current image.
+ Done so the image is resized when the app is resized.
+
+ Keyword Arguments:
+ event {event} -- Used to make the method work with events. (default: {None})
+ """
+
+ if self.img_viewer.large_img is not None:
+ self.img_viewer.open_image(self.img_viewer.large_img)
+
def __open(self, event=None):
"""Private. Used to open an image asking the user where
@@ -837,4 +871,14 @@ def get_filetypes():
tuple -- avaliable filetypes
"""
- return (('%s images' % type[1:].upper(), type) for type in IMPORT_FILES) \ No newline at end of file
+ return (('%s images' % type[1:].upper(), type) for type in IMPORT_FILES)
+
+#for testing purposes only
+if __name__ == "__main__":
+ try:
+ start = sys.argv[1]
+ except:
+ start = None
+
+ root = App(path = start)
+ root.mainloop() \ No newline at end of file
diff --git a/LICENSE.txt b/LICENSE.txt
index 94a9ed0..a0d8bc2 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,3 +1,7 @@
+Thank you for downloading this application. We hope it will be useful
+to you. This program is open source, with a GNU license. Its source code
+is mainatned at https://github.com/jwansek/eehph2.
+
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
diff --git a/inno/EEHPH2_installer.exe b/inno/EEHPH2_installer.exe
index 9126c08..bda80e4 100644
--- a/inno/EEHPH2_installer.exe
+++ b/inno/EEHPH2_installer.exe
Binary files differ
diff --git a/setup.py b/setup.py
index 0cf7696..3785cf6 100644
--- a/setup.py
+++ b/setup.py
@@ -27,7 +27,7 @@ exec_ = Executable(
setup(
name = "EEHPH Photo Viewer v2",
options = {"build_exe": {"packages": packages, "include_files": include_files}},
- version = "2.1.1",
+ version = "2.2.3",
description = "EEHPH2 by AE computer vision",
author = "Edward Attenborough",
executables = [exec_]