From 508cca8215fa7af20ef1b3b49e81ca2047be9bb0 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 13 Oct 2023 13:41:10 +0900 Subject: [PATCH] =?UTF-8?q?[Update]=20=E8=A8=AD=E5=AE=9A=E7=94=BB=E9=9D=A2?= =?UTF-8?q?=E3=81=8B=E3=82=89=E9=80=8F=E6=98=8E=E5=BA=A6=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E6=99=82=E3=81=AB=E3=80=81=E3=83=A1=E3=82=A4=E3=83=B3=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E3=81=AE=E3=82=AB=E3=83=90=E3=83=BC=E3=82=92=E4=B8=80?= =?UTF-8?q?=E6=99=82=E7=9A=84=E3=81=AB=E5=A4=96=E3=81=99=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=80=82=20=E3=82=B9=E3=83=A9=E3=82=A4=E3=83=80?= =?UTF-8?q?=E3=83=BC=E3=82=AF=E3=83=AA=E3=83=83=E3=82=AF=E6=99=82=EF=BC=88?= =?UTF-8?q?=E3=83=89=E3=83=A9=E3=83=83=E3=82=B0=E6=99=82=EF=BC=89=E3=81=AB?= =?UTF-8?q?=E3=82=AB=E3=83=90=E3=83=BC=E3=82=92=E5=A4=96=E3=81=97=E3=80=81?= =?UTF-8?q?=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9=E6=99=82=E3=81=AB=E6=88=BB?= =?UTF-8?q?=E3=81=99=E3=80=82=20=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=81=AFCTkSlider=E5=81=B4=E3=81=A7=E8=A8=AD=E5=AE=9A=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7?= =?UTF-8?q?=E3=81=86=E3=81=BE=E3=81=8F=E3=81=84=E3=81=8F=E3=81=91=E3=81=A9?= =?UTF-8?q?=E3=80=81=20CTkSlider=E3=81=AFbind=20ButtonPress(=E3=82=AF?= =?UTF-8?q?=E3=83=AA=E3=83=83=E3=82=AF)=E3=81=AF=E3=82=AA=E3=83=BC?= =?UTF-8?q?=E3=83=90=E3=83=BC=E3=83=A9=E3=82=A4=E3=83=89=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E5=BC=95=E6=95=B0command(=E3=82=AF?= =?UTF-8?q?=E3=83=AA=E3=83=83=E3=82=AF=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88?= =?UTF-8?q?)=E3=81=AB=E7=84=A1=E7=90=86=E3=82=84=E3=82=8A=E6=8C=9F?= =?UTF-8?q?=E3=81=BF=E8=BE=BC=E3=81=BF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view.py | 11 +++++++++++ .../_SettingBoxGenerator.py | 16 +++++++++++++--- .../createSettingBox_Appearance.py | 2 ++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/view.py b/view.py index 3a0187e4..1d74c48c 100644 --- a/view.py +++ b/view.py @@ -156,6 +156,8 @@ class View(): SLIDER_RANGE_TRANSPARENCY=(50, 100), CALLBACK_SET_TRANSPARENCY=None, VAR_TRANSPARENCY=IntVar(value=config.TRANSPARENCY), + CALLBACK_BUTTON_PRESS_TRANSPARENCY=self._closeTheCoverOfMainWindow, + CALLBACK_BUTTON_RELEASE_TRANSPARENCY=self._openTheCoverOfMainWindow, VAR_LABEL_APPEARANCE_THEME=StringVar(value=i18n.t("config_window.appearance_theme.label")), VAR_DESC_APPEARANCE_THEME=StringVar(value=i18n.t("config_window.appearance_theme.desc")), @@ -539,6 +541,15 @@ class View(): vrct_gui.attributes("-topmost", False) + @staticmethod + def _openTheCoverOfMainWindow(): + vrct_gui.modal_window.show() + vrct_gui.config_window.lift() + + @staticmethod + def _closeTheCoverOfMainWindow(): + vrct_gui.modal_window.withdraw() + def enableMainWindowSidebarCompactMode(self): self.view_variable.IS_MAIN_WINDOW_SIDEBAR_COMPACT_MODE = True vrct_gui._enableMainWindowSidebarCompactMode() diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/_SettingBoxGenerator.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/_SettingBoxGenerator.py index 8a5ad552..692fb046 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/_SettingBoxGenerator.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/_SettingBoxGenerator.py @@ -204,11 +204,10 @@ class _SettingBoxGenerator(): - def createSettingBoxSlider(self, for_var_label_text, for_var_desc_text, slider_attr_name, slider_range, command, variable, slider_number_of_steps: Union[int, None] = None): + def createSettingBoxSlider(self, for_var_label_text, for_var_desc_text, slider_attr_name, slider_range, command, variable, slider_number_of_steps: Union[int, None] = None, slider_bind__ButtonPress=None, slider_bind__ButtonRelease=None): (setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(slider_attr_name, for_var_label_text, for_var_desc_text) - # print(self.settings.uism.SB__SLIDER_WIDTH) - # print(self.settings.uism.SB__SLIDER_HEIGHT) + slider_widget = CTkSlider( setting_box_item_frame, width=self.settings.uism.SB__SLIDER_WIDTH, @@ -225,6 +224,17 @@ class _SettingBoxGenerator(): slider_widget.grid(row=1, column=SETTING_BOX_COLUMN, sticky="e") + if slider_bind__ButtonPress is not None: + def adjusted_slider_bind__ButtonPress(_e): + command(_e) + slider_bind__ButtonPress() + slider_widget.configure(command=adjusted_slider_bind__ButtonPress) + + if slider_bind__ButtonRelease is not None: + def adjusted_slider_bind__ButtonRelease(_e): + slider_bind__ButtonRelease() + slider_widget.bind("", adjusted_slider_bind__ButtonRelease, "+") + return setting_box_frame diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py index e745bc3f..b2058340 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py @@ -33,6 +33,8 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings, vi slider_range=view_variable.SLIDER_RANGE_TRANSPARENCY, command=lambda value: slider_transparency_callback(value), variable=view_variable.VAR_TRANSPARENCY, + slider_bind__ButtonPress=view_variable.CALLBACK_BUTTON_PRESS_TRANSPARENCY, + slider_bind__ButtonRelease=view_variable.CALLBACK_BUTTON_RELEASE_TRANSPARENCY, ) config_window.sb__transparency.grid(row=row) row+=1