diff --git a/assets/icons/black-and-white.png b/assets/icons/black-and-white.png new file mode 100644 index 0000000..1ddaf49 Binary files /dev/null and b/assets/icons/black-and-white.png differ diff --git a/assets/icons/copy.png b/assets/icons/copy.png new file mode 100644 index 0000000..61b0fe0 Binary files /dev/null and b/assets/icons/copy.png differ diff --git a/assets/icons/flip.png b/assets/icons/flip.png new file mode 100644 index 0000000..0a36860 Binary files /dev/null and b/assets/icons/flip.png differ diff --git a/assets/icons/folder.png b/assets/icons/folder.png new file mode 100644 index 0000000..e4c57f1 Binary files /dev/null and b/assets/icons/folder.png differ diff --git a/assets/icons/maximize.png b/assets/icons/maximize.png new file mode 100644 index 0000000..dac8d24 Binary files /dev/null and b/assets/icons/maximize.png differ diff --git a/assets/icons/next.png b/assets/icons/next.png new file mode 100644 index 0000000..da3dd90 Binary files /dev/null and b/assets/icons/next.png differ diff --git a/assets/icons/timer.png b/assets/icons/timer.png new file mode 100644 index 0000000..2a52359 Binary files /dev/null and b/assets/icons/timer.png differ diff --git a/requirements.txt b/requirements.txt index b5caefd..d22b91a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,6 @@ pillow~=9.5.0 -pyinstaller +pyinstaller==5.12.0 pygame~=2.4.0 -customtkinter~=5.1.3 \ No newline at end of file +customtkinter~=5.1.3 +configparser~=5.3.0 +CTkToolTip~=0.4 \ No newline at end of file diff --git a/src/element/toolbar.py b/src/element/toolbar.py index 379434e..33be9f8 100644 --- a/src/element/toolbar.py +++ b/src/element/toolbar.py @@ -3,6 +3,9 @@ import os import subprocess import sys from tkinter import * + +from CTkToolTip import * +from PIL import ImageTk, Image, ImageOps import customtkinter from src.util import Util @@ -20,34 +23,46 @@ class Toolbar: toolbar = Frame(self.image_window.window, bd=1, relief=RAISED) toolbar.pack(side=BOTTOM, fill=X) - next_button = customtkinter.CTkButton(toolbar, compound=LEFT, text="next ➡️", - command=self.image_window.next_image) + next_button = customtkinter.CTkButton(toolbar, image=ImageTk.PhotoImage(Image.open("assets/icons/next.png")), + text="", command=self.image_window.next_image) next_button.pack(side=LEFT, padx=0, pady=0) + CTkToolTip(next_button, delay=0.1, message="Next", y_offset=-40, x_offset=-40) - self.bw_button = customtkinter.CTkButton(toolbar, compound=LEFT, text="black&white", - command=self.toggle_black_white) + self.bw_button = customtkinter.CTkButton(toolbar, image=ImageTk.PhotoImage(Image.open("assets/icons/black-and" + "-white.png")), + text="", command=self.toggle_black_white) self.bw_button.pack(side=LEFT, padx=0, pady=0) + CTkToolTip(self.bw_button, delay=0.1, message="Black and white image", y_offset=-40, x_offset=-40) - self.mirror_button = customtkinter.CTkButton(toolbar, compound=LEFT, command=self.toggle_mirror, - text="mirror") + self.mirror_button = customtkinter.CTkButton(toolbar, command=self.toggle_mirror, text="", + image=ImageTk.PhotoImage(Image.open("assets/icons/flip.png"))) self.mirror_button.pack(side=LEFT, padx=0, pady=0) + CTkToolTip(self.mirror_button, delay=0.1, message="Mirrored image", y_offset=-40, x_offset=-40) - open_folder_button = customtkinter.CTkButton(toolbar, compound=LEFT, command=self.open_folder, - text="open folder") + open_folder_button = customtkinter.CTkButton(toolbar, command=self.open_folder, text="", + image=ImageTk.PhotoImage(Image.open("assets/icons/folder.png"))) open_folder_button.pack(side=LEFT, padx=0, pady=0) + CTkToolTip(open_folder_button, delay=0.1, message="Open folder", y_offset=-40, x_offset=-40) - self.always_on_top_button = customtkinter.CTkButton(toolbar, compound=LEFT, command=self.toggle_always_on_top, - text="always on top") + self.always_on_top_button = customtkinter.CTkButton(toolbar, command=self.toggle_always_on_top, text="", + image=ImageTk.PhotoImage( + Image.open("assets/icons/copy.png"))) self.always_on_top_button.pack(side=LEFT, padx=0, pady=0) + CTkToolTip(self.always_on_top_button, delay=0.1, message="Always on top", y_offset=-40, x_offset=-40) - self.fullscreen_button = customtkinter.CTkButton(toolbar, compound=LEFT, command=self.toggle_fullscreen, - text="fullscreen") + self.fullscreen_button = customtkinter.CTkButton(toolbar, command=self.toggle_fullscreen, text="", + image=ImageTk.PhotoImage( + Image.open("assets/icons/maximize.png"))) self.fullscreen_button.pack(side=LEFT, padx=0, pady=0) + CTkToolTip(self.fullscreen_button, delay=0.1, message="Fullscreen", y_offset=-40, x_offset=-40) - timer_button = customtkinter.CTkButton(toolbar, compound=LEFT, command=self.toggle_timer, text="timer") + timer_button = customtkinter.CTkButton(toolbar, command=self.toggle_timer, text="", + image=ImageTk.PhotoImage(Image.open("assets/icons/timer.png"))) timer_button.pack(side=LEFT, padx=0, pady=0) + CTkToolTip(timer_button, delay=0.1, message="Toggle timer", y_offset=-40, x_offset=-40) - self.timer_label = customtkinter.CTkLabel(toolbar, text=str(self.timer), text_color=Util.get_default_button_color()) + self.timer_label = customtkinter.CTkLabel(toolbar, text=str(self.timer), + text_color=Util.get_default_button_color()) self.timer_label.pack(side=RIGHT, ipadx=20) def display_new_timer(self): @@ -72,13 +87,15 @@ class Toolbar: def toggle_black_white(self): self.image_window.option["bw"] = not self.image_window.option["bw"] - self.bw_button.configure(fg_color=Util.get_default_active_button_color() if self.image_window.option["bw"] else Util.get_default_button_color()) + self.bw_button.configure(fg_color=Util.get_default_active_button_color() if self.image_window.option[ + "bw"] else Util.get_default_button_color()) self.image_window.image.apply_options() def toggle_mirror(self): self.image_window.option["mirror"] = not self.image_window.option["mirror"] - self.mirror_button.configure(fg_color=Util.get_default_active_button_color() if self.image_window.option["mirror"] else Util.get_default_button_color()) + self.mirror_button.configure(fg_color=Util.get_default_active_button_color() if self.image_window.option[ + "mirror"] else Util.get_default_button_color()) self.image_window.image.apply_options() @@ -112,6 +129,7 @@ class Toolbar: def toggle_fullscreen(self): self.image_window.option["fullscreen"] = not self.image_window.option["fullscreen"] - self.fullscreen_button.configure(fg_color=Util.get_default_active_button_color() if self.image_window.option["fullscreen"] else Util.get_default_button_color()) + self.fullscreen_button.configure(fg_color=Util.get_default_active_button_color() if self.image_window.option[ + "fullscreen"] else Util.get_default_button_color()) self.image_window.window.attributes("-fullscreen", self.image_window.option["fullscreen"])