[Update] Config Window: スレッショルドチェックボタンのDisabled処理追加や変更。Disabledなボタンそのものを追加。
This commit is contained in:
21
view.py
21
view.py
@@ -463,17 +463,18 @@ class View():
|
||||
"sb__optionmenu_mic_device",
|
||||
]
|
||||
)
|
||||
self.replaceMicThresholdCheckButton_Disabled()
|
||||
|
||||
if config.CHOICE_SPEAKER_DEVICE == "NoDevice":
|
||||
self.view_variable.VAR_SPEAKER_DEVICE.set("No Speaker Device Detected")
|
||||
|
||||
if config.CHOICE_SPEAKER_DEVICE == "NoDevice":
|
||||
vrct_gui._changeConfigWindowWidgetsStatus(
|
||||
status="disabled",
|
||||
target_names=[
|
||||
"sb__optionmenu_speaker_device",
|
||||
]
|
||||
)
|
||||
self.replaceSpeakerThresholdCheckButton_Disabled()
|
||||
|
||||
|
||||
|
||||
if config.INPUT_MIC_DYNAMIC_ENERGY_THRESHOLD is True:
|
||||
@@ -740,11 +741,19 @@ class View():
|
||||
@staticmethod
|
||||
def replaceMicThresholdCheckButton_Active():
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__disabled_button_mic_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid()
|
||||
|
||||
@staticmethod
|
||||
def replaceMicThresholdCheckButton_Disabled():
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__disabled_button_mic_energy_threshold.grid()
|
||||
|
||||
@staticmethod
|
||||
def replaceMicThresholdCheckButton_Passive():
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__active_button_mic_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__disabled_button_mic_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_mic_energy_threshold.grid()
|
||||
|
||||
|
||||
@@ -752,11 +761,19 @@ class View():
|
||||
@staticmethod
|
||||
def replaceSpeakerThresholdCheckButton_Active():
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__disabled_button_speaker_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid()
|
||||
|
||||
@staticmethod
|
||||
def replaceSpeakerThresholdCheckButton_Disabled():
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__disabled_button_speaker_energy_threshold.grid()
|
||||
|
||||
@staticmethod
|
||||
def replaceSpeakerThresholdCheckButton_Passive():
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__active_button_speaker_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__disabled_button_speaker_energy_threshold.grid_remove()
|
||||
vrct_gui.config_window.sb__progressbar_x_slider__passive_button_speaker_energy_threshold.grid()
|
||||
|
||||
|
||||
|
||||
@@ -233,6 +233,7 @@ class _SettingBoxGenerator():
|
||||
progressbar_attr_name,
|
||||
passive_button_attr_name, passive_button_command,
|
||||
active_button_attr_name, active_button_command,
|
||||
disabled_button_attr_name, disabled_button_image_file,
|
||||
button_image_file,
|
||||
|
||||
entry_variable,
|
||||
@@ -316,16 +317,23 @@ class _SettingBoxGenerator():
|
||||
passive_button_wrapper = self._createPassiveButtonForProgressbarXSlider(setting_box_item_frame, passive_button_command, button_image_file)
|
||||
setattr(self.config_window, passive_button_attr_name, passive_button_wrapper)
|
||||
|
||||
disabled_button_wrapper = self._createDisabledButtonForProgressbarXSlider(setting_box_item_frame, disabled_button_image_file)
|
||||
setattr(self.config_window, disabled_button_attr_name, disabled_button_wrapper)
|
||||
|
||||
active_button_wrapper = self._createActiveButtonForProgressbarXSlider(setting_box_item_frame, active_button_command, button_image_file)
|
||||
setattr(self.config_window, active_button_attr_name, active_button_wrapper)
|
||||
|
||||
passive_button_wrapper.grid(row=1, column=SETTING_BOX_COLUMN, padx=(0,BUTTON_PADDING), sticky="e")
|
||||
passive_button_wrapper.configure(corner_radius=int(getLatestWidth(passive_button_wrapper)/2))
|
||||
|
||||
disabled_button_wrapper.grid(row=1, column=SETTING_BOX_COLUMN, padx=(0,BUTTON_PADDING), sticky="e")
|
||||
disabled_button_wrapper.configure(corner_radius=int(getLatestWidth(passive_button_wrapper)/2))
|
||||
|
||||
active_button_wrapper.grid(row=1, column=SETTING_BOX_COLUMN, padx=(0,BUTTON_PADDING), sticky="e")
|
||||
active_button_wrapper.configure(corner_radius=int(getLatestWidth(passive_button_wrapper)/2))
|
||||
|
||||
passive_button_wrapper.grid_remove()
|
||||
disabled_button_wrapper.grid_remove()
|
||||
active_button_wrapper.grid_remove()
|
||||
|
||||
passive_button_wrapper.grid()
|
||||
@@ -484,4 +492,17 @@ class _SettingBoxGenerator():
|
||||
button_ipadxy=self.settings.uism.SB__PROGRESSBAR_X_SLIDER__BUTTON_IPADXY,
|
||||
button_command=button_command,
|
||||
)
|
||||
return button_wrapper
|
||||
|
||||
|
||||
|
||||
def _createDisabledButtonForProgressbarXSlider(self, setting_box_progressbar_x_slider_frame, button_image_file):
|
||||
button_wrapper = createButtonWithImage(
|
||||
parent_widget=setting_box_progressbar_x_slider_frame,
|
||||
button_fg_color=self.settings.ctm.SB__PROGRESSBAR_X_SLIDER__PASSIVE_BUTTON_DISABLED_COLOR,
|
||||
button_image_file=button_image_file,
|
||||
button_image_size=self.settings.uism.SB__PROGRESSBAR_X_SLIDER__BUTTON_ICON_SIZE,
|
||||
button_ipadxy=self.settings.uism.SB__PROGRESSBAR_X_SLIDER__BUTTON_IPADXY,
|
||||
no_bind=True,
|
||||
)
|
||||
return button_wrapper
|
||||
@@ -96,7 +96,9 @@ def createSettingBox_Mic(setting_box_wrapper, config_window, settings, view_vari
|
||||
passive_button_command=lambda _e: checkbox_input_mic_threshold_check_callback(True),
|
||||
active_button_attr_name="sb__progressbar_x_slider__active_button_mic_energy_threshold",
|
||||
active_button_command=lambda _e: checkbox_input_mic_threshold_check_callback(False),
|
||||
button_image_file=settings.image_file.MIC_ICON
|
||||
button_image_file=settings.image_file.MIC_ICON,
|
||||
disabled_button_attr_name="sb__progressbar_x_slider__disabled_button_mic_energy_threshold",
|
||||
disabled_button_image_file=settings.image_file.MIC_ICON_DISABLED,
|
||||
)
|
||||
config_window.sb__mic_energy_threshold.grid(row=row)
|
||||
row+=1
|
||||
|
||||
@@ -79,7 +79,9 @@ def createSettingBox_Speaker(setting_box_wrapper, config_window, settings, view_
|
||||
passive_button_command=lambda _e: checkbox_input_speaker_threshold_check_callback(True),
|
||||
active_button_attr_name="sb__progressbar_x_slider__active_button_speaker_energy_threshold",
|
||||
active_button_command=lambda _e: checkbox_input_speaker_threshold_check_callback(False),
|
||||
button_image_file=settings.image_file.HEADPHONES_ICON
|
||||
button_image_file=settings.image_file.HEADPHONES_ICON,
|
||||
disabled_button_attr_name="sb__progressbar_x_slider__disabled_button_speaker_energy_threshold",
|
||||
disabled_button_image_file=settings.image_file.HEADPHONES_ICON_DISABLED,
|
||||
)
|
||||
config_window.sb__speaker_energy_threshold.grid(row=row)
|
||||
row+=1
|
||||
|
||||
@@ -126,17 +126,19 @@ def switchTabsColor(target_widget, tab_buttons, active_bg_color, active_text_col
|
||||
|
||||
|
||||
|
||||
def createButtonWithImage(parent_widget, button_fg_color, button_enter_color, button_clicked_color, button_image_file, button_image_size, button_ipadxy, button_command, corner_radius: int = 0):
|
||||
button_wrapper = CTkFrame(parent_widget, corner_radius=corner_radius, fg_color=button_fg_color, height=0, width=0, cursor="hand2")
|
||||
def createButtonWithImage(parent_widget, button_image_size, button_ipadxy, button_fg_color, button_enter_color=None, button_clicked_color=None, button_image_file=None, button_command=None, corner_radius:int=0, no_bind:bool=False):
|
||||
button_wrapper = CTkFrame(parent_widget, corner_radius=corner_radius, fg_color=button_fg_color, height=0, width=0)
|
||||
|
||||
button_widget = CTkLabel(
|
||||
button_wrapper,
|
||||
text=None,
|
||||
height=0,
|
||||
image=CTkImage((button_image_file),size=(button_image_size,button_image_size)),
|
||||
)
|
||||
button_widget.grid(row=0, column=0, padx=button_ipadxy, pady=button_ipadxy)
|
||||
button_widget = CTkLabel(
|
||||
button_wrapper,
|
||||
text=None,
|
||||
height=0,
|
||||
image=CTkImage((button_image_file),size=(button_image_size,button_image_size)),
|
||||
)
|
||||
button_widget.grid(row=0, column=0, padx=button_ipadxy, pady=button_ipadxy)
|
||||
|
||||
if no_bind is False:
|
||||
button_wrapper.configure(cursor="hand2")
|
||||
bindButtonFunctionAndColor(
|
||||
target_widgets=[button_wrapper, button_widget],
|
||||
enter_color=button_enter_color,
|
||||
@@ -145,7 +147,7 @@ def createButtonWithImage(parent_widget, button_fg_color, button_enter_color, bu
|
||||
buttonReleasedFunction=button_command,
|
||||
)
|
||||
|
||||
return button_wrapper
|
||||
return button_wrapper
|
||||
|
||||
|
||||
def createOptionMenuBox(parent_widget, optionmenu_bg_color, optionmenu_hovered_bg_color, optionmenu_clicked_bg_color, optionmenu_ipadx, optionmenu_ipady, variable, font_family, font_size, text_color, image_file, image_size, optionmenu_clicked_command, optionmenu_position=None, optionmenu_padx_between_img=0, optionmenu_min_height=None, optionmenu_min_width=None, setattr_widget=None, image_widget_attr_name=None):
|
||||
|
||||
Reference in New Issue
Block a user