Skip to content

Commit

Permalink
4.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaM-TL committed Apr 25, 2023
1 parent 5f9c783 commit 0ed56e4
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 42 deletions.
85 changes: 44 additions & 41 deletions fotokilof/fotokilof.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
from ttkbootstrap.scrolled import ScrolledText, ScrolledFrame
from ttkbootstrap.tooltip import ToolTip
from ttkbootstrap.dialogs.colorchooser import ColorChooserDialog
from ttkbootstrap.constants import N, S, W, E, X, BOTH, LEFT, RIGHT, TOP, BOTTOM, END, DISABLED, NORMAL, HORIZONTAL
from ttkbootstrap.constants import N, S, W, E, X, BOTH, LEFT, RIGHT, TOP, BOTTOM, END, \
DISABLED, NORMAL, HORIZONTAL

# my modules
import convert
Expand Down Expand Up @@ -102,7 +103,7 @@

preview_size_list = (300, 350, 400, 450, 500, 550, 600, 650, 700, 800,
900, 1000, 1200, 1400, 1600, 1800, 1920, 'none')
##########################
###################


def print_command(cmd):
Expand Down Expand Up @@ -709,50 +710,53 @@ def open_screenshot():
open_file_common(today_dir, filename)


def askcolor(initial):
def ask_color(initial):
""" Use color widget ColorChooserDialog from ttkbootstrap"""
cd = ColorChooserDialog(initialcolor=initial)
cd.show()
colors = cd.result
result = colors.hex
color_dialog = ColorChooserDialog(initialcolor=initial)
color_dialog.show()
colors = color_dialog.result
if colors:
result = colors.hex
else:
result = None
return result


def color_choose_rotate():
""" color selection for rotate"""
color = askcolor(img_rotate_color.get())
color = ask_color(img_rotate_color.get())
if color is not None:
img_rotate_color.set(color)
l_rotate_color.configure(bg=color)


def color_choose_border():
""" Border color selection """
color = askcolor(img_border_color.get())
color = ask_color(img_border_color.get())
if color is not None:
img_border_color.set(color)
l_border_color.configure(bg=color)


def color_choose_vignette():
""" color selection for rotate"""
color = askcolor(img_vignette_color.get())
color = ask_color(img_vignette_color.get())
if color is not None:
img_vignette_color.set(color)
l_vignette_color.configure(bg=color)


def color_choose_box():
""" Background color selection """
color = askcolor(img_text_color.get())
color = ask_color(img_text_color.get())
if color is not None:
img_text_box_color.set(color)
l_text_color.configure(bg=img_text_box_color.get())


def color_choose():
""" Color selection """
color = askcolor(img_text_color.get())
color = ask_color(img_text_color.get())
if color is not None:
img_text_color.set(color)
l_text_color.configure(fg=img_text_color.get())
Expand Down Expand Up @@ -1095,7 +1099,7 @@ def preview_orig():

crop_rectangle = (x0, y0, x1, y1)
else:
crop_rectangle = (" ")
crop_rectangle = ""

preview_picture = preview.preview_wand(file_in_path.get(),
int(co_preview_selector_orig.get()),
Expand Down Expand Up @@ -1370,8 +1374,8 @@ def text_tool_hide_show():
# GUI main window
###############################################################################

#root = Tk()
root = ttk.Window(resizable=(1,1), title=version.__author__ + " : " + version.__appname__ + " " + version.__version__)
title_begin = version.__author__ + " : " + version.__appname__ + " " + version.__version__
root = ttk.Window(resizable=(1,1), title=title_begin)
ttk.Sizegrip()
# hidden file
# https://code.activestate.com/lists/python-tkinter-discuss/3723/
Expand Down Expand Up @@ -1467,8 +1471,8 @@ def text_tool_hide_show():
validation = main_paned.register(gui.only_numbers) # Entry validation
validationint = main_paned.register(gui.only_integer) # Entry validation integer value
####################################################################
progressbar = ttk.Progressbar(main_progress, orient=HORIZONTAL, bootstyle="info", mode='determinate',
variable=progressbar_var, maximum=100)
progressbar = ttk.Progressbar(main_progress, orient=HORIZONTAL, bootstyle="info",
mode='determinate', variable=progressbar_var, maximum=100)
progressbar.pack(side=BOTTOM, padx=0, pady=0, fill=X, expand=0, anchor=S)
####################################################################
# main_menu row
Expand Down Expand Up @@ -1537,8 +1541,10 @@ def text_tool_hide_show():
frame_save = ttk.LabelFrame(main_menu, text=_("Settings"))
frame_save.grid(row=1, column=3, sticky=(N, W, E, S), padx=5, pady=5)

b_last_save = ttk.Button(frame_save, text=_("Save"), command=ini_save_wraper, bootstyle="info-outline")
b_last_read = ttk.Button(frame_save, text=_("Load"), command=ini_read_wraper, bootstyle="info-outline")
b_last_save = ttk.Button(frame_save, text=_("Save"), bootstyle="info-outline",
command=ini_save_wraper)
b_last_read = ttk.Button(frame_save, text=_("Load"), bootstyle="info-outline",
command=ini_read_wraper)

b_last_save.pack(padx=5, pady=1, anchor=W, side=LEFT)
b_last_read.pack(padx=5, pady=1, anchor=W, side=LEFT)
Expand Down Expand Up @@ -1799,15 +1805,15 @@ def text_tool_hide_show():
e3_crop_3.grid(row=4, column=4, sticky=W, padx=5, pady=1)
e4_crop_3.grid(row=4, column=5, sticky=W, padx=5, pady=1)
frame_crop_gravity.grid(row=2, column=2, rowspan=2, padx=5, columnspan=4, sticky=E)
rb_crop_NW.grid(row=1, column=1, sticky=W, pady=1)
rb_crop_N.grid(row=1, column=2, pady=1)
rb_crop_NE.grid(row=1, column=3, sticky=W, pady=1)
rb_crop_W.grid(row=2, column=1, sticky=W, pady=1)
rb_crop_C.grid(row=2, column=2, sticky=W, pady=1)
rb_crop_E.grid(row=2, column=3, sticky=W, pady=1)
rb_crop_SW.grid(row=3, column=1, sticky=W, pady=1)
rb_crop_S.grid(row=3, column=2, pady=1)
rb_crop_SE.grid(row=3, column=3, sticky=W, pady=1)
rb_crop_NW.grid(row=1, column=1, sticky=W, padx=3, pady=1)
rb_crop_N.grid(row=1, column=2, padx=3, pady=1)
rb_crop_NE.grid(row=1, column=3, sticky=W, padx=3, pady=1)
rb_crop_W.grid(row=2, column=1, sticky=W, padx=3, pady=1)
rb_crop_C.grid(row=2, column=2, sticky=W, padx=3, pady=1)
rb_crop_E.grid(row=2, column=3, sticky=W, padx=3, pady=1)
rb_crop_SW.grid(row=3, column=1, sticky=W, padx=3, pady=1)
rb_crop_S.grid(row=3, column=2, padx=3, pady=1)
rb_crop_SE.grid(row=3, column=3, sticky=W, padx=3, pady=1)
frame_crop_buttons.grid(row=5, column=1, sticky=(W, E))
b_crop_read.grid(row=1, column=1, sticky=W, padx=15, pady=5)
b_crop_show.grid(row=1, column=2, sticky=W, padx=5, pady=5)
Expand Down Expand Up @@ -1875,15 +1881,15 @@ def text_tool_hide_show():
rb_text_SE = ttk.Radiobutton(frame_text_gravity, text="SE",
variable=img_text_gravity, value="SE")
frame_text_gravity.grid(row=2, column=2, rowspan=3, padx=25, pady=2, sticky=(W, N))
rb_text_NW.grid(row=1, column=1, sticky=W, pady=1)
rb_text_N.grid(row=1, column=2, pady=1)
rb_text_NE.grid(row=1, column=3, sticky=W, pady=1)
rb_text_W.grid(row=2, column=1, sticky=W, pady=1)
rb_text_C.grid(row=2, column=2, pady=1)
rb_text_E.grid(row=2, column=3, sticky=W, pady=1)
rb_text_SW.grid(row=3, column=1, sticky=W, pady=1)
rb_text_S.grid(row=3, column=2, pady=1)
rb_text_SE.grid(row=3, column=3, sticky=W, pady=1)
rb_text_NW.grid(row=1, column=1, sticky=W, padx=3, pady=1)
rb_text_N.grid(row=1, column=2, padx=3, pady=1)
rb_text_NE.grid(row=1, column=3, sticky=W, padx=3, pady=1)
rb_text_W.grid(row=2, column=1, sticky=W, padx=3, pady=1)
rb_text_C.grid(row=2, column=2, padx=3, pady=1)
rb_text_E.grid(row=2, column=3, sticky=W, padx=3, pady=1)
rb_text_SW.grid(row=3, column=1, padx=3, sticky=W, pady=1)
rb_text_S.grid(row=3, column=2, padx=3, pady=1)
rb_text_SE.grid(row=3, column=3, sticky=W, padx=3, pady=1)

###
co_text_font = ttk.Combobox(frame_text, width=30,
Expand Down Expand Up @@ -2459,10 +2465,7 @@ def text_tool_hide_show():
#

Python_version = "Py " + platform.python_version() + " Tk " + str(TkVersion)
window_title = ( version.__author__ + " : "
+ version.__appname__ + " "
+ version.__version__ + " : "
+ IMAGEMAGICK_WAND_VERSION + " : " + Python_version + " | " )
window_title = title_begin + IMAGEMAGICK_WAND_VERSION + " : " + Python_version + " | "
root.title(window_title)
if IMAGEMAGICK_WAND is not None:
img_text_font_dict = fonts() # Reading available fonts
Expand Down
2 changes: 1 addition & 1 deletion fotokilof/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
THE SOFTWARE.
"""

__version__ = "4.3.0"
__version__ = "4.3.1"
__author__ = "Tomasz Łuczak"
__email__ = "[email protected]"
__appname__ = "FotoKilof"
Expand Down
Binary file modified screenshots/mini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0ed56e4

Please sign in to comment.