[Refactor] IS_CONFIG_WINDOW_COMPACT_MODE をview_variableへ移動。

This commit is contained in:
Sakamoto Shiina
2023-09-20 21:01:58 +09:00
parent cfca2be71e
commit 4176ec4cb0
9 changed files with 14 additions and 15 deletions

View File

@@ -32,7 +32,6 @@ class View():
self.settings.config_window = SimpleNamespace(
ctm=all_ctm.config_window,
uism=all_uism.config_window,
IS_CONFIG_WINDOW_COMPACT_MODE=config.IS_CONFIG_WINDOW_COMPACT_MODE,
**common_args
)
@@ -102,6 +101,8 @@ class View():
# Config Window
ACTIVE_SETTING_BOX_TAB_ATTR_NAME="side_menu_tab_appearance",
CALLBACK_SELECTED_SETTING_BOX_TAB=None,
IS_CONFIG_WINDOW_COMPACT_MODE=config.IS_CONFIG_WINDOW_COMPACT_MODE,
# Appearance Tab
VAR_LABEL_TRANSPARENCY=StringVar(value="Transparency"),
VAR_DESC_TRANSPARENCY=StringVar(value="Change the window's transparency. 50% to 100%. (Default: 100%)"),
@@ -603,9 +604,8 @@ class View():
@staticmethod
def reloadConfigWindowSettingBoxContainer():
vrct_gui.config_window.settings.IS_CONFIG_WINDOW_COMPACT_MODE = config.IS_CONFIG_WINDOW_COMPACT_MODE
def reloadConfigWindowSettingBoxContainer(self):
self.view_variable.IS_CONFIG_WINDOW_COMPACT_MODE = config.IS_CONFIG_WINDOW_COMPACT_MODE
vrct_gui.config_window.reloadConfigWindowSettingBoxContainer()

View File

@@ -60,7 +60,7 @@ def _createSettingBoxCompactModeButton(parent_widget, config_window, settings, v
progress_color=settings.ctm.SB__SWITCH_BOX_ACTIVE_BG_COLOR, # SB__SWITCH_BOX_ACTIVE_BG_COLOR is for SB. change it later.
)
config_window.setting_box_compact_mode_switch_box.select() if settings.IS_CONFIG_WINDOW_COMPACT_MODE else config_window.setting_box_compact_mode_switch_box.deselect()
config_window.setting_box_compact_mode_switch_box.select() if view_variable.IS_CONFIG_WINDOW_COMPACT_MODE else config_window.setting_box_compact_mode_switch_box.deselect()
config_window.setting_box_compact_mode_switch_box.grid(row=0, column=0)

View File

@@ -5,9 +5,8 @@ from vrct_gui.ui_utils import createButtonWithImage
from typing import Union
class _SettingBoxGenerator():
def __init__(self, parent_widget, config_window, settings):
self.IS_CONFIG_WINDOW_COMPACT_MODE = settings.IS_CONFIG_WINDOW_COMPACT_MODE
def __init__(self, parent_widget, config_window, settings, view_variable):
self.view_variable = view_variable
self.config_window = config_window
self.parent_widget = parent_widget
self.settings = settings
@@ -50,7 +49,7 @@ class _SettingBoxGenerator():
)
setting_box_label.grid(row=0, column=0, padx=0, pady=0, sticky="ew")
if for_var_desc_text == None or self.IS_CONFIG_WINDOW_COMPACT_MODE is True:
if for_var_desc_text == None or self.view_variable.IS_CONFIG_WINDOW_COMPACT_MODE is True:
pass
else:
self.setting_box_desc = CTkLabel(

View File

@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings)
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxEntry = sbg.createSettingBoxEntry

View File

@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_Appearance(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings)
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
createSettingBoxSlider = sbg.createSettingBoxSlider

View File

@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings)
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
createSettingBoxEntry = sbg.createSettingBoxEntry

View File

@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_Mic(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings)
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider

View File

@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_Speaker(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings)
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider

View File

@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
from .._SettingBoxGenerator import _SettingBoxGenerator
def createSettingBox_Translation(setting_box_wrapper, config_window, settings, view_variable):
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings)
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
createSettingBoxEntry = sbg.createSettingBoxEntry