add UI and Feature: Config Window Compact Mode.

This commit is contained in:
Sakamoto Shiina
2023-08-31 19:13:14 +09:00
parent cb434717e0
commit 08d3f04738
6 changed files with 68 additions and 6 deletions

View File

@@ -17,6 +17,7 @@ class ConfigWindow(CTkToplevel):
self.configure(fg_color="#ff7f50")
self.protocol("WM_DELETE_WINDOW", vrct_gui.closeConfigWindow)
self.settings = settings
@@ -26,3 +27,10 @@ class ConfigWindow(CTkToplevel):
createSideMenuAndSettingsBoxContainers(config_window=self, settings=settings)
def reloadConfigWindowSettingBoxContainer(self):
self.main_bg_container.destroy()
createSideMenuAndSettingsBoxContainers(config_window=self, settings=self.settings)

View File

@@ -2,6 +2,17 @@ from customtkinter import CTkFont, CTkFrame, CTkLabel, CTkSwitch
def _createSettingBoxCompactModeButton(parent_widget, config_window, settings):
def switchConfigWindowCompactMode():
print(config_window.setting_box_compact_mode_switch_box.get())
if config_window.setting_box_compact_mode_switch_box.get() is True:
if callable(config_window.CALLBACK_ENABLE_CONFIG_WINDOW_COMPACT_MODE) is True:
config_window.CALLBACK_ENABLE_CONFIG_WINDOW_COMPACT_MODE()
else:
if callable(config_window.CALLBACK_DISABLE_CONFIG_WINDOW_COMPACT_MODE) is True:
config_window.CALLBACK_DISABLE_CONFIG_WINDOW_COMPACT_MODE()
config_window.setting_box_compact_mode_button_container = CTkFrame(parent_widget, corner_radius=0, fg_color=settings.ctm.TOP_BAR_BG_COLOR, width=0, height=0)
config_window.setting_box_compact_mode_button_container.grid(row=0, column=1, padx=(0, 20), sticky="nsw")
@@ -44,7 +55,7 @@ def _createSettingBoxCompactModeButton(parent_widget, config_window, settings):
switch_height=16,
onvalue=True,
offvalue=False,
# command=command,
command=switchConfigWindowCompactMode,
# fg_color="",
# bg_color="red",
progress_color=settings.ctm.SB__SWITCH_BOX_ACTIVE_BG_COLOR, # SB__SWITCH_BOX_ACTIVE_BG_COLOR is for SB. change it later.

View File

@@ -106,11 +106,11 @@ class VRCT_GUI(CTk):
)
def setDefaultActiveLanguagePresetTab(self, tab_no:str):
vrct_gui.current_active_preset_tab = getattr(self, f"sqls__presets_button_{tab_no}")
self.current_active_preset_tab = getattr(self, f"sqls__presets_button_{tab_no}")
_setDefaultActiveTab(
active_tab_widget=vrct_gui.current_active_preset_tab,
active_bg_color=vrct_gui.settings.main.ctm.SQLS__PRESETS_TAB_BG_ACTIVE_COLOR,
active_text_color=vrct_gui.settings.main.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR
active_tab_widget=self.current_active_preset_tab,
active_bg_color=self.settings.main.ctm.SQLS__PRESETS_TAB_BG_ACTIVE_COLOR,
active_text_color=self.settings.main.ctm.SQLS__PRESETS_TAB_ACTIVE_TEXT_COLOR
)