From 376f5e7b5ac9b37e6667b6973bfc52a24d274623 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 13 Oct 2023 16:56:49 +0900 Subject: [PATCH 1/4] =?UTF-8?q?[Update]=20=E3=82=BD=E3=83=95=E3=83=88?= =?UTF-8?q?=E3=81=AE=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E6=83=85?= =?UTF-8?q?=E5=A0=B1=E3=82=92=E8=A8=AD=E5=AE=9A=E7=94=BB=E9=9D=A2=E3=81=AB?= =?UTF-8?q?=E7=A7=BB=E5=8B=95=E3=80=81UI=20Size=E5=A4=89=E6=9B=B4=E3=80=81?= =?UTF-8?q?=E8=89=B2=E3=81=AE=E5=A4=89=E6=95=B0=E5=8C=96=E3=80=81=E8=A1=A8?= =?UTF-8?q?=E8=A8=98=E3=82=92=E8=8B=B1=E8=AA=9E=E3=81=A8=E6=97=A5=E6=9C=AC?= =?UTF-8?q?=E8=AA=9E=E3=81=AB=E5=AF=BE=E5=BF=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/en.yml | 1 + locales/ja.yml | 1 + view.py | 2 +- vrct_gui/config_window/ConfigWindow.py | 16 +++++++++++++++- vrct_gui/main_window/createMainWindowWidgets.py | 16 ---------------- vrct_gui/ui_managers/ColorThemeManager.py | 1 + vrct_gui/ui_managers/UiScalingManager.py | 1 + 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/locales/en.yml b/locales/en.yml index 88aa52fe..126618bc 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -27,6 +27,7 @@ selectable_language_window: config_window: config_title: Settings compact_mode: Compact Mode + version: version %{version} side_menu_labels: appearance: Appearance translation: Translation diff --git a/locales/ja.yml b/locales/ja.yml index ed424fd0..ef2b2e3d 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -28,6 +28,7 @@ selectable_language_window: config_window: config_title: 設定 compact_mode: コンパクトモード + version: バージョン %{version} side_menu_labels: appearance: デザイン translation: 翻訳 diff --git a/view.py b/view.py index 76d79047..66ec769e 100644 --- a/view.py +++ b/view.py @@ -135,7 +135,7 @@ class View(): ACTIVE_SETTING_BOX_TAB_ATTR_NAME="side_menu_tab_appearance", CALLBACK_SELECTED_SETTING_BOX_TAB=None, VAR_ERROR_MESSAGE=StringVar(value=""), - VAR_VERSION=StringVar(value=config.VERSION), + VAR_VERSION=StringVar(value=i18n.t("config_window.version", version=config.VERSION)), VAR_CONFIG_WINDOW_TITLE=StringVar(value=i18n.t("config_window.config_title")), VAR_CONFIG_WINDOW_COMPACT_MODE_LABEL=StringVar(value=i18n.t("config_window.compact_mode")), diff --git a/vrct_gui/config_window/ConfigWindow.py b/vrct_gui/config_window/ConfigWindow.py index d7be1492..ee88da4b 100644 --- a/vrct_gui/config_window/ConfigWindow.py +++ b/vrct_gui/config_window/ConfigWindow.py @@ -1,7 +1,7 @@ from .widgets import createConfigWindowTitle, createSideMenuAndSettingsBoxContainers, createSettingBoxTopBar -from customtkinter import CTkToplevel, CTkFrame +from customtkinter import CTkToplevel, CTkFrame, CTkLabel, CTkFont from ..ui_utils import getImagePath, getLatestWidth, getLatestHeight from utils import isEven @@ -49,4 +49,18 @@ class ConfigWindow(CTkToplevel): l_width = getLatestWidth(self.side_menu_bg_container) + + # VRCT Now Version Label(Tmp) + version_label = CTkLabel( + self.side_menu_bg_container, + textvariable=self._view_variable.VAR_VERSION, + height=0, + corner_radius=0, + font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.NOW_VERSION_FONT_SIZE, weight="normal"), + anchor="w", + text_color=self.settings.ctm.NOW_VERSION_TEXT_COLOR, + ) + version_label.place(relx=0.05, rely=0.99, anchor="sw") + + self.bind_all("", lambda event: event.widget.focus_set(), "+") \ No newline at end of file diff --git a/vrct_gui/main_window/createMainWindowWidgets.py b/vrct_gui/main_window/createMainWindowWidgets.py index 25021800..14b0eda3 100644 --- a/vrct_gui/main_window/createMainWindowWidgets.py +++ b/vrct_gui/main_window/createMainWindowWidgets.py @@ -43,22 +43,6 @@ def createMainWindowWidgets(vrct_gui, settings, view_variable): # Main Top Bar Container - Right Side # start from 3 main_topbar_column=3 - - # VRCT Now Version Label(Tmp) - vrct_gui.version_label = CTkLabel( - vrct_gui.main_topbar_container, - textvariable=view_variable.VAR_VERSION, - 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="white", - ) - vrct_gui.version_label.grid(row=0, column=main_topbar_column, padx=(0,8)) - main_topbar_column+=1 - - - # Restart Button(Tmp) vrct_gui.restart_button_container = createButtonWithImage( parent_widget=vrct_gui.main_topbar_container, diff --git a/vrct_gui/ui_managers/ColorThemeManager.py b/vrct_gui/ui_managers/ColorThemeManager.py index 541da271..0f46aa14 100644 --- a/vrct_gui/ui_managers/ColorThemeManager.py +++ b/vrct_gui/ui_managers/ColorThemeManager.py @@ -284,6 +284,7 @@ class ColorThemeManager(): self.config_window.SIDE_MENU_SELECTED_MARK_ACTIVE_BG_COLOR = self.main.SF__SWITCH_BOX_ACTIVE_BG_COLOR + self.config_window.NOW_VERSION_TEXT_COLOR = self.DARK_300_COLOR # Error Message Window for Config Window # The color code [#bb4448] is a mixture of [#a9555c] and [#cc3333] (for a redder shade). diff --git a/vrct_gui/ui_managers/UiScalingManager.py b/vrct_gui/ui_managers/UiScalingManager.py index e5c7a41c..1d73764f 100644 --- a/vrct_gui/ui_managers/UiScalingManager.py +++ b/vrct_gui/ui_managers/UiScalingManager.py @@ -169,6 +169,7 @@ class UiScalingManager(): self.config_window.SIDE_MENU_LABELS_IPADY = self._calculateUiSize(8) self.config_window.SIDE_MENU_LABELS_FONT_SIZE = self._calculateUiSize(18) + self.config_window.NOW_VERSION_FONT_SIZE = self._calculateUiSize(12) # Top bar Main self.config_window.TOP_BAR_MAIN__TITLE_FONT_SIZE = self._calculateUiSize(22) From 708bcea533cb9c3ff44ae86309922e74be9d6999 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:32:23 +0900 Subject: [PATCH 2/4] [bugfix] Config Window: Setting Box Labels. fix the position to the center that was a bit above before. --- .../setting_box_containers/_SettingBoxGenerator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 692fb046..db613ad7 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 @@ -58,6 +58,7 @@ class _SettingBoxGenerator(): 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_rowconfigure((0,3), weight=1) setting_box_label = CTkLabel( setting_box_labels_frame, textvariable=for_var_label_text, @@ -66,7 +67,7 @@ class _SettingBoxGenerator(): 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=0, column=0, padx=0, pady=0, sticky="ew") + setting_box_label.grid(row=1, column=0, padx=0, pady=0, sticky="ew") self.config_window.sb__widgets[sb__attr_name].label_widget = setting_box_label @@ -81,7 +82,7 @@ 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 ) - 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=2, column=0, padx=0, pady=(self.settings.uism.SB__DESC_TOP_PADY,0), sticky="ew") self.config_window.additional_widgets.append(setting_box_desc) self.config_window.sb__widgets[sb__attr_name].desc_widget=setting_box_desc else: From f24ca9c30dd89c4b58ce70e8faaa7354f2eb99c4 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 13 Oct 2023 17:58:49 +0900 Subject: [PATCH 3/4] =?UTF-8?q?[bugfix]=20Splash=20Window:=20toolwindow?= =?UTF-8?q?=E3=82=92True=E3=81=AB=E3=81=97=E5=BF=98=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=80=81=E8=B5=B7=E5=8B=95=E6=99=82=E3=81=AB?= =?UTF-8?q?=E3=82=BF=E3=82=B9=E3=82=AF=E3=83=90=E3=83=BC=E3=81=AB=E8=A6=8B?= =?UTF-8?q?=E3=81=88=E3=81=A6=E3=81=97=E3=81=BE=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vrct_gui/splash_window/SplashWindow.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vrct_gui/splash_window/SplashWindow.py b/vrct_gui/splash_window/SplashWindow.py index d5e1d2e7..96537c5e 100644 --- a/vrct_gui/splash_window/SplashWindow.py +++ b/vrct_gui/splash_window/SplashWindow.py @@ -8,6 +8,7 @@ class SplashWindow(CTkToplevel): self.overrideredirect(True) self.configure(fg_color="#292a2d") self.title("SplashWindow") + self.wm_attributes("-toolwindow", True) sw=self.winfo_screenwidth() From bfc5ff04f85e1cd3f247b192f1c928cc322056d4 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 13 Oct 2023 18:23:55 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[Update]=20Config=20Window:=20UI=20Theme=20?= =?UTF-8?q?Dark=E3=83=A2=E3=83=BC=E3=83=89=E5=9B=BA=E5=AE=9A=E3=80=82?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E9=A0=85=E7=9B=AE=E3=81=8B=E3=82=89=E3=83=86?= =?UTF-8?q?=E3=83=BC=E3=83=9E=E9=81=B8=E6=8A=9E=E3=82=92=E3=81=A7=E3=81=8D?= =?UTF-8?q?=E3=81=AA=E3=81=8F=E3=81=97=E3=81=A6=E3=80=81config.json?= =?UTF-8?q?=E3=82=92=E7=B7=A8=E9=9B=86=E3=81=97=E3=81=9F=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=82=82=E5=B8=B8=E3=81=ABDark=E3=83=A2=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=81=AB=E5=9B=BA=E5=AE=9A=E3=80=82=E2=80=BB=E9=A0=85?= =?UTF-8?q?=E7=9B=AE=E3=81=A8=E3=81=97=E3=81=A6=E6=AE=8B=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=82=8B=E3=81=AE=E3=81=AF=E3=80=81Light=E3=83=A2?= =?UTF-8?q?=E3=83=BC=E3=83=89=E5=AE=9F=E8=A3=85=E4=BA=88=E5=AE=9A=E3=81=A7?= =?UTF-8?q?=E9=96=8B=E7=99=BA=E4=B8=AD=E3=81=A8=E3=81=84=E3=81=86=E4=BA=8B?= =?UTF-8?q?=E3=82=92=E8=A6=8B=E3=81=9B=E3=81=9F=E3=81=84=E3=81=9F=E3=82=81?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view.py | 15 ++++++++++++--- vrct_gui/_changeConfigWindowWidgetsStatus.py | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/view.py b/view.py index 66ec769e..89af1564 100644 --- a/view.py +++ b/view.py @@ -16,7 +16,8 @@ from config import config class View(): def __init__(self): self.settings = SimpleNamespace() - theme = get_appearance_mode() if config.APPEARANCE_THEME == "System" else config.APPEARANCE_THEME + # theme = get_appearance_mode() if config.APPEARANCE_THEME == "System" else config.APPEARANCE_THEME + theme = "Dark" all_ctm = ColorThemeManager(theme) all_uism = UiScalingManager(config.UI_SCALING) image_file = ImageFileManager(theme) @@ -161,9 +162,11 @@ class View(): 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")), - LIST_APPEARANCE_THEME=["Light", "Dark", "System"], + LIST_APPEARANCE_THEME=["Dark"], + # LIST_APPEARANCE_THEME=["Light", "Dark", "System"], CALLBACK_SET_APPEARANCE_THEME=None, - VAR_APPEARANCE_THEME=StringVar(value=config.APPEARANCE_THEME), + VAR_APPEARANCE_THEME=StringVar(value="Dark"), + # VAR_APPEARANCE_THEME=StringVar(value=config.APPEARANCE_THEME), VAR_LABEL_UI_SCALING=StringVar(value=i18n.t("config_window.ui_size.label")), VAR_DESC_UI_SCALING=None, @@ -450,6 +453,12 @@ class View(): self.enableConfigWindowCompactMode() vrct_gui.config_window.setting_box_compact_mode_switch_box.select() + vrct_gui._changeConfigWindowWidgetsStatus( + status="disabled", + target_names=[ + "sb__optionmenu_appearance_theme", + ] + ) if config.CHOICE_MIC_HOST == "NoHost": diff --git a/vrct_gui/_changeConfigWindowWidgetsStatus.py b/vrct_gui/_changeConfigWindowWidgetsStatus.py index 39ca924b..0263837b 100644 --- a/vrct_gui/_changeConfigWindowWidgetsStatus.py +++ b/vrct_gui/_changeConfigWindowWidgetsStatus.py @@ -32,6 +32,10 @@ def _changeConfigWindowWidgetsStatus(config_window, settings, view_variable, sta target_widget = config_window.sb__widgets["sb__optionmenu_speaker_device"] disableOptionmenuWidget(target_widget) + case "sb__optionmenu_appearance_theme": + if status == "disabled": + target_widget = config_window.sb__widgets["sb__optionmenu_appearance_theme"] + disableOptionmenuWidget(target_widget) case _: raise ValueError(f"No matching case for target_name: {target_name}")