Skip to content

Commit e4da08e

Browse files
committed
style: ui centered
1 parent 87c2062 commit e4da08e

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

app/guikeylogger.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,13 @@ def on_button_click():
195195
set_appearance_mode("dark")
196196
root = CTk() # Creating root window using customTkinter, it allows to change color of Title bar unlike the official tkinter
197197
root.geometry("800x600")
198+
root.resizable(False, False)
198199
root.protocol("WM_DELETE_WINDOW", on_closing)
199200

201+
# Main frame to hold all widgets and center them
202+
main_frame = CTkFrame(root, fg_color="transparent")
203+
main_frame.pack(expand=True)
204+
200205
# Set initial button text
201206
btnStr = StringVar()
202207
btnStr.set("Start Keylogger")
@@ -208,30 +213,32 @@ def on_button_click():
208213
image = Image.open('cracking.png')
209214
resize_image = image.resize((300, 300))
210215
img = ImageTk.PhotoImage(resize_image)
211-
icon = CTkLabel(root, image=img, text="")
216+
icon = CTkLabel(main_frame, image=img, text="")
212217
icon.pack(pady=(20, 0))
213218

214219
# Set window title
215220
root.title("Key Logger 5155")
216221

217222
# Display title label
218-
Title = CTkLabel(root, text="Key Logger 5155", font=("Cascadia Code", 50, "bold"), text_color="green")
223+
Title = CTkLabel(main_frame, text="Key Logger 5155", font=("Cascadia Code", 50, "bold"), text_color="#00ff00")
219224
Title.pack(pady=(10, 20))
220225

221226
# Frame for input widgets
222-
InputFrame = CTkFrame(root, fg_color="transparent")
227+
InputFrame = CTkFrame(main_frame, fg_color="transparent")
223228
InputFrame.pack(pady=10)
224229

225230
# Widgets for email address entry
226231
receiver_label = CTkLabel(InputFrame, text="Recipient's E-mail Address : ", font=("Cascadia Code", 13, "bold"),
227-
text_color="green")
228-
receiver_entry = CTkEntry(InputFrame, width=300, font=("Cascadia Code", 13, "bold"))
232+
text_color="#00ff00")
233+
receiver_entry = CTkEntry(InputFrame, width=300, font=("Cascadia Code", 13, "bold"),
234+
placeholder_text="Enter recipient's email...", border_color="#00ff00", border_width=2)
229235
receiver_entry.grid(row=0, column=1, padx=10)
230236
receiver_label.grid(row=0, column=0)
231237

232238
# Button to start/stop keylogger
233-
button = CTkButton(root, textvariable=btnStr, command=on_button_click, width=200,
234-
font=("Cascadia Code", 13, "bold"), fg_color="green", hover_color="#006400")
239+
button = CTkButton(main_frame, textvariable=btnStr, command=on_button_click, width=200,
240+
font=("Cascadia Code", 13, "bold"), fg_color="#00ff00", hover_color="#008F11",
241+
text_color="#000000", corner_radius=6, border_width=2, border_color="#000000")
235242
button.pack(pady=20)
236243

237244
# Run the main event loop

0 commit comments

Comments
 (0)