11import tkinter as tk
2+
23from pynput .keyboard import Key , Controller
4+
35import password_strength_logic
46
57keyboard = Controller ()
68
79title_font = 'Helvetica 24'
810warning_font = 'Helvetica 16'
911
10- def show_paste_button (event ) -> None :
12+ copy_button_y_offest = 30
13+
14+ def display_paste_button (event ) -> None :
1115 '''
1216 Called when the user right-clicks on the input_box,
1317 this function uses the Tkinter module to display a contextual menu containing a 'paste' button on the x and y coordinates of the user's cursor,
@@ -18,7 +22,7 @@ def show_paste_button(event) -> None:
1822 event:
1923 Gets the coordinates of the mouse cursor when the user releases a mouse button on a password_label.
2024 '''
21- paste .tk_popup (event .x_root , event .y_root - 30 )
25+ paste .tk_popup (event .x_root , event .y_root - copy_button_y_offest )
2226
2327def paste_text () -> None :
2428 '''
@@ -54,7 +58,7 @@ def create_password_strength_frame(frame) -> None:
5458 input_box = tk .Entry (frame , width = 32 , borderwidth = 2 )
5559 input_box .grid (column = 0 , row = 2 )
5660 input_box .bind ('<KeyRelease>' , lambda abcdefgh : password_strength_logic .check_password_strength (None , warnings , first_label , input_box .get (), second_label , third_label , fourth_label ))
57- input_box .bind ('<Button-3>' , show_paste_button )
61+ input_box .bind ('<Button-3>' , display_paste_button )
5862
5963 global first_label
6064 first_label = tk .Label (frame , font = warning_font , text = '' )
0 commit comments