Commit ebeb41e4 authored by Thorfin89's avatar Thorfin89

Correction sur les curseurs

parent cc90c7cf
...@@ -11,8 +11,6 @@ from PIL import Image ...@@ -11,8 +11,6 @@ from PIL import Image
COLOR = "#000000" COLOR = "#000000"
VERSION = 3 VERSION = 3
BOXE_SIZE = 2
BORDER = 1
# ===== FONCTIONS ===== # ===== FONCTIONS =====
...@@ -25,11 +23,15 @@ def color_selection(): ...@@ -25,11 +23,15 @@ def color_selection():
def create_qrcode(): def create_qrcode():
if texte_a_coder.get() != "": if texte_a_coder.get() != "":
global qrcode_img global qrcode_img
bs = boxe_size_scale.get()
br = border_size_scale.get()
qr = qrcode.QRCode( qr = qrcode.QRCode(
version=VERSION, version=VERSION,
error_correction=ERROR_CORRECT_M, error_correction=ERROR_CORRECT_M,
box_size=BOXE_SIZE, box_size=bs,
border=BORDER border=br
) )
qr.add_data(texte_a_coder.get()) qr.add_data(texte_a_coder.get())
qr.make(fit='True') qr.make(fit='True')
...@@ -109,7 +111,6 @@ orange_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Orange", ...@@ -109,7 +111,6 @@ orange_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Orange",
brown_btn = Radiobutton(left_frame, bg="#CCCCCC", text="Marron", 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 ESP = 25 # espace entre les boutons radios
black_btn.place(x=10, y=20 + ESP) black_btn.place(x=10, y=20 + ESP)
blue_btn.place(x=10, y=20 + 2 * ESP) blue_btn.place(x=10, y=20 + 2 * ESP)
...@@ -120,18 +121,18 @@ orange_btn.place(x=10, y=20 + 6 * ESP) ...@@ -120,18 +121,18 @@ orange_btn.place(x=10, y=20 + 6 * ESP)
brown_btn.place(x=10, y=20 + 7 * ESP) brown_btn.place(x=10, y=20 + 7 * ESP)
# choix de la BOXE_SIZE # choix de la BOXE_SIZE
BoxS = IntVar() boxe_size = IntVar()
boxe_size_scale = Scale(left_frame, from_=1, to=10, variable=BoxS, orient=HORIZONTAL) 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.config(bg="#CCCCCC", label="Taille des points :", length=180, highlightthickness=0)
boxe_size_scale.set(5) boxe_size_scale.set(5)
boxe_size_scale.place(x=180, y=18) boxe_size_scale.place(x=180, y=18)
# choix de la taille de la bordure # choix de la taille de la bordure
BorS = IntVar() border_size = IntVar()
boxe_size_scale = Scale(left_frame, from_=1, to=10, variable=BorS, orient=HORIZONTAL) border_size_scale = Scale(left_frame, from_=1, to=10, variable=border_size, orient=HORIZONTAL)
boxe_size_scale.config(bg="#CCCCCC", label="Épaisseur de la bordure :", length=180, highlightthickness=0) border_size_scale.config(bg="#CCCCCC", label="Épaisseur de la bordure :", length=180, highlightthickness=0)
boxe_size_scale.set(2) border_size_scale.set(2)
boxe_size_scale.place(x=180, y=100) border_size_scale.place(x=180, y=100)
# bouton de création du QRCode # bouton de création du QRCode
create_Btn = Button(left_frame, text="Créer le Code", bg="#88FF88", command=create_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) ...@@ -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 = Label(bottom_frame, text='Données à coder :', bg="#CCCCCC")
titre_texte_a_coder.place(x=10, y=0) titre_texte_a_coder.place(x=10, y=0)
texte_a_coder = Entry(bottom_frame, width=122) 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) texte_a_coder.place(x=30, y=25)
# affichage du QRcode # 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