-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from kr1s7ian/overhaul
Overhaul
- Loading branch information
Showing
8 changed files
with
301 additions
and
147 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1 @@ | ||
# steam-account-switcher | ||
Gui account switcher made with customtkinter py. | ||
Idea of the tool, and functionality of the account switching mechanics by pog | ||
#5249, python code and implementation of UI made by me. | ||
|
||
How To Use: | ||
- Pressing the plus button prompts the user for a new username along with a new title, the title is the text shown on the buttons, and username is the username of the steam account the button will log into. | ||
- Right clicking an account button will delete that entry. | ||
- You can use keyboard keys 1 to 9 to log in in the respective accounts. | ||
|
||
![Program Demo Image](https://i.imgur.com/Xtvrhsx.png) | ||
|
||
Ignore if using releases: | ||
- If you are cloning and running with python, customtkinter has a known bug with the CTkInputDialog, it shold return None when pressing cancel but the command parameter is set to the same one for the ok button, for more details on how to the issue go here https://github.com/TomSchimansky/CustomTkinter/pull/853/commits/d43cc3d6112c77db7742156198b2014ce5f56058 | ||
|
||
Other: | ||
- Feel free to submit feedback in the issues tab, even if you feel its a minor detail or if you have any problems: | ||
|
||
WIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import customtkinter as ck | ||
from typing import Callable | ||
from PIL import Image | ||
from PIL import PngImagePlugin | ||
|
||
|
||
def get_placeholder_image(size): | ||
return ck.CTkImage(Image.open('Logo.png'), size=(size, size)) | ||
|
||
|
||
class AccountBox(ck.CTkFrame): | ||
def bind(self, sequence=None, command=None, add=True): | ||
""" called on the tkinter.Canvas """ | ||
if not (add == "+" or add is True): | ||
raise ValueError( | ||
"'add' argument can only be '+' or True to preserve internal callbacks") | ||
self.button.bind(sequence, command, add=True) | ||
|
||
def unbind(self, sequence=None, funcid=None): | ||
""" called on the tkinter.Canvas """ | ||
if funcid is not None: | ||
raise ValueError("'funcid' argument can only be None, because there is a bug in" + | ||
" tkinter and its not clear whether the internal callbacks will be unbinded or not") | ||
self.self.button.unbind(sequence, None) | ||
|
||
def __init__(self, *args, | ||
image_path: str = None, | ||
title: str, | ||
height: int, | ||
width: int, | ||
command: Callable = None, | ||
avatar_size: int, | ||
** kwargs): | ||
super().__init__(*args, width=width, height=height, **kwargs) | ||
if image_path == None or image_path == "": | ||
self.avatar_image = get_placeholder_image(avatar_size) | ||
else: | ||
self.avatar_image = ck.CTkImage( | ||
Image.open(image_path), size=(avatar_size, avatar_size)) | ||
|
||
self.avatar = ck.CTkLabel(self, image=self.avatar_image, text="") | ||
self.avatar.grid(padx=5, pady=5, row=0, column=0) | ||
|
||
button_width = (width - avatar_size) - 15 | ||
|
||
self.button = ck.CTkButton( | ||
self, text=title, height=avatar_size, width=button_width, command=command) | ||
self.button.grid(padx=5, pady=5, row=0, column=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.