Skip to content

Commit

Permalink
Resolved most errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kelltom committed May 10, 2023
1 parent 1a933bf commit c8f7c65
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
customtkinter==4.5.10
customtkinter==5.1.3
Deprecated==1.2.13
flake8==6.0.0
matplotlib==3.6.2
Expand Down
6 changes: 3 additions & 3 deletions src/OSBC.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def build_ui(self): # sourcery skip: merge-list-append, move-assign-in-block
self.frame_left.grid_rowconfigure(19, minsize=20) # empty row with minsize as spacing (adds a top padding to settings btn)
self.frame_left.grid_rowconfigure(21, minsize=10) # empty row with minsize as spacing (bottom padding below settings btn)

self.label_1 = customtkinter.CTkLabel(master=self.frame_left, text="Scripts", text_font=("Roboto Medium", 14))
self.label_1 = customtkinter.CTkLabel(master=self.frame_left, text="Scripts")
self.label_1.grid(row=1, column=0, pady=10, padx=10)

# ============ View/Controller Configuration ============
Expand Down Expand Up @@ -279,15 +279,15 @@ def __toggle_bot_by_key(self, bot_key, btn: customtkinter.CTkButton):
pady=0,
)
self.current_btn = btn
self.current_btn.configure(fg_color=btn.hover_color)
self.current_btn.configure(fg_color=btn._hover_color)
# If we are switching to a new script
else:
self.controller.model.progress = 0
self.controller.update_progress()
self.controller.change_model(self.models[bot_key])
self.current_btn.configure(fg_color=self.DEFAULT_GRAY)
self.current_btn = btn
self.current_btn.configure(fg_color=btn.hover_color)
self.current_btn.configure(fg_color=btn._hover_color)

# ============ Misc Handlers ============
def change_mode(self):
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/options_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def __init__(self, parent, title: str, option_info: dict, controller):
self.columnconfigure(1, weight=1)

# Title
self.lbl_example_bot_options = customtkinter.CTkLabel(master=self, text=f"{title} Options", text_font=("Roboto Medium", 14))
self.lbl_example_bot_options = customtkinter.CTkLabel(master=self, text=f"{title} Options")
self.lbl_example_bot_options.grid(row=0, column=0, padx=10, pady=20)

# Dynamically place widgets
Expand Down
5 changes: 2 additions & 3 deletions src/view/home_view_runelite.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self, parent, main, game_title: str):
# self.label_logo.grid(row=1, column=0, columnspan=3, sticky="nsew", padx=15, pady=15)

# Title
self.label_title = customtkinter.CTkLabel(self, text=f"{game_title}", text_font=("Roboto", 24))
self.label_title = customtkinter.CTkLabel(self, text=f"{game_title}")
self.label_title.grid(row=1, column=0, columnspan=3, sticky="nsew", padx=15, pady=15)

# Description label
Expand All @@ -44,7 +44,7 @@ def __init__(self, parent, main, game_title: str):
+ "step if you know your client is already configured. If a script has a rocket icon next to its name, RuneLite should instead be launched using"
" the dedicated button provided by the script."
)
self.label_note = customtkinter.CTkLabel(master=self, text=self.note, text_font=("Roboto", 12))
self.label_note = customtkinter.CTkLabel(master=self, text=self.note)
self.label_note.bind(
"<Configure>",
lambda e: self.label_note.configure(wraplength=self.label_note.winfo_width() - 20),
Expand All @@ -56,7 +56,6 @@ def __init__(self, parent, main, game_title: str):
self.label_warning = customtkinter.CTkLabel(
master=self,
text=self.warning,
text_font=("Roboto", 10),
text_color="orange",
)
self.label_warning.bind(
Expand Down
12 changes: 5 additions & 7 deletions src/view/info_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def __init__(self, parent, title, info): # sourcery skip: merge-nested-ifs
master=self,
text=title,
justify=tkinter.LEFT,
text_font=("default_theme", 12),
)
self.lbl_script_title.grid(column=0, row=0, sticky="wns", padx=15, pady=15)

Expand Down Expand Up @@ -83,12 +82,11 @@ def __init__(self, parent, title, info): # sourcery skip: merge-nested-ifs
master=self,
text="Controls",
justify=tkinter.LEFT,
text_font=("default_theme", 12),
)
self.lbl_controls_title.grid(row=0, column=1, sticky="wns")

# Button frame
self.btn_frame = customtkinter.CTkFrame(master=self, fg_color=self.fg_color)
self.btn_frame = customtkinter.CTkFrame(master=self, fg_color=self._fg_color)
self.btn_frame.rowconfigure((1, 2, 3), weight=0)
self.btn_frame.rowconfigure((0, 4), weight=1)
self.btn_frame.grid(row=1, rowspan=4, column=1, padx=15, sticky="wns")
Expand All @@ -100,8 +98,8 @@ def __init__(self, parent, title, info): # sourcery skip: merge-nested-ifs
image=self.img_play,
command=self.play_btn_clicked,
)
self.btn_play.bind("<Enter>", lambda event: event.widget.configure(text=f"{settings.keybind_to_text(self.combination_keys)}"))
self.btn_play.bind("<Leave>", lambda event: event.widget.configure(text="Play"))
self.btn_play.bind("<Enter>", lambda event: self.btn_play.configure(text=f"{settings.keybind_to_text(self.combination_keys)}"))
self.btn_play.bind("<Leave>", lambda event: self.btn_play.configure(text="Play"))
self.btn_play.grid(row=1, column=0, pady=(0, 15), sticky="nsew")

self.btn_stop = customtkinter.CTkButton(
Expand All @@ -113,8 +111,8 @@ def __init__(self, parent, title, info): # sourcery skip: merge-nested-ifs
image=self.img_stop,
command=self.stop_btn_clicked,
)
self.btn_stop.bind("<Enter>", lambda event: event.widget.configure(text=f"{settings.keybind_to_text(self.combination_keys)}"))
self.btn_stop.bind("<Leave>", lambda event: event.widget.configure(text="Stop"))
self.btn_stop.bind("<Enter>", lambda event: self.btn_stop.configure(text=f"{settings.keybind_to_text(self.combination_keys)}"))
self.btn_stop.bind("<Leave>", lambda event: self.btn_stop.configure(text="Stop"))

self.btn_options = customtkinter.CTkButton(
master=self.btn_frame,
Expand Down
1 change: 0 additions & 1 deletion src/view/output_log_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def __init__(self, parent):
master=self,
text="Script Log",
justify=tkinter.LEFT,
text_font=("default_theme", 12),
)
self.lbl_title.grid(row=0, column=0, sticky="wns", padx=15, pady=15)

Expand Down
2 changes: 1 addition & 1 deletion src/view/title_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(self, parent, main):

# Description label
self.note = "The universal OSRS color bot.\n Select a game in the left-side menu to begin."
self.label_note = customtkinter.CTkLabel(master=self, text=self.note, text_font=("Roboto", 14))
self.label_note = customtkinter.CTkLabel(master=self, text=self.note)
self.label_note.bind(
"<Configure>",
lambda e: self.label_note.configure(wraplength=self.label_note.winfo_width() - 20),
Expand Down

0 comments on commit c8f7c65

Please sign in to comment.