From 2feb1a6fba0534c066492b47e58bfbcca3370b2d Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:01:05 +0900 Subject: [PATCH 1/5] [Update] About VRCT: add link that poster-exhibition-contact-us. --- view.py | 4 ++++ .../setting_box_about_vrct/createSettingBox_AboutVrct.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/view.py b/view.py index 989847b9..8b81c381 100644 --- a/view.py +++ b/view.py @@ -1159,9 +1159,13 @@ class View(): url = "https://github.com/misyaguziya/VRCT" case ("CONTACT_US"): url = "https://docs.google.com/forms/d/e/1FAIpQLSei-xoydOY60ivXqhOjaTzNN8PiBQIDcNhzfy6cw2sjYkcg_g/viewform" + case ("SUPPORTER_REGISTRATION"): url = "https://docs.google.com/forms/d/e/1FAIpQLSepLzdEOTJQFVHdOOxAA0dix3zCmnNBlmH4XWon5FldXkIiqw/viewform" + case ("POSTER_CONTACT_US"): + url = "https://docs.google.com/forms/d/e/1FAIpQLScwt19eX4Lkj_4w9J5H_3a-bkzXs6rkOc0B-0ZTVVfHKyiU7g/viewform" + case ("X_SHIINA_POSTER_SHOWCASE_POST"): if arg is None: diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_about_vrct/createSettingBox_AboutVrct.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_about_vrct/createSettingBox_AboutVrct.py index a8acee73..261a4a79 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_about_vrct/createSettingBox_AboutVrct.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_about_vrct/createSettingBox_AboutVrct.py @@ -589,7 +589,7 @@ def createSettingBox_AboutVrct(setting_box_wrapper, config_window, settings, vie poster_tell_us_message = createTellUsButton( parent_frame=poster_showcase_contents_wrapper, image_file_name=settings.about_vrct.image_file.POSTER_TELL_US_MESSAGE, - callback=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "TEMP"), + callback=lambda _e: callFunctionIfCallable(view_variable.CALLBACK_OPEN_WEBPAGE_ABOUT_VRCT, "POSTER_CONTACT_US"), ) poster_tell_us_message.grid(column=0, row=1, columnspan=2, padx=0, pady=(about_vrct_uism.POSTER_TELL_US_MESSAGE_TOP_PADY,0), sticky="nse") From 0026102f45cb70971112363e46669ae6ec70de30 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 26 Apr 2024 22:34:19 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[Update]=20Overlay=20Settings:=20=E6=9C=89?= =?UTF-8?q?=E5=8A=B9=E7=84=A1=E5=8A=B9=E3=82=B9=E3=82=A4=E3=83=83=E3=83=81?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=82=20VR=20Settings=E3=81=A7=E3=81=AF?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=80=81Overlay=20Settings=E3=81=AB=E3=80=82?= =?UTF-8?q?=20Light=E3=83=86=E3=83=BC=E3=83=9E=E3=81=AB=E4=B8=80=E9=83=A8?= =?UTF-8?q?=E5=AF=BE=E5=BF=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view.py | 4 +- .../main_window/createMainWindowWidgets.py | 32 +++++----- .../QuickSettingsWindow.py | 37 +++++++++-- .../_CreateQuickSettingBox.py | 64 +++++++++++++++---- vrct_gui/ui_managers/Themes/_darkTheme.py | 1 + vrct_gui/ui_managers/Themes/_lightTheme.py | 1 + 6 files changed, 104 insertions(+), 35 deletions(-) diff --git a/view.py b/view.py index 8b81c381..f7a4af37 100644 --- a/view.py +++ b/view.py @@ -139,8 +139,8 @@ class View(): - # VR Settings - VAR_VR_SETTINGS=StringVar(value="VR Settings"), + # Overlay Settings + VAR_VR_SETTINGS=StringVar(value="Overlay Settings"), CALLBACK_SET_CALLBACK_OPEN_VR_SETTINGS_WINDOW=self._openVrSettingsWindow, diff --git a/vrct_gui/main_window/createMainWindowWidgets.py b/vrct_gui/main_window/createMainWindowWidgets.py index ff9f5ef3..110e9cd1 100644 --- a/vrct_gui/main_window/createMainWindowWidgets.py +++ b/vrct_gui/main_window/createMainWindowWidgets.py @@ -48,48 +48,48 @@ def createMainWindowWidgets(vrct_gui, settings, view_variable): # start from 3 main_topbar_column=3 - # VR Settings Button - vrct_gui.vr_settings_container = CTkFrame( + # Overlay Settings Button + vrct_gui.overlay_settings_container = CTkFrame( vrct_gui.main_topbar_container, corner_radius=settings.uism.UPDATE_AVAILABLE_BUTTON_CORNER_RADIUS, fg_color=settings.ctm.MAIN_BG_COLOR, cursor="hand2", ) - vrct_gui.vr_settings_container.grid(row=0, column=main_topbar_column, padx=settings.uism.UPDATE_AVAILABLE_BUTTON_PADX, pady=settings.uism.TOP_BAR_BUTTON_PADY, sticky="nsw") - # vrct_gui.vr_settings_container.grid_remove() + vrct_gui.overlay_settings_container.grid(row=0, column=main_topbar_column, padx=settings.uism.UPDATE_AVAILABLE_BUTTON_PADX, pady=settings.uism.TOP_BAR_BUTTON_PADY, sticky="nsw") + # vrct_gui.overlay_settings_container.grid_remove() - vrct_gui.vr_settings_container.grid_rowconfigure((0,2), weight=1) + vrct_gui.overlay_settings_container.grid_rowconfigure((0,2), weight=1) - vrct_gui.vr_settings_icon = CTkLabel( - vrct_gui.vr_settings_container, + vrct_gui.overlay_settings_icon = CTkLabel( + vrct_gui.overlay_settings_container, text=None, corner_radius=0, height=0, - image=CTkImage(settings.image_file.CONFIGURATION_ICON, size=settings.uism.UPDATE_AVAILABLE_BUTTON_SIZE) + image=CTkImage(settings.image_file.CONFIGURATION_ICON_DISABLED, size=settings.uism.UPDATE_AVAILABLE_BUTTON_SIZE) ) - vrct_gui.vr_settings_icon.grid(row=1, column=0, padx=(settings.uism.UPDATE_AVAILABLE_BUTTON_IPADX, settings.uism.UPDATE_AVAILABLE_PADX_BETWEEN_LABEL_AND_ICON), pady=0) + vrct_gui.overlay_settings_icon.grid(row=1, column=0, padx=(settings.uism.UPDATE_AVAILABLE_BUTTON_IPADX, settings.uism.UPDATE_AVAILABLE_PADX_BETWEEN_LABEL_AND_ICON), pady=0) - vrct_gui.vr_settings_label = CTkLabel( - vrct_gui.vr_settings_container, + vrct_gui.overlay_settings_label = CTkLabel( + vrct_gui.overlay_settings_container, textvariable=view_variable.VAR_VR_SETTINGS, height=0, corner_radius=0, font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.UPDATE_AVAILABLE_BUTTON_FONT_SIZE, weight="normal"), anchor="e", - text_color="#fff", + text_color=settings.ctm.TOP_BAR_BUTTON_TEXT_COLOR, # text_color=settings.ctm.UPDATE_AVAILABLE_BUTTON_TEXT_COLOR, ) # This "right padx +1" is for fixing a bug that sticks out from the frame. I don't know why that happens... - vrct_gui.vr_settings_label.grid(row=1, column=1, padx=(0,settings.uism.UPDATE_AVAILABLE_BUTTON_IPADX+1), pady=0) + vrct_gui.overlay_settings_label.grid(row=1, column=1, padx=(0,settings.uism.UPDATE_AVAILABLE_BUTTON_IPADX+1), pady=0) bindButtonFunctionAndColor( target_widgets=[ - vrct_gui.vr_settings_container, - vrct_gui.vr_settings_label, - vrct_gui.vr_settings_icon, + vrct_gui.overlay_settings_container, + vrct_gui.overlay_settings_label, + vrct_gui.overlay_settings_icon, ], enter_color=settings.ctm.TOP_BAR_BUTTON_HOVERED_BG_COLOR, leave_color=settings.ctm.TOP_BAR_BUTTON_BG_COLOR, diff --git a/vrct_gui/quick_settings_window/QuickSettingsWindow.py b/vrct_gui/quick_settings_window/QuickSettingsWindow.py index e4f95446..08d7ff6b 100644 --- a/vrct_gui/quick_settings_window/QuickSettingsWindow.py +++ b/vrct_gui/quick_settings_window/QuickSettingsWindow.py @@ -9,18 +9,15 @@ class QuickSettingsWindow(CTkToplevel): def __init__(self, vrct_gui, settings, view_variable): super().__init__() self.withdraw() - # self.overrideredirect(True) self.configure(fg_color="#292a2d") - self.title("Quick Settings") - # self.wm_attributes("-toolwindow", True) + self.title("Overlay Settings") self.protocol("WM_DELETE_WINDOW", self.withdraw) self.after(200, lambda: self.iconbitmap(getImagePath("vrct_logo_mark_black.ico"))) self.settings = settings - BG_HEIGHT= 220 - BG_WIDTH= 450 + BG_HEX_COLOR = "#292a2d" self.grid_columnconfigure(0, weight=1, minsize=400) @@ -32,6 +29,7 @@ class QuickSettingsWindow(CTkToplevel): cqsb = _CreateQuickSettingBox(self.qsw_background, vrct_gui, settings, view_variable) createSettingBoxSlider = cqsb.createSettingBoxSlider + createSettingBoxSwitch = cqsb.createSettingBoxSwitch @@ -39,6 +37,19 @@ class QuickSettingsWindow(CTkToplevel): # Overlay General Settings row=0 + def switchCallback(switch_widget): + callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG, switch_widget.get()) + + self.qsb__enable_overlay_small_log = createSettingBoxSwitch( + for_var_label_text=view_variable.VAR_LABEL_ENABLE_OVERLAY_SMALL_LOG, + switch_attr_name="qsb__enable_overlay_small_log_switch", + command=lambda: switchCallback(vrct_gui.qsb__enable_overlay_small_log_switch), + variable=view_variable.VAR_ENABLE_OVERLAY_SMALL_LOG, + ) + self.qsb__enable_overlay_small_log.grid(row=row) + + + row+=1 def sliderCallback(e): value = round(e,2) callFunctionIfCallable(view_variable.CALLBACK_SET_OVERLAY_SETTINGS, value, "opacity") @@ -75,9 +86,23 @@ class QuickSettingsWindow(CTkToplevel): + # Overlay Small Log Settings + + # row+=1 + # def switchCallback(switch_widget): + # callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG, switch_widget.get()) + + # self.qsb__enable_overlay_small_log = createSettingBoxSwitch( + # for_var_label_text=view_variable.VAR_LABEL_ENABLE_OVERLAY_SMALL_LOG, + # switch_attr_name="qsb__enable_overlay_small_log_switch", + # command=lambda: switchCallback(vrct_gui.qsb__enable_overlay_small_log_switch), + # variable=view_variable.VAR_ENABLE_OVERLAY_SMALL_LOG, + # ) + # self.qsb__enable_overlay_small_log.grid(row=row) + + row+=1 - # Overlay Small Log Settings def sliderCallback(e): value = round(e,2) callFunctionIfCallable(view_variable.CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS, value, "x_pos") diff --git a/vrct_gui/quick_settings_window/_CreateQuickSettingBox.py b/vrct_gui/quick_settings_window/_CreateQuickSettingBox.py index 01bb931a..2a4ec2d1 100644 --- a/vrct_gui/quick_settings_window/_CreateQuickSettingBox.py +++ b/vrct_gui/quick_settings_window/_CreateQuickSettingBox.py @@ -2,7 +2,7 @@ from typing import Union from utils import callFunctionIfCallable -from customtkinter import CTkImage, CTkLabel, CTkToplevel, CTkProgressBar, CTkFrame, CTkSlider, CTkFont +from customtkinter import CTkImage, CTkLabel, CTkToplevel, CTkProgressBar, CTkFrame, CTkSlider, CTkFont, CTkSwitch from ..ui_utils import openImageKeepAspectRatio, getImageFileFromUiUtils, setGeometryToCenterOfScreen, fadeInAnimation class _CreateQuickSettingBox(): @@ -49,16 +49,16 @@ class _CreateQuickSettingBox(): setting_box_label.grid(row=1, column=0, padx=0, pady=0, sticky="nse") - - setting_box_label = CTkLabel( - setting_box_labels_frame, - textvariable=for_var_current_value, - anchor="w", - height=0, - font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.SB__LABEL_FONT_SIZE, weight="normal"), - text_color=self.settings.ctm.LABELS_TEXT_COLOR - ) - setting_box_label.grid(row=1, column=2, padx=0, pady=0, sticky="nsw") + if for_var_current_value is not None: + setting_box_label = CTkLabel( + setting_box_labels_frame, + textvariable=for_var_current_value, + anchor="w", + height=0, + font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.SB__LABEL_FONT_SIZE, weight="normal"), + text_color=self.settings.ctm.LABELS_TEXT_COLOR + ) + setting_box_label.grid(row=1, column=2, padx=0, pady=0, sticky="nsw") @@ -140,4 +140,46 @@ class _CreateQuickSettingBox(): slider_bind__ButtonRelease() slider_widget.bind("", adjusted_slider_bind__ButtonRelease, "+") + return setting_box_frame + + + + + + + + def createSettingBoxSwitch( + self, + for_var_label_text, + switch_attr_name, + variable, + command, + for_var_current_value=None, + ): + + (setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(for_var_label_text, for_var_current_value) + + switch_widget = CTkSwitch( + setting_box_item_frame, + text=None, + height=0, + width=0, + corner_radius=int(self.settings.uism.SB__SWITCH_BOX_HEIGHT/2), + border_width=0, + switch_height=self.settings.uism.SB__SWITCH_BOX_HEIGHT, + switch_width=self.settings.uism.SB__SWITCH_BOX_WIDTH, + onvalue=True, + offvalue=False, + variable=variable, + command=command, + fg_color=self.settings.ctm.SB__SWITCH_BOX_BG_COLOR, + progress_color=self.settings.ctm.SB__SWITCH_BOX_ACTIVE_BG_COLOR, + button_color=self.settings.ctm.SB__SWITCH_BOX_BUTTON_COLOR, + button_hover_color=self.settings.ctm.SB__SWITCH_BOX_BUTTON_HOVERED_COLOR, + ) + setattr(self.vrct_gui, switch_attr_name, switch_widget) + + + switch_widget.grid(row=1, column=1, sticky="w") + return setting_box_frame \ No newline at end of file diff --git a/vrct_gui/ui_managers/Themes/_darkTheme.py b/vrct_gui/ui_managers/Themes/_darkTheme.py index 7cfe6890..c90a8e5f 100644 --- a/vrct_gui/ui_managers/Themes/_darkTheme.py +++ b/vrct_gui/ui_managers/Themes/_darkTheme.py @@ -110,6 +110,7 @@ def _darkTheme(base_color): TOP_BAR_BUTTON_BG_COLOR = base_color.DARK_888_COLOR, TOP_BAR_BUTTON_HOVERED_BG_COLOR = base_color.DARK_850_COLOR, TOP_BAR_BUTTON_CLICKED_BG_COLOR = base_color.DARK_900_COLOR, + TOP_BAR_BUTTON_TEXT_COLOR = base_color.DARK_BASIC_TEXT_COLOR, UPDATE_AVAILABLE_BUTTON_BG_COLOR = base_color.DARK_888_COLOR, UPDATE_AVAILABLE_BUTTON_HOVERED_BG_COLOR = base_color.DARK_850_COLOR, diff --git a/vrct_gui/ui_managers/Themes/_lightTheme.py b/vrct_gui/ui_managers/Themes/_lightTheme.py index fbaf1201..503be63a 100644 --- a/vrct_gui/ui_managers/Themes/_lightTheme.py +++ b/vrct_gui/ui_managers/Themes/_lightTheme.py @@ -110,6 +110,7 @@ def _lightTheme(base_color): TOP_BAR_BUTTON_BG_COLOR = base_color.LIGHT_175_COLOR, TOP_BAR_BUTTON_HOVERED_BG_COLOR = base_color.LIGHT_300_COLOR, TOP_BAR_BUTTON_CLICKED_BG_COLOR = base_color.LIGHT_350_COLOR, + TOP_BAR_BUTTON_TEXT_COLOR = base_color.LIGHT_BASIC_TEXT_COLOR, UPDATE_AVAILABLE_BUTTON_TEXT_COLOR = base_color.PRIMARY_400_COLOR, ), From a43f089adb2aa48fbec19fd170572a8f9cb28450 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Sat, 27 Apr 2024 00:46:41 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[Update]=20Overlay=20Settings:=20=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E5=80=A4=E3=81=AB=E6=88=BB=E3=81=99=E3=83=9C=E3=82=BF?= =?UTF-8?q?=E3=83=B3=E3=81=A8=E6=A9=9F=E8=83=BD=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=80=82=20y=5Fpos=E3=81=AE=E8=A8=AD=E5=AE=9A=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=AF=84=E5=9B=B2=E3=82=92=E5=A2=97=E3=82=84=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82=20padding=E8=AA=BF=E6=95=B4=E3=81=AA?= =?UTF-8?q?=E3=81=A9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en.yml | 4 ++ locales/ja.yml | 4 ++ view.py | 69 +++++++++++++++++-- .../main_window/createMainWindowWidgets.py | 4 +- .../QuickSettingsWindow.py | 54 +++++++++++++-- .../_CreateQuickSettingBox.py | 6 +- vrct_gui/ui_managers/UiScalingManager.py | 10 +++ 7 files changed, 137 insertions(+), 14 deletions(-) diff --git a/locales/en.yml b/locales/en.yml index 9718045e..cdb3434f 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -66,6 +66,10 @@ selectable_language_window: go_back_button: Go Back +overlay_settings: + restore_default_settings: Restore Default Settings + + config_window: config_title: Settings compact_mode: Compact Mode diff --git a/locales/ja.yml b/locales/ja.yml index e89bfdba..e2dd5db9 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -65,6 +65,10 @@ selectable_language_window: go_back_button: 戻る +overlay_settings: + restore_default_settings: 初期値に戻す + + config_window: config_title: 設定 compact_mode: コンパクトモード diff --git a/view.py b/view.py index f7a4af37..874bab47 100644 --- a/view.py +++ b/view.py @@ -140,8 +140,10 @@ class View(): # Overlay Settings - VAR_VR_SETTINGS=StringVar(value="Overlay Settings"), - CALLBACK_SET_CALLBACK_OPEN_VR_SETTINGS_WINDOW=self._openVrSettingsWindow, + VAR_OVERLAY_SETTINGS=StringVar(value="Overlay Settings"), + CALLBACK_SET_OPEN_OVERLAY_SETTINGS_WINDOW=self._openVrSettingsWindow, + VAR_TO_DEFAULT_OVERLAY_SETTINGS=StringVar(value=i18n.t("overlay_settings.restore_default_settings")), + CALLBACK_SET_TO_DEFAULT_OVERLAY_SETTINGS=self._toDefaultOverlaySettings, VAR_LABEL_OVERLAY_OPACITY=StringVar(value="Opacity"), @@ -167,8 +169,8 @@ class View(): VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_X_POS=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]), VAR_LABEL_OVERLAY_SMALL_LOG_Y_POS=StringVar(value="Y_position"), - SLIDER_RANGE_OVERLAY_SMALL_LOG_Y_POS=(-0.5, 0.5), - NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_Y_POS=100, + SLIDER_RANGE_OVERLAY_SMALL_LOG_Y_POS=(-0.8, 0.8), + NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_Y_POS=160, VAR_OVERLAY_SMALL_LOG_Y_POS=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]), VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_Y_POS=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]), @@ -1110,6 +1112,34 @@ class View(): DICT_DATA["large-v3"]: callI18n("large-v3", "2.87GB"), } + + def _toDefaultOverlaySettings(self): + INIT_OVERLAY_SETTINGS = { + "opacity": 1.0, + "ui_scaling": 1.0, + } + INIT_OVERLAY_SMALL_LOG_SETTINGS = { + "x_pos": 0.0, + "y_pos": -0.41, + "depth": 1.0, + "display_duration": 5, + "fadeout_duration": 2, + } + for key in INIT_OVERLAY_SETTINGS.keys(): + callFunctionIfCallable(self.view_variable.CALLBACK_SET_OVERLAY_SETTINGS, INIT_OVERLAY_SETTINGS[key], key) + + for key in INIT_OVERLAY_SMALL_LOG_SETTINGS.keys(): + callFunctionIfCallable(self.view_variable.CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS, INIT_OVERLAY_SMALL_LOG_SETTINGS[key], key) + + self.setLatestConfigVariable("OverlayOpacity") + self.setLatestConfigVariable("OverlayUiScaling") + + self.setLatestConfigVariable("OverlaySmallLogXPos") + self.setLatestConfigVariable("OverlaySmallLogYPos") + self.setLatestConfigVariable("OverlaySmallLogDepth") + self.setLatestConfigVariable("OverlaySmallLogDisplayDuration") + self.setLatestConfigVariable("OverlaySmallLogFadeoutDuration") + # Open Webpage Functions def openWebPage_Booth(self): self.openWebPage(config.BOOTH_URL) @@ -1827,6 +1857,37 @@ class View(): case "ReceivedMessageFormatWithT": self.setReceivedMessageFormatWithT_EntryWidgets(config.RECEIVED_MESSAGE_FORMAT_WITH_T) + + + case "OverlayOpacity": + self.view_variable.VAR_OVERLAY_OPACITY.set(config.OVERLAY_SETTINGS["opacity"]) + self.view_variable.VAR_CURRENT_VALUE_OVERLAY_OPACITY.set(floatToPctStr(config.OVERLAY_SETTINGS["opacity"])) + + case "OverlayUiScaling": + self.view_variable.VAR_OVERLAY_UI_SCALING.set(config.OVERLAY_SETTINGS["ui_scaling"]) + self.view_variable.VAR_CURRENT_VALUE_OVERLAY_UI_SCALING.set(floatToPctStr(config.OVERLAY_SETTINGS["ui_scaling"])) + + + case "OverlaySmallLogXPos": + self.view_variable.VAR_OVERLAY_SMALL_LOG_X_POS.set(config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]) + self.view_variable.VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_X_POS.set(config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]) + + case "OverlaySmallLogYPos": + self.view_variable.VAR_OVERLAY_SMALL_LOG_Y_POS.set(config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]) + self.view_variable.VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_Y_POS.set(config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]) + + case "OverlaySmallLogDepth": + self.view_variable.VAR_OVERLAY_SMALL_LOG_DEPTH.set(config.OVERLAY_SMALL_LOG_SETTINGS["depth"]) + self.view_variable.VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_DEPTH.set(config.OVERLAY_SMALL_LOG_SETTINGS["depth"]) + + case "OverlaySmallLogDisplayDuration": + self.view_variable.VAR_OVERLAY_SMALL_LOG_DISPLAY_DURATION.set(config.OVERLAY_SMALL_LOG_SETTINGS["display_duration"]) + self.view_variable.VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_DISPLAY_DURATION.set(f"{config.OVERLAY_SMALL_LOG_SETTINGS['display_duration']} second(s)") + + case "OverlaySmallLogFadeoutDuration": + self.view_variable.VAR_OVERLAY_SMALL_LOG_FADEOUT_DURATION.set(config.OVERLAY_SMALL_LOG_SETTINGS["fadeout_duration"]) + self.view_variable.VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_FADEOUT_DURATION.set(f"{config.OVERLAY_SMALL_LOG_SETTINGS['fadeout_duration']} second(s)") + case _: raise ValueError(f"No matching case for target_name: {target_name}") diff --git a/vrct_gui/main_window/createMainWindowWidgets.py b/vrct_gui/main_window/createMainWindowWidgets.py index 110e9cd1..447dfb1d 100644 --- a/vrct_gui/main_window/createMainWindowWidgets.py +++ b/vrct_gui/main_window/createMainWindowWidgets.py @@ -73,7 +73,7 @@ def createMainWindowWidgets(vrct_gui, settings, view_variable): vrct_gui.overlay_settings_label = CTkLabel( vrct_gui.overlay_settings_container, - textvariable=view_variable.VAR_VR_SETTINGS, + textvariable=view_variable.VAR_OVERLAY_SETTINGS, height=0, corner_radius=0, font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.UPDATE_AVAILABLE_BUTTON_FONT_SIZE, weight="normal"), @@ -94,7 +94,7 @@ def createMainWindowWidgets(vrct_gui, settings, view_variable): enter_color=settings.ctm.TOP_BAR_BUTTON_HOVERED_BG_COLOR, leave_color=settings.ctm.TOP_BAR_BUTTON_BG_COLOR, clicked_color=settings.ctm.TOP_BAR_BUTTON_CLICKED_BG_COLOR, - buttonReleasedFunction=lambda e: callFunctionIfCallable(view_variable.CALLBACK_SET_CALLBACK_OPEN_VR_SETTINGS_WINDOW), + buttonReleasedFunction=lambda e: callFunctionIfCallable(view_variable.CALLBACK_SET_OPEN_OVERLAY_SETTINGS_WINDOW), ) diff --git a/vrct_gui/quick_settings_window/QuickSettingsWindow.py b/vrct_gui/quick_settings_window/QuickSettingsWindow.py index 08d7ff6b..8ea84cbb 100644 --- a/vrct_gui/quick_settings_window/QuickSettingsWindow.py +++ b/vrct_gui/quick_settings_window/QuickSettingsWindow.py @@ -1,7 +1,7 @@ from utils import callFunctionIfCallable, floatToPctStr from customtkinter import CTkImage, CTkLabel, CTkToplevel, CTkProgressBar, CTkFrame, CTkSlider -from ..ui_utils import getImagePath, setGeometryToCenterOfScreen, fadeInAnimation +from ..ui_utils import getImagePath, setGeometryToCenterOfScreen, fadeInAnimation, createLabelButton from ._CreateQuickSettingBox import _CreateQuickSettingBox @@ -9,7 +9,6 @@ class QuickSettingsWindow(CTkToplevel): def __init__(self, vrct_gui, settings, view_variable): super().__init__() self.withdraw() - self.configure(fg_color="#292a2d") self.title("Overlay Settings") self.protocol("WM_DELETE_WINDOW", self.withdraw) self.after(200, lambda: self.iconbitmap(getImagePath("vrct_logo_mark_black.ico"))) @@ -17,17 +16,22 @@ class QuickSettingsWindow(CTkToplevel): self.settings = settings + self.configure(fg_color=self.settings.ctm.SB__BG_COLOR) BG_HEX_COLOR = "#292a2d" self.grid_columnconfigure(0, weight=1, minsize=400) self.grid_rowconfigure(0, weight=1) - self.qsw_background = CTkFrame(self, corner_radius=0, fg_color=BG_HEX_COLOR) - self.qsw_background.grid(sticky="nsew") + self.qsw_background = CTkFrame(self, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR) + self.qsw_background.grid(row=0, column=0, pady=(0,18), sticky="nsew") self.qsw_background.grid_columnconfigure(0, weight=1) + self.qsw_setting_box = CTkFrame(self.qsw_background, corner_radius=0, fg_color=BG_HEX_COLOR) + self.qsw_setting_box.grid(row=0, column=0, sticky="nsew") + self.qsw_setting_box.grid_columnconfigure(0, weight=1) - cqsb = _CreateQuickSettingBox(self.qsw_background, vrct_gui, settings, view_variable) + + cqsb = _CreateQuickSettingBox(self.qsw_setting_box, vrct_gui, settings, view_variable) createSettingBoxSlider = cqsb.createSettingBoxSlider createSettingBoxSwitch = cqsb.createSettingBoxSwitch @@ -197,6 +201,46 @@ class QuickSettingsWindow(CTkToplevel): + + + + self.qsw_setting_box_bottom = CTkFrame(self.qsw_background, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR) + self.qsw_setting_box_bottom.grid(row=1, column=0, sticky="nsew") + + self.qsw_setting_box_bottom.grid_columnconfigure((0,2), weight=1) + self.qsw_setting_box_bottom.grid_rowconfigure((0,2), weight=1) + + self.qsw_setting_box_bottom_restore_default_button = CTkFrame(self.qsw_setting_box_bottom, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR) + self.qsw_setting_box_bottom_restore_default_button.grid(row=1, column=1, sticky="nsew") + + + def toDefaultOverlaySettingsCallback(_e): + callFunctionIfCallable(view_variable.CALLBACK_SET_TO_DEFAULT_OVERLAY_SETTINGS) + + + + (restore_default_settings_button, label_button_label_widget) = createLabelButton( + parent_widget=self.qsw_setting_box_bottom_restore_default_button, + label_button_bg_color=self.settings.ctm.SB__BUTTON_COLOR, + label_button_hovered_bg_color=self.settings.ctm.SB__BUTTON_HOVERED_COLOR, + label_button_clicked_bg_color=self.settings.ctm.SB__BUTTON_CLICKED_COLOR, + label_button_ipadx=self.settings.uism.SB__AUTHKEY_WEBPAGE_BUTTON_IPADX, + label_button_ipady=self.settings.uism.SB__AUTHKEY_WEBPAGE_BUTTON_IPADY, + variable=view_variable.VAR_TO_DEFAULT_OVERLAY_SETTINGS, + font_family=self.settings.FONT_FAMILY, + font_size=self.settings.uism.SB__AUTHKEY_WEBPAGE_BUTTON_LABEL_FONT_SIZE, + text_color=self.settings.ctm.LABELS_TEXT_COLOR, + label_button_clicked_command=toDefaultOverlaySettingsCallback, + + label_button_position="center", + + # image_file=image_file, + image_size=self.settings.uism.SB__AUTHKEY_WEBPAGE_BUTTON_IMG_SIZE, + label_button_padx_between_img=self.settings.uism.SB__AUTHKEY_WEBPAGE_PADX_BETWEEN_LABEL_AND_ICON, + ) + restore_default_settings_button.grid(row=0, column=0, pady=self.settings.uism.QSB__RESTORE_DEFAULT_SETTINGS_BUTTON_PADY) + + def show(self): self.attributes("-alpha", 0) self.deiconify() diff --git a/vrct_gui/quick_settings_window/_CreateQuickSettingBox.py b/vrct_gui/quick_settings_window/_CreateQuickSettingBox.py index 2a4ec2d1..e2bbe271 100644 --- a/vrct_gui/quick_settings_window/_CreateQuickSettingBox.py +++ b/vrct_gui/quick_settings_window/_CreateQuickSettingBox.py @@ -23,18 +23,18 @@ class _CreateQuickSettingBox(): def _createSettingBoxFrame(self, for_var_label_text=None, for_var_current_value=None): setting_box_frame = CTkFrame(self.parent_frame, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR, width=0, height=0) - setting_box_frame.grid(row=0, column=0, sticky="ew") + setting_box_frame.grid(row=0, column=0, pady=(0,1), sticky="ew") setting_box_frame.grid_columnconfigure(0, weight=1) setting_box_frame_wrapper = CTkFrame(setting_box_frame, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR, width=0, height=0) - setting_box_frame_wrapper.grid(row=0, column=0, padx=self.settings.uism.SB__IPADX, pady=self.settings.uism.SB__IPADY, sticky="nsew") + setting_box_frame_wrapper.grid(row=0, column=0, padx=self.settings.uism.QSB__IPADX, pady=self.settings.uism.QSB__IPADY, sticky="nsew") setting_box_frame_wrapper.grid_columnconfigure(0, weight=1) # Labels setting_box_labels_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR, width=0, height=0) - setting_box_labels_frame.grid(row=0, column=0, padx=0, pady=0, sticky="nsew") + setting_box_labels_frame.grid(row=0, column=0, padx=0, pady=(0,self.settings.uism.QSB__LABEL_BOTTOM_PADY), sticky="nsew") setting_box_labels_frame.grid_rowconfigure((0,2), weight=1) setting_box_labels_frame.grid_columnconfigure(1, weight=1) diff --git a/vrct_gui/ui_managers/UiScalingManager.py b/vrct_gui/ui_managers/UiScalingManager.py index 55ad0c43..ad868054 100644 --- a/vrct_gui/ui_managers/UiScalingManager.py +++ b/vrct_gui/ui_managers/UiScalingManager.py @@ -192,6 +192,16 @@ class UiScalingManager(): # Dropdown Menu Window self.dropdown_menu_window.MARGIN_WIDTH = self._calculateUiSize(16) + + + # Quick Settings Box + self.config_window.QSB__IPADX = self._calculateUiSize(20) + self.config_window.QSB__IPADY = (self._calculateUiSize(12), self._calculateUiSize(8)) + self.config_window.QSB__LABEL_BOTTOM_PADY = self._calculateUiSize(6) + self.config_window.QSB__RESTORE_DEFAULT_SETTINGS_BUTTON_PADY = (self._calculateUiSize(40),0) + + + # Config Window self.config_window.DEFAULT_WIDTH = self._calculateUiSize(1080) self.config_window.DEFAULT_HEIGHT = self._calculateUiSize(680) From fc5ba74a836cfe14e067b96f91bd7f46344fb35c Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Sat, 27 Apr 2024 01:12:49 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[Update]=20Overlay=20Settings:=20=E4=B8=80?= =?UTF-8?q?=E9=83=A8=E6=97=A5=E6=9C=AC=E8=AA=9E=E5=AF=BE=E5=BF=9C=E3=80=82?= =?UTF-8?q?=20=E3=81=9D=E3=82=8C=E3=81=9E=E3=82=8C=E3=81=AE=E9=A0=85?= =?UTF-8?q?=E7=9B=AE=E3=81=8C=E5=BA=83=E3=81=99=E3=81=8E=E3=81=A8=E6=84=9F?= =?UTF-8?q?=E3=81=98=E3=81=9F=E3=81=AE=E3=81=A7=E5=B0=91=E3=81=97=E7=8B=AD?= =?UTF-8?q?=E3=81=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en.yml | 9 ++++++++- locales/ja.yml | 11 +++++++++++ view.py | 14 +++++++------- vrct_gui/ui_managers/UiScalingManager.py | 2 +- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/locales/en.yml b/locales/en.yml index cdb3434f..bb7f2dcf 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -68,6 +68,13 @@ selectable_language_window: overlay_settings: restore_default_settings: Restore Default Settings + opacity: Opacity + ui_scaling: UI Scaling + x_position: X-axis (left-right) + y_position: Y-axis (up-down) + depth: Z-axis (front-back) + display_duration: Display duration + fadeout_duration: Fadeout duration config_window: @@ -212,7 +219,7 @@ config_window: enable_overlay_small_log: - label: OpenVR + label: Enable Overlay # desc: auto_clear_the_message_box: diff --git a/locales/ja.yml b/locales/ja.yml index e2dd5db9..b819b174 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -67,6 +67,13 @@ selectable_language_window: overlay_settings: restore_default_settings: 初期値に戻す + opacity: 透明度 + ui_scaling: サイズ + x_position: X軸(左右) + y_position: Y軸(上下) + depth: Z軸(前後) + display_duration: 表示時間 + fadeout_duration: フェードアウト時間 config_window: @@ -208,6 +215,10 @@ config_window: recommended_model_template: "%{model_name} モデル (%{capacity}) (推奨)" + enable_overlay_small_log: + label: Overlay機能を有効 + + auto_clear_the_message_box: label: 送信後はチャットボックスを空にする diff --git a/view.py b/view.py index 874bab47..6582c5fb 100644 --- a/view.py +++ b/view.py @@ -146,13 +146,13 @@ class View(): CALLBACK_SET_TO_DEFAULT_OVERLAY_SETTINGS=self._toDefaultOverlaySettings, - VAR_LABEL_OVERLAY_OPACITY=StringVar(value="Opacity"), + VAR_LABEL_OVERLAY_OPACITY=StringVar(value=i18n.t("overlay_settings.opacity")), SLIDER_RANGE_OVERLAY_OPACITY=(0.1, 1.0), NUMBER_OF_STEPS_OVERLAY_OPACITY=18, VAR_OVERLAY_OPACITY=DoubleVar(value=config.OVERLAY_SETTINGS["opacity"]), VAR_CURRENT_VALUE_OVERLAY_OPACITY=StringVar(value=floatToPctStr(config.OVERLAY_SETTINGS["opacity"])), - VAR_LABEL_OVERLAY_UI_SCALING=StringVar(value="Ui Scaling"), + VAR_LABEL_OVERLAY_UI_SCALING=StringVar(value=i18n.t("overlay_settings.ui_scaling")), SLIDER_RANGE_OVERLAY_UI_SCALING=(0.4, 2.0), NUMBER_OF_STEPS_OVERLAY_UI_SCALING=16, VAR_OVERLAY_UI_SCALING=DoubleVar(value=config.OVERLAY_SETTINGS["ui_scaling"]), @@ -162,31 +162,31 @@ class View(): CALLBACK_SET_OVERLAY_SMALL_LOG_SETTINGS=None, - VAR_LABEL_OVERLAY_SMALL_LOG_X_POS=StringVar(value="X_position"), + VAR_LABEL_OVERLAY_SMALL_LOG_X_POS=StringVar(value=i18n.t("overlay_settings.x_position")), SLIDER_RANGE_OVERLAY_SMALL_LOG_X_POS=(-0.5, 0.5), NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_X_POS=100, VAR_OVERLAY_SMALL_LOG_X_POS=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]), VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_X_POS=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["x_pos"]), - VAR_LABEL_OVERLAY_SMALL_LOG_Y_POS=StringVar(value="Y_position"), + VAR_LABEL_OVERLAY_SMALL_LOG_Y_POS=StringVar(value=i18n.t("overlay_settings.y_position")), SLIDER_RANGE_OVERLAY_SMALL_LOG_Y_POS=(-0.8, 0.8), NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_Y_POS=160, VAR_OVERLAY_SMALL_LOG_Y_POS=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]), VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_Y_POS=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["y_pos"]), - VAR_LABEL_OVERLAY_SMALL_LOG_DEPTH=StringVar(value="Depth"), + VAR_LABEL_OVERLAY_SMALL_LOG_DEPTH=StringVar(value=i18n.t("overlay_settings.depth")), SLIDER_RANGE_OVERLAY_SMALL_LOG_DEPTH=(0.5, 1.5), NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_DEPTH=100, VAR_OVERLAY_SMALL_LOG_DEPTH=DoubleVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["depth"]), VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_DEPTH=StringVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["depth"]), - VAR_LABEL_OVERLAY_SMALL_LOG_DISPLAY_DURATION=StringVar(value="Display Duration"), + VAR_LABEL_OVERLAY_SMALL_LOG_DISPLAY_DURATION=StringVar(value=i18n.t("overlay_settings.display_duration")), SLIDER_RANGE_OVERLAY_SMALL_LOG_DISPLAY_DURATION=(1, 60), NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_DISPLAY_DURATION=59, VAR_OVERLAY_SMALL_LOG_DISPLAY_DURATION=IntVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["display_duration"]), VAR_CURRENT_VALUE_OVERLAY_SMALL_LOG_DISPLAY_DURATION=StringVar(value=f"{config.OVERLAY_SMALL_LOG_SETTINGS['display_duration']} second(s)"), - VAR_LABEL_OVERLAY_SMALL_LOG_FADEOUT_DURATION=StringVar(value="Fadeout Duration"), + VAR_LABEL_OVERLAY_SMALL_LOG_FADEOUT_DURATION=StringVar(value=i18n.t("overlay_settings.fadeout_duration")), SLIDER_RANGE_OVERLAY_SMALL_LOG_FADEOUT_DURATION=(0, 5), NUMBER_OF_STEPS_OVERLAY_SMALL_LOG_FADEOUT_DURATION=5, VAR_OVERLAY_SMALL_LOG_FADEOUT_DURATION=IntVar(value=config.OVERLAY_SMALL_LOG_SETTINGS["fadeout_duration"]), diff --git a/vrct_gui/ui_managers/UiScalingManager.py b/vrct_gui/ui_managers/UiScalingManager.py index ad868054..9b72d76e 100644 --- a/vrct_gui/ui_managers/UiScalingManager.py +++ b/vrct_gui/ui_managers/UiScalingManager.py @@ -196,7 +196,7 @@ class UiScalingManager(): # Quick Settings Box self.config_window.QSB__IPADX = self._calculateUiSize(20) - self.config_window.QSB__IPADY = (self._calculateUiSize(12), self._calculateUiSize(8)) + self.config_window.QSB__IPADY = (self._calculateUiSize(14), self._calculateUiSize(8)) self.config_window.QSB__LABEL_BOTTOM_PADY = self._calculateUiSize(6) self.config_window.QSB__RESTORE_DEFAULT_SETTINGS_BUTTON_PADY = (self._calculateUiSize(40),0) From 10f498daf29779e0484d04f729adcbd0eb765aaa Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Sat, 27 Apr 2024 01:52:42 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[Update/bugfix]=20Config=20Window:=20VR=20T?= =?UTF-8?q?ab.=20Overlay=E8=A9=B3=E7=B4=B0=E8=A8=AD=E5=AE=9A=E3=81=A8?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=80=81=E3=83=A1=E3=82=A4=E3=83=B3=E7=94=BB?= =?UTF-8?q?=E9=9D=A2=E3=81=8B=E3=82=89=E9=96=8B=E3=81=91=E3=82=8BOverlay?= =?UTF-8?q?=20Settings=20Window=E3=82=92=E9=96=8B=E3=81=8F=E3=83=9C?= =?UTF-8?q?=E3=82=BF=E3=83=B3=E3=82=92=E8=BF=BD=E5=8A=A0=E3=80=82=20XSOver?= =?UTF-8?q?lay=E9=A0=85=E7=9B=AE=E3=82=92VR=20Tab=E3=81=AB=E7=A7=BB?= =?UTF-8?q?=E5=8B=95=E3=80=82=E3=81=9D=E3=82=8C=E3=81=AB=E3=81=A8=E3=82=82?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=80=8CVR=E9=99=90=E5=AE=9A=E3=80=8D?= =?UTF-8?q?=E3=81=AE=E6=96=87=E5=AD=97=E3=82=92=E5=89=8A=E9=99=A4=20Overla?= =?UTF-8?q?y=20Settings=E3=80=81=E5=88=9D=E6=9C=9F=E5=80=A4=E3=81=AB?= =?UTF-8?q?=E6=88=BB=E3=81=99=E3=83=9C=E3=82=BF=E3=83=B3=E5=8F=B3=E5=81=B4?= =?UTF-8?q?=E3=81=AE=E4=BD=99=E8=A8=88=E3=81=AA=E4=BD=99=E7=99=BD=E3=82=92?= =?UTF-8?q?=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en.yml | 3 +- locales/ja.yml | 5 +- locales/ko.yml | 2 +- view.py | 1 + .../_SettingBoxGenerator.py | 66 +++++++++++++++++++ .../createSettingBox_Others.py | 13 ---- .../setting_box_vr/createSettingBox_Vr.py | 31 ++++++++- .../QuickSettingsWindow.py | 4 -- vrct_gui/ui_managers/UiScalingManager.py | 2 + 9 files changed, 104 insertions(+), 23 deletions(-) diff --git a/locales/en.yml b/locales/en.yml index bb7f2dcf..2951af23 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -221,6 +221,7 @@ config_window: enable_overlay_small_log: label: Enable Overlay # desc: + open_overlay_settings: Open Overlay Customized Settings auto_clear_the_message_box: label: Auto Clear The Message Box @@ -235,7 +236,7 @@ config_window: show_and_disable_enter_key: Show and disable to send when pressed enter key notice_xsoverlay: - label: Notification XSOverlay (VR Only) + label: Notification XSOverlay desc: Notify received messages by using XSOverlay's notification feature. auto_export_message_logs: diff --git a/locales/ja.yml b/locales/ja.yml index b819b174..bd550712 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -217,6 +217,9 @@ config_window: enable_overlay_small_log: label: Overlay機能を有効 + # desc: + open_overlay_settings: Overlay詳細設定を開く + auto_clear_the_message_box: @@ -232,7 +235,7 @@ config_window: show_and_disable_enter_key: 表示し、エンターキーでの送信を無効 notice_xsoverlay: - label: XSOverlayでの通知受け取り機能を有効 (VR限定) + label: XSOverlayでの通知受け取り機能を有効 desc: 文字起こし (受信) されたメッセージをXSOverlayの機能を使って通知として受け取れます。 auto_export_message_logs: diff --git a/locales/ko.yml b/locales/ko.yml index 06cfcb65..ed8f8ddf 100644 --- a/locales/ko.yml +++ b/locales/ko.yml @@ -217,7 +217,7 @@ config_window: show_and_disable_enter_key: 표시 (Enter 키 전송 비활성화) notice_xsoverlay: - label: XSOverlay에서 알림 수신 기능 활성화 (VR 전용) + label: XSOverlay에서 알림 수신 기능 활성화 desc: 수신된 메시지를 XSOverlay의 기능을 통해 알림으로 받아볼 수 있습니다. auto_export_message_logs: diff --git a/view.py b/view.py index 6582c5fb..db7f58f8 100644 --- a/view.py +++ b/view.py @@ -484,6 +484,7 @@ class View(): # VAR_DESC_ENABLE_OVERLAY_SMALL_LOG=StringVar(value=i18n.t("config_window.enable_overlay_small_log.desc")), CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG=None, VAR_ENABLE_OVERLAY_SMALL_LOG=BooleanVar(value=config.ENABLE_OVERLAY_SMALL_LOG), + VAR_OPEN_OVERLAY_SETTINGS_BUTTON=StringVar(value=i18n.t("config_window.enable_overlay_small_log.open_overlay_settings")), # Others Tab 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 60386162..751211fc 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 @@ -998,6 +998,72 @@ class _SettingBoxGenerator(): + def createSettingBox_Overlay(self, + for_var_label_text, for_var_desc_text, + switch_attr_name, + variable, + command, + for_var_button_label, + label_button_clicked_command, + ): + + (setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(switch_attr_name, for_var_label_text, for_var_desc_text) + + + all_wrapper = CTkFrame(setting_box_item_frame, corner_radius=0, fg_color=self.settings.ctm.SB__BG_COLOR, width=0, height=0) + all_wrapper.grid(row=1, column=0, sticky="ew") + + all_wrapper.grid_columnconfigure(1, weight=1) + + + + + switch_widget = CTkSwitch( + all_wrapper, + text=None, + height=0, + width=0, + corner_radius=int(self.settings.uism.SB__SWITCH_BOX_HEIGHT/2), + border_width=0, + switch_height=self.settings.uism.SB__SWITCH_BOX_HEIGHT, + switch_width=self.settings.uism.SB__SWITCH_BOX_WIDTH, + onvalue=True, + offvalue=False, + variable=variable, + command=command, + fg_color=self.settings.ctm.SB__SWITCH_BOX_BG_COLOR, + progress_color=self.settings.ctm.SB__SWITCH_BOX_ACTIVE_BG_COLOR, + button_color=self.settings.ctm.SB__SWITCH_BOX_BUTTON_COLOR, + button_hover_color=self.settings.ctm.SB__SWITCH_BOX_BUTTON_HOVERED_COLOR, + ) + setattr(self.config_window, switch_attr_name, switch_widget) + + self.config_window.sb__widgets[switch_attr_name].switch_box = switch_widget + + switch_widget.grid(row=0, pady=20, column=SETTING_BOX_COLUMN) + + + (open_page_button, label_button_label_widget) = createLabelButton( + parent_widget=all_wrapper, + label_button_bg_color=self.settings.ctm.SB__BUTTON_COLOR, + label_button_hovered_bg_color=self.settings.ctm.SB__BUTTON_HOVERED_COLOR, + label_button_clicked_bg_color=self.settings.ctm.SB__BUTTON_CLICKED_COLOR, + label_button_ipadx=self.settings.uism.SB__AUTHKEY_WEBPAGE_BUTTON_IPADX, + label_button_ipady=self.settings.uism.SB__AUTHKEY_WEBPAGE_BUTTON_IPADY, + variable=for_var_button_label, + font_family=self.settings.FONT_FAMILY, + font_size=self.settings.uism.SB__AUTHKEY_WEBPAGE_BUTTON_LABEL_FONT_SIZE, + text_color=self.settings.ctm.LABELS_TEXT_COLOR, + label_button_clicked_command=label_button_clicked_command, + + label_button_position="center", + ) + open_page_button.grid(row=1, column=SETTING_BOX_COLUMN, pady=(self.settings.uism.SB__OPEN_OVERLAY_SETTINGS_WINDOW,0)) + + + return setting_box_frame + + def createSettingBoxButtonWithImage( self, for_var_label_text, for_var_desc_text, diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py index b32116fe..8f3f9bf3 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_others/createSettingBox_Others.py @@ -18,9 +18,6 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v def checkboxSendMessageButtonTypeCallback(): callFunctionIfCallable(view_variable.CALLBACK_SET_SEND_MESSAGE_BUTTON_TYPE, view_variable.VAR_SEND_MESSAGE_BUTTON_TYPE.get()) - def checkboxNoticeXsoverlayCallback(checkbox_box_widget): - callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, checkbox_box_widget.get()) - def checkboxAutoExportMessageLogsCallback(checkbox_box_widget): callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_AUTO_EXPORT_MESSAGE_LOGS, checkbox_box_widget.get()) @@ -63,16 +60,6 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v config_window.sb__send_message_button_type.grid(row=row) row+=1 - config_window.sb__notice_xsoverlay = createSettingBoxCheckbox( - for_var_label_text=view_variable.VAR_LABEL_ENABLE_NOTICE_XSOVERLAY, - for_var_desc_text=view_variable.VAR_DESC_ENABLE_NOTICE_XSOVERLAY, - checkbox_attr_name="sb__checkbox_notice_xsoverlay", - command=lambda: checkboxNoticeXsoverlayCallback(config_window.sb__checkbox_notice_xsoverlay), - variable=view_variable.VAR_ENABLE_NOTICE_XSOVERLAY, - ) - config_window.sb__notice_xsoverlay.grid(row=row) - row+=1 - config_window.sb__auto_export_message_logs = createSettingBoxAutoExportMessageLogs( for_var_label_text=view_variable.VAR_LABEL_ENABLE_AUTO_EXPORT_MESSAGE_LOGS, diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_vr/createSettingBox_Vr.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_vr/createSettingBox_Vr.py index 9ecf6f93..0f73595d 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_vr/createSettingBox_Vr.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_vr/createSettingBox_Vr.py @@ -4,18 +4,43 @@ from .._SettingBoxGenerator import _SettingBoxGenerator def createSettingBox_Vr(setting_box_wrapper, config_window, settings, view_variable): sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable) - createSettingBoxSwitch = sbg.createSettingBoxSwitch + createSettingBox_Overlay = sbg.createSettingBox_Overlay + createSettingBoxCheckbox = sbg.createSettingBoxCheckbox def switchEnableOverlayUiCallback(switch_widget): callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_OVERLAY_SMALL_LOG, switch_widget.get()) + def buttonOpenOverlaySettingsWindow(_e): + print(_e) + callFunctionIfCallable(view_variable.CALLBACK_SET_OPEN_OVERLAY_SETTINGS_WINDOW) + + + def checkboxNoticeXsoverlayCallback(checkbox_box_widget): + callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_NOTICE_XSOVERLAY, checkbox_box_widget.get()) + + row=0 - config_window.sb__enable_overlay_small_log = createSettingBoxSwitch( + config_window.sb__enable_overlay_small_log = createSettingBox_Overlay( for_var_label_text=view_variable.VAR_LABEL_ENABLE_OVERLAY_SMALL_LOG, for_var_desc_text=view_variable.VAR_DESC_ENABLE_OVERLAY_SMALL_LOG, switch_attr_name="sb__switch_enable_overlay_small_log", command=lambda: switchEnableOverlayUiCallback(config_window.sb__switch_enable_overlay_small_log), - variable=view_variable.VAR_ENABLE_OVERLAY_SMALL_LOG + variable=view_variable.VAR_ENABLE_OVERLAY_SMALL_LOG, + for_var_button_label=view_variable.VAR_OPEN_OVERLAY_SETTINGS_BUTTON, + label_button_clicked_command=buttonOpenOverlaySettingsWindow, ) config_window.sb__enable_overlay_small_log.grid(row=row) + row+=1 + + + + + config_window.sb__notice_xsoverlay = createSettingBoxCheckbox( + for_var_label_text=view_variable.VAR_LABEL_ENABLE_NOTICE_XSOVERLAY, + for_var_desc_text=view_variable.VAR_DESC_ENABLE_NOTICE_XSOVERLAY, + checkbox_attr_name="sb__checkbox_notice_xsoverlay", + command=lambda: checkboxNoticeXsoverlayCallback(config_window.sb__checkbox_notice_xsoverlay), + variable=view_variable.VAR_ENABLE_NOTICE_XSOVERLAY, + ) + config_window.sb__notice_xsoverlay.grid(row=row, pady=0) row+=1 \ No newline at end of file diff --git a/vrct_gui/quick_settings_window/QuickSettingsWindow.py b/vrct_gui/quick_settings_window/QuickSettingsWindow.py index 8ea84cbb..0d294b8e 100644 --- a/vrct_gui/quick_settings_window/QuickSettingsWindow.py +++ b/vrct_gui/quick_settings_window/QuickSettingsWindow.py @@ -233,10 +233,6 @@ class QuickSettingsWindow(CTkToplevel): label_button_clicked_command=toDefaultOverlaySettingsCallback, label_button_position="center", - - # image_file=image_file, - image_size=self.settings.uism.SB__AUTHKEY_WEBPAGE_BUTTON_IMG_SIZE, - label_button_padx_between_img=self.settings.uism.SB__AUTHKEY_WEBPAGE_PADX_BETWEEN_LABEL_AND_ICON, ) restore_default_settings_button.grid(row=0, column=0, pady=self.settings.uism.QSB__RESTORE_DEFAULT_SETTINGS_BUTTON_PADY) diff --git a/vrct_gui/ui_managers/UiScalingManager.py b/vrct_gui/ui_managers/UiScalingManager.py index 9b72d76e..b7e5f5e3 100644 --- a/vrct_gui/ui_managers/UiScalingManager.py +++ b/vrct_gui/ui_managers/UiScalingManager.py @@ -371,6 +371,8 @@ class UiScalingManager(): self.config_window.SB__AUTHKEY_WEBPAGE_PADX_BETWEEN_LABEL_AND_ICON = self._calculateUiSize(10) self.config_window.SB__AUTHKEY_WEBPAGE_BUTTON_TOP_PADY = self._calculateUiSize(10) + self.config_window.SB__OPEN_OVERLAY_SETTINGS_WINDOW = self._calculateUiSize(28) + self.config_window.SB__BUTTON_IPADXY = self._calculateUiSize(16) self.config_window.SB__BUTTON_ICON_SIZE = self._calculateUiSize(24)