From e60ceb09b630f92f4e649a7720b31d997869fb41 Mon Sep 17 00:00:00 2001 From: anqude <79022830+anqude@users.noreply.github.com> Date: Tue, 10 Jan 2023 02:54:11 +0400 Subject: [PATCH] fixes Now you can resize qr; fix dependencies --- PassgenerGUI.py | 14 +++++++++++--- README.md | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/PassgenerGUI.py b/PassgenerGUI.py index f162d77..d2ff42c 100644 --- a/PassgenerGUI.py +++ b/PassgenerGUI.py @@ -1,4 +1,4 @@ -from customtkinter import CTk,CTkLabel,CTkButton,CTkEntry,CTkCheckBox,CTkToplevel,CTkImage +from customtkinter import CTk,CTkLabel,CTkButton,CTkEntry,CTkCheckBox from PassgenCLI import * from tkinter import IntVar,END,PhotoImage from qr import generate_qr @@ -102,15 +102,23 @@ def genadiy(): window.title("QR") window.tk.call('wm', 'iconphoto', window._w, PhotoImage(file='qr.png')) bg = ImageTk.PhotoImage(file="qr.png") - canvas = Canvas(window) + canvas = Canvas(window,) + canvas.configure(bg="black") canvas.pack(fill="both", expand=True) canvas.create_image(0,0,image=bg, anchor='nw') def resize_image(win): global image, resized, image2 image = Image.open("qr.png") - resized = image.resize((win.width, win.height), Image.Resampling.LANCZOS) + wide=win.width + high=win.height + if high < wide: + wide=high + else: + high=wide + resized = image.resize((wide, high)) image2 = ImageTk.PhotoImage(resized) + canvas.delete("all") canvas.create_image(0, 0, image=image2, anchor='nw') window.bind("", resize_image) diff --git a/README.md b/README.md index b90f860..a29bdac 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pip install tk pyperclip qrcode customtkinter qrcode password-strength **On debian** ```sh -sudo apt install python3-tk python3-pil.imagetk pytho3-pip python3 +sudo apt install python3-tk python3-pil.imagetk python3-pip python3 ``` **On fedora**