Skip to content

Commit

Permalink
feat: make log tab auto refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
iholston committed Nov 27, 2023
1 parent d620048 commit aa6aa9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lolbot/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Constants:
ICON_PATH = 'lolbot/resources/images/a.ico'

# Other
VERSION = '2.1.1'
VERSION = '2.1.2'

@staticmethod
def create_dirs():
Expand Down
7 changes: 6 additions & 1 deletion lolbot/view/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def show(self) -> None:
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, [0, 0, 0, 0])
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, [29, 151, 236, 25])
dpg.add_theme_color(dpg.mvThemeCol_Text, [29, 151, 236])
with dpg.tab_bar() as self.tab_bar:
with dpg.tab_bar(callback=self._tab_selected) as self.tab_bar:
self.bot_tab.create_tab(self.tab_bar)
self.accounts_tab.create_tab(self.tab_bar)
self.config_tab.create_tab(self.tab_bar)
Expand All @@ -72,6 +72,11 @@ def show(self) -> None:
self.terminate.set()
dpg.destroy_context()

def _tab_selected(self, sender, app_data, user_data) -> None:
"""Callback for tab select"""
if app_data == self.logs_tab.id:
self.logs_tab.create_log_table()

def _gui_updater(self) -> None:
"""Updates view each frame, displays up-to-date bot info"""
if not self.message_queue.empty():
Expand Down

0 comments on commit aa6aa9c

Please sign in to comment.