[fix] Config Window: Compact Mode. 今までDestroy()してWidgetsが再生成されていたのを、grid_removeを使う方法に変更、これによりコンパクトモード切り替えがスムーズになりました。
This commit is contained in:
@@ -23,16 +23,12 @@ class ConfigWindow(CTkToplevel):
|
||||
self.settings = settings
|
||||
self._view_variable = view_variable
|
||||
|
||||
# When the configuration window's compact mode is turned on, it will call `grid_remove()` on each widget appended to this array. In the opposite case, `grid()` will be called.
|
||||
self.additional_widgets = []
|
||||
|
||||
createConfigWindowTitle(config_window=self, settings=self.settings)
|
||||
|
||||
createSettingBoxTopBar(config_window=self, settings=self.settings, view_variable=self._view_variable)
|
||||
|
||||
|
||||
createSideMenuAndSettingsBoxContainers(config_window=self, settings=self.settings, view_variable=self._view_variable)
|
||||
|
||||
|
||||
|
||||
|
||||
def reloadConfigWindowSettingBoxContainer(self):
|
||||
self.main_bg_container.destroy()
|
||||
createSideMenuAndSettingsBoxContainers(config_window=self, settings=self.settings, view_variable=self._view_variable)
|
||||
@@ -60,7 +60,4 @@ 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 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)
|
||||
@@ -53,10 +53,8 @@ class _SettingBoxGenerator():
|
||||
)
|
||||
setting_box_label.grid(row=0, column=0, padx=0, pady=0, sticky="ew")
|
||||
|
||||
if for_var_desc_text == None or self.view_variable.IS_CONFIG_WINDOW_COMPACT_MODE is True:
|
||||
pass
|
||||
else:
|
||||
self.setting_box_desc = CTkLabel(
|
||||
if for_var_desc_text is not None:
|
||||
setting_box_desc = CTkLabel(
|
||||
setting_box_labels_frame,
|
||||
textvariable=for_var_desc_text,
|
||||
anchor="w",
|
||||
@@ -66,7 +64,8 @@ class _SettingBoxGenerator():
|
||||
font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.SB__DESC_FONT_SIZE, weight="normal"),
|
||||
text_color=self.settings.ctm.LABELS_DESC_TEXT_COLOR
|
||||
)
|
||||
self.setting_box_desc.grid(row=1, column=0, padx=0, pady=(self.settings.uism.SB__DESC_TOP_PADY,0), sticky="ew")
|
||||
setting_box_desc.grid(row=1, column=0, padx=0, pady=(self.settings.uism.SB__DESC_TOP_PADY,0), sticky="ew")
|
||||
self.config_window.additional_widgets.append(setting_box_desc)
|
||||
|
||||
|
||||
def createSettingBoxDropdownMenu(self, for_var_label_text, for_var_desc_text, optionmenu_attr_name, command, variable=None, dropdown_menu_values=None):
|
||||
|
||||
Reference in New Issue
Block a user