Commit ebeb41e4 authored by Thorfin89's avatar Thorfin89

Correction sur les curseurs

parent cc90c7cf
......@@ -11,8 +11,6 @@ from PIL import Image
COLOR = "#000000"
VERSION = 3
BOXE_SIZE = 2
BORDER = 1
# ===== FONCTIONS =====
......@@ -25,11 +23,15 @@ def color_selection():
def create_qrcode():
if texte_a_coder.get() != "":
global qrcode_img
bs = boxe_size_scale.get()
br = border_size_scale.get()
qr = qrcode.QRCode(
version=VERSION,
error_correction=ERROR_CORRECT_M,
box_size=BOXE_SIZE,
border=BORDER
box_size=bs,
border=br
)
qr.add_data(texte_a_coder.get())
qr.make(fit='True')
......@@ -101,14 +103,13 @@ blue_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Bleu",
red_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Rouge",
variable=color, value="#FF0000", command=color_selection)
green_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Vert",
variable=color, value="#00FF00", command=color_selection)
variable=color, value="#00FF00", command=color_selection)
violet_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Violet",
variable=color, value="#800080", command=color_selection)
variable=color, value="#800080", command=color_selection)
orange_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Orange",
variable=color, value="#FFA500", command=color_selection)
variable=color, value="#FFA500", command=color_selection)
brown_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Marron",
variable=color, value="#6C5417", command=color_selection)
variable=color, value="#6C5417", command=color_selection)
ESP = 25 # espace entre les boutons radios
black_btn.place(x=10, y=20 + ESP)
......@@ -120,18 +121,18 @@ orange_btn.place(x=10, y=20 + 6 * ESP)
brown_btn.place(x=10, y=20 + 7 * ESP)
# choix de la BOXE_SIZE
BoxS = IntVar()
boxe_size_scale = Scale(left_frame, from_=1, to=10, variable=BoxS, orient=HORIZONTAL)
boxe_size = IntVar()
boxe_size_scale = Scale(left_frame, from_=1, to=10, variable=boxe_size, orient=HORIZONTAL)
boxe_size_scale.config(bg="#CCCCCC", label="Taille des points :", length=180, highlightthickness=0)
boxe_size_scale.set(5)
boxe_size_scale.place(x=180, y=18)
# choix de la taille de la bordure
BorS = IntVar()
boxe_size_scale = Scale(left_frame, from_=1, to=10, variable=BorS, orient=HORIZONTAL)
boxe_size_scale.config(bg="#CCCCCC", label="Épaisseur de la bordure :", length=180, highlightthickness=0)
boxe_size_scale.set(2)
boxe_size_scale.place(x=180, y=100)
border_size = IntVar()
border_size_scale = Scale(left_frame, from_=1, to=10, variable=border_size, orient=HORIZONTAL)
border_size_scale.config(bg="#CCCCCC", label="Épaisseur de la bordure :", length=180, highlightthickness=0)
border_size_scale.set(2)
border_size_scale.place(x=180, y=100)
# bouton de création du QRCode
create_Btn = Button(left_frame, text="Créer le Code", bg="#88FF88", command=create_qrcode)
......@@ -141,7 +142,7 @@ create_Btn.place(x=260, y=360, width=100, height=40)
titre_texte_a_coder = Label(bottom_frame, text='Données à coder :', bg="#CCCCCC")
titre_texte_a_coder.place(x=10, y=0)
texte_a_coder = Entry(bottom_frame, width=122)
texte_a_coder.insert(0, "https://objnux.fr")
texte_a_coder.insert(0, "https://objnux.fr") # ligne à supprimer une fois le code validé
texte_a_coder.place(x=30, y=25)
# affichage du QRcode
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment