From 87c20620cecad05001b763bb00c4d0fa80cd8cc9 Mon Sep 17 00:00:00 2001 From: sanghaibiraj Date: Sat, 11 Oct 2025 19:29:25 +0000 Subject: [PATCH 1/2] style: gui improvement --- app/guikeylogger.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/guikeylogger.py b/app/guikeylogger.py index 8d73912..39d9eb0 100644 --- a/app/guikeylogger.py +++ b/app/guikeylogger.py @@ -12,11 +12,11 @@ from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from time import sleep -from tkinter import Label, Frame, Entry, Button, messagebox, StringVar, Tk +from tkinter import messagebox, StringVar, Tk from urllib.request import urlopen from PIL import ImageGrab, Image, ImageTk -from customtkinter import CTk +from customtkinter import CTk, CTkLabel, CTkFrame, CTkEntry, CTkButton, set_appearance_mode from dotenv import load_dotenv from pynput.keyboard import Listener @@ -192,9 +192,9 @@ def on_button_click(): # Create the root window +set_appearance_mode("dark") root = CTk() # Creating root window using customTkinter, it allows to change color of Title bar unlike the official tkinter root.geometry("800x600") -root.config(bg="black") root.protocol("WM_DELETE_WINDOW", on_closing) # Set initial button text @@ -208,31 +208,31 @@ def on_button_click(): image = Image.open('cracking.png') resize_image = image.resize((300, 300)) img = ImageTk.PhotoImage(resize_image) -icon = Label(root, image=img, bg="black", width=300, height=400) -icon.pack() +icon = CTkLabel(root, image=img, text="") +icon.pack(pady=(20, 0)) # Set window title root.title("Key Logger 5155") # Display title label -Title = Label(root, text="Key Logger 5155", font=("Cascadia Code", 50, "bold"), pady=20, bg="black", fg="green") -Title.pack() +Title = CTkLabel(root, text="Key Logger 5155", font=("Cascadia Code", 50, "bold"), text_color="green") +Title.pack(pady=(10, 20)) # Frame for input widgets -InputFrame = Frame(root, bg="black", pady=20) -InputFrame.pack() +InputFrame = CTkFrame(root, fg_color="transparent") +InputFrame.pack(pady=10) # Widgets for email address entry -receiver_label = Label(InputFrame, text="Recipients E-mail Address : ", font=("Cascadia Code", 13, "bold"), pady=20, - bg="black", fg="green") -receiver_entry = Entry(InputFrame, bg="black", fg="green", width=35, font=("Cascadia Code", 13, "bold")) -receiver_entry.grid(row=0, column=1) +receiver_label = CTkLabel(InputFrame, text="Recipient's E-mail Address : ", font=("Cascadia Code", 13, "bold"), + text_color="green") +receiver_entry = CTkEntry(InputFrame, width=300, font=("Cascadia Code", 13, "bold")) +receiver_entry.grid(row=0, column=1, padx=10) receiver_label.grid(row=0, column=0) # Button to start/stop keylogger -button = Button(root, textvariable=btnStr, command=on_button_click, width=30, bg="green", - font=("Cascadia Code", 13, "bold")) -button.pack() +button = CTkButton(root, textvariable=btnStr, command=on_button_click, width=200, + font=("Cascadia Code", 13, "bold"), fg_color="green", hover_color="#006400") +button.pack(pady=20) # Run the main event loop root.mainloop() From e4da08e9372b49fc0f04d93478fb12ee1baa1366 Mon Sep 17 00:00:00 2001 From: sanghaibiraj Date: Sun, 12 Oct 2025 14:48:21 +0000 Subject: [PATCH 2/2] style: ui centered --- app/guikeylogger.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/app/guikeylogger.py b/app/guikeylogger.py index 39d9eb0..a1f6b6f 100644 --- a/app/guikeylogger.py +++ b/app/guikeylogger.py @@ -195,8 +195,13 @@ def on_button_click(): set_appearance_mode("dark") root = CTk() # Creating root window using customTkinter, it allows to change color of Title bar unlike the official tkinter root.geometry("800x600") +root.resizable(False, False) root.protocol("WM_DELETE_WINDOW", on_closing) +# Main frame to hold all widgets and center them +main_frame = CTkFrame(root, fg_color="transparent") +main_frame.pack(expand=True) + # Set initial button text btnStr = StringVar() btnStr.set("Start Keylogger") @@ -208,30 +213,32 @@ def on_button_click(): image = Image.open('cracking.png') resize_image = image.resize((300, 300)) img = ImageTk.PhotoImage(resize_image) -icon = CTkLabel(root, image=img, text="") +icon = CTkLabel(main_frame, image=img, text="") icon.pack(pady=(20, 0)) # Set window title root.title("Key Logger 5155") # Display title label -Title = CTkLabel(root, text="Key Logger 5155", font=("Cascadia Code", 50, "bold"), text_color="green") +Title = CTkLabel(main_frame, text="Key Logger 5155", font=("Cascadia Code", 50, "bold"), text_color="#00ff00") Title.pack(pady=(10, 20)) # Frame for input widgets -InputFrame = CTkFrame(root, fg_color="transparent") +InputFrame = CTkFrame(main_frame, fg_color="transparent") InputFrame.pack(pady=10) # Widgets for email address entry receiver_label = CTkLabel(InputFrame, text="Recipient's E-mail Address : ", font=("Cascadia Code", 13, "bold"), - text_color="green") -receiver_entry = CTkEntry(InputFrame, width=300, font=("Cascadia Code", 13, "bold")) + text_color="#00ff00") +receiver_entry = CTkEntry(InputFrame, width=300, font=("Cascadia Code", 13, "bold"), + placeholder_text="Enter recipient's email...", border_color="#00ff00", border_width=2) receiver_entry.grid(row=0, column=1, padx=10) receiver_label.grid(row=0, column=0) # Button to start/stop keylogger -button = CTkButton(root, textvariable=btnStr, command=on_button_click, width=200, - font=("Cascadia Code", 13, "bold"), fg_color="green", hover_color="#006400") +button = CTkButton(main_frame, textvariable=btnStr, command=on_button_click, width=200, + font=("Cascadia Code", 13, "bold"), fg_color="#00ff00", hover_color="#008F11", + text_color="#000000", corner_radius=6, border_width=2, border_color="#000000") button.pack(pady=20) # Run the main event loop