Skip to content

Commit

Permalink
v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
liner-exe committed Feb 8, 2024
1 parent a547599 commit aa88de0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PasswordGenerator-GUI
# PasswordGenerator-GUI (v1.3)
## ❓ About
Password Generator with graphical interface on custom tkinter
<br><br>
Expand All @@ -14,8 +14,8 @@ Password Generator with graphical interface on custom tkinter
## ⚙️ Compatibility
| **Operation System** | **Status** | **Version**|
| :---------: | :-----------: | :-----------: |
| **Windows** | 🟢 Compatible | v1.2 |
| **Linux** | 🟢 Compatible | v1.2 |
| **Windows** | 🟢 Compatible | v1.3 |
| **Linux** | 🟢 Compatible | v1.3 |
| **MacOS** | 🟡 Not tested | x |

<br><br>
Expand Down
38 changes: 29 additions & 9 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self):
# ------------------------------------------- APP SETTINGS ------------------------------------------------- #
platform_name = platform.system()

self.title(f'Password Generator v1.2 | for {platform_name}')
self.title(f'Password Generator v1.3')
self._set_appearance_mode('dark')
ctk.set_default_color_theme('green')
self.geometry('1070x640+200+200')
Expand All @@ -39,16 +39,29 @@ def __init__(self):

self.password_frame = ctk.CTkFrame(self, fg_color=('#ffffff', '#323332'), bg_color=('#ffffff', '#323332'),
corner_radius=0)
self.password_frame.columnconfigure(all([0, 1]), minsize=40, weight=1)
self.password_frame.rowconfigure(all([i for i in range(8)]), minsize=20)
# self.password_frame.columnconfigure(all([0, 1]), minsize=40, weight=1)
# self.password_frame.rowconfigure(all([i for i in range(8)]), minsize=20)
self.password_frame.pack(fill='both', side='top', expand=True)

self.password = ctk.CTkEntry(self.password_frame, width=600, font=(fontname, 24))
self.password.grid(row=0, column=0, stick='we', pady=10, sticky='n')
self.password = ctk.CTkEntry(self.password_frame, width=500, font=(fontname, 24))
self.password.grid(row=0, column=0, columnspan=5, padx=10, pady=10, stick='we')

self.length = ctk.CTkEntry(self.password_frame, 250, 30, placeholder_text="Enter password length",
font=(fontname, 20))
self.length.grid(row=1, column=0, columnspan=2, pady=10, sticky='s')
# self.length = ctk.CTkEntry(self.password_frame, 250, 30, placeholder_text="Enter password length",
# font=(fontname, 20))
# self.length.grid(row=1, column=0, columnspan=2, pady=10, sticky='s')

self.password_lenght = 6

password_label = ctk.CTkLabel(self.password_frame, text="Password Length")
password_label.grid(row=1, column=0, padx=10, sticky='e')

self.lenght = ctk.CTkSlider(self.password_frame, from_=6, to=30, variable=ctk.IntVar(value=self.password_lenght),
width=100,
number_of_steps=24, command=self.update_password_lenght)
self.lenght.grid(row=1, column=1, sticky='w')

self.lenght_display = ctk.CTkLabel(self.password_frame, text=self.password_lenght)
self.lenght_display.grid(row=1, column=2, padx=0, pady=10, sticky='w')

# -------------------------------- BUTTONS (GENERATE, CLEAR, COPY) ------------------------------------------ #

Expand Down Expand Up @@ -116,7 +129,7 @@ def generate_password(self):

try:
password = ''
for i in range(int(self.length.get())):
for i in range(int(self.password_lenght)):
password += random.choice(symbols)

self.password.insert(index=0, string=password)
Expand Down Expand Up @@ -222,6 +235,13 @@ def open_about():
close_button = ctk.CTkButton(about, text='CLOSE', command=about.destroy)
close_button.pack(pady=30)

def update_password_lenght(self, value):
value = int(value)
print(value)
self.password_lenght = value
self.lenght_display.configure(text=value)



if __name__ == "__main__":
app = App()
Expand Down
9 changes: 9 additions & 0 deletions src/settings.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[appearance]
theme_color="system"
theme_accent="green"

[window]
window_scaling=2
widget_scaling=2

;for future

0 comments on commit aa88de0

Please sign in to comment.