[Refactor] IS_CONFIG_WINDOW_COMPACT_MODE をview_variableへ移動。
This commit is contained in:
8
view.py
8
view.py
@@ -32,7 +32,6 @@ class View():
|
|||||||
self.settings.config_window = SimpleNamespace(
|
self.settings.config_window = SimpleNamespace(
|
||||||
ctm=all_ctm.config_window,
|
ctm=all_ctm.config_window,
|
||||||
uism=all_uism.config_window,
|
uism=all_uism.config_window,
|
||||||
IS_CONFIG_WINDOW_COMPACT_MODE=config.IS_CONFIG_WINDOW_COMPACT_MODE,
|
|
||||||
**common_args
|
**common_args
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -102,6 +101,8 @@ class View():
|
|||||||
# Config Window
|
# Config Window
|
||||||
ACTIVE_SETTING_BOX_TAB_ATTR_NAME="side_menu_tab_appearance",
|
ACTIVE_SETTING_BOX_TAB_ATTR_NAME="side_menu_tab_appearance",
|
||||||
CALLBACK_SELECTED_SETTING_BOX_TAB=None,
|
CALLBACK_SELECTED_SETTING_BOX_TAB=None,
|
||||||
|
IS_CONFIG_WINDOW_COMPACT_MODE=config.IS_CONFIG_WINDOW_COMPACT_MODE,
|
||||||
|
|
||||||
# Appearance Tab
|
# Appearance Tab
|
||||||
VAR_LABEL_TRANSPARENCY=StringVar(value="Transparency"),
|
VAR_LABEL_TRANSPARENCY=StringVar(value="Transparency"),
|
||||||
VAR_DESC_TRANSPARENCY=StringVar(value="Change the window's transparency. 50% to 100%. (Default: 100%)"),
|
VAR_DESC_TRANSPARENCY=StringVar(value="Change the window's transparency. 50% to 100%. (Default: 100%)"),
|
||||||
@@ -603,9 +604,8 @@ class View():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
def reloadConfigWindowSettingBoxContainer(self):
|
||||||
def reloadConfigWindowSettingBoxContainer():
|
self.view_variable.IS_CONFIG_WINDOW_COMPACT_MODE = config.IS_CONFIG_WINDOW_COMPACT_MODE
|
||||||
vrct_gui.config_window.settings.IS_CONFIG_WINDOW_COMPACT_MODE = config.IS_CONFIG_WINDOW_COMPACT_MODE
|
|
||||||
vrct_gui.config_window.reloadConfigWindowSettingBoxContainer()
|
vrct_gui.config_window.reloadConfigWindowSettingBoxContainer()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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.
|
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)
|
config_window.setting_box_compact_mode_switch_box.grid(row=0, column=0)
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ from vrct_gui.ui_utils import createButtonWithImage
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
class _SettingBoxGenerator():
|
class _SettingBoxGenerator():
|
||||||
def __init__(self, parent_widget, config_window, settings):
|
def __init__(self, parent_widget, config_window, settings, view_variable):
|
||||||
|
self.view_variable = view_variable
|
||||||
self.IS_CONFIG_WINDOW_COMPACT_MODE = settings.IS_CONFIG_WINDOW_COMPACT_MODE
|
|
||||||
self.config_window = config_window
|
self.config_window = config_window
|
||||||
self.parent_widget = parent_widget
|
self.parent_widget = parent_widget
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
@@ -50,7 +49,7 @@ class _SettingBoxGenerator():
|
|||||||
)
|
)
|
||||||
setting_box_label.grid(row=0, column=0, padx=0, pady=0, sticky="ew")
|
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
|
pass
|
||||||
else:
|
else:
|
||||||
self.setting_box_desc = CTkLabel(
|
self.setting_box_desc = CTkLabel(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
|
|||||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||||
|
|
||||||
def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settings, view_variable):
|
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
|
createSettingBoxEntry = sbg.createSettingBoxEntry
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
|
|||||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||||
|
|
||||||
def createSettingBox_Appearance(setting_box_wrapper, config_window, settings, view_variable):
|
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
|
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
|
||||||
createSettingBoxSlider = sbg.createSettingBoxSlider
|
createSettingBoxSlider = sbg.createSettingBoxSlider
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
|
|||||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||||
|
|
||||||
def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_variable):
|
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
|
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||||
createSettingBoxEntry = sbg.createSettingBoxEntry
|
createSettingBoxEntry = sbg.createSettingBoxEntry
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
|
|||||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||||
|
|
||||||
def createSettingBox_Mic(setting_box_wrapper, config_window, settings, view_variable):
|
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
|
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
|
||||||
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||||
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider
|
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
|
|||||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||||
|
|
||||||
def createSettingBox_Speaker(setting_box_wrapper, config_window, settings, view_variable):
|
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
|
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
|
||||||
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||||
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider
|
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from utils import callFunctionIfCallable
|
|||||||
from .._SettingBoxGenerator import _SettingBoxGenerator
|
from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||||
|
|
||||||
def createSettingBox_Translation(setting_box_wrapper, config_window, settings, view_variable):
|
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
|
createSettingBoxEntry = sbg.createSettingBoxEntry
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user