diff --git a/img/refresh_icon.png b/img/refresh_icon.png new file mode 100644 index 00000000..c5acad15 Binary files /dev/null and b/img/refresh_icon.png differ diff --git a/view.py b/view.py index 60a654a9..45d0c337 100644 --- a/view.py +++ b/view.py @@ -91,6 +91,9 @@ class View(): VAR_LABEL_TEXTBOX_RECEIVED=StringVar(value="Received"), # JA: 受信 VAR_LABEL_TEXTBOX_SYSTEM=StringVar(value="System"), # JA: システム + VAR_UPDATE_AVAILABLE=StringVar(value="New version is here!"), # JA: 新しいバージョンが出ました! + # VAR_UPDATE_AVAILABLE=StringVar(value="新しいバージョンが出ました!"), + # Selectable Language Window VAR_TITLE_LABEL_SELECTABLE_LANGUAGE=StringVar(value=""), diff --git a/vrct_gui/main_window/createMainWindowWidgets.py b/vrct_gui/main_window/createMainWindowWidgets.py index 2a6f6e84..7f7eaa2e 100644 --- a/vrct_gui/main_window/createMainWindowWidgets.py +++ b/vrct_gui/main_window/createMainWindowWidgets.py @@ -1,8 +1,8 @@ from .widgets import createSidebar, createMinimizeSidebarButton, createTextbox, createEntryMessageBox -from customtkinter import CTkFrame +from customtkinter import CTkFrame, CTkLabel, CTkFont, CTkImage -from ..ui_utils import createButtonWithImage, getImagePath +from ..ui_utils import createButtonWithImage, getImagePath, bindButtonFunctionAndColor def createMainWindowWidgets(vrct_gui, settings, view_variable): @@ -41,6 +41,57 @@ def createMainWindowWidgets(vrct_gui, settings, view_variable): + vrct_gui.update_available_container = CTkFrame( + vrct_gui.main_topbar_container, + corner_radius=settings.uism.HELP_AND_INFO_BUTTON_CORNER_RADIUS, + fg_color=settings.ctm.MAIN_BG_COLOR, + cursor="hand2", + ) + vrct_gui.update_available_container.grid(row=0, column=3, padx=(0,4), pady=settings.uism.HELP_AND_INFO_BUTTON_PADY, sticky="nse") + + + vrct_gui.update_available_container.rowconfigure((0,2), weight=1) + + + vrct_gui.update_available_icon = CTkLabel( + vrct_gui.update_available_container, + text=None, + corner_radius=0, + height=0, + image=CTkImage(settings.image_file.REFRESH_ICON.rotate(25), size=(settings.uism.HELP_AND_INFO_BUTTON_SIZE-6,settings.uism.HELP_AND_INFO_BUTTON_SIZE-6)), + ) + vrct_gui.update_available_icon.grid(row=1, column=0, padx=(6,4), pady=0) + + + vrct_gui.update_available_label = CTkLabel( + vrct_gui.update_available_container, + textvariable=view_variable.VAR_UPDATE_AVAILABLE, + height=0, + corner_radius=0, + font=CTkFont(family=settings.FONT_FAMILY, size=12, weight="normal"), + anchor="e", + text_color="#61b4a7", + ) + # This "right padx +1" is for fixing a bug that sticks out from the frame. I don't know why that happens... + vrct_gui.update_available_label.grid(row=1, column=1, padx=(0,6+1), pady=0) + + + + + + bindButtonFunctionAndColor( + target_widgets=[ + vrct_gui.update_available_container, + vrct_gui.update_available_label, + vrct_gui.update_available_icon, + ], + enter_color=settings.ctm.HELP_AND_INFO_BUTTON_HOVERED_BG_COLOR, + leave_color=settings.ctm.HELP_AND_INFO_BUTTON_BG_COLOR, + clicked_color=settings.ctm.HELP_AND_INFO_BUTTON_CLICKED_BG_COLOR, + buttonReleasedFunction=vrct_gui.openHelpAndInfoWindow, + ) + + # Help and Info button vrct_gui.help_and_info_button_container = createButtonWithImage( @@ -54,7 +105,7 @@ def createMainWindowWidgets(vrct_gui, settings, view_variable): button_command=vrct_gui.openHelpAndInfoWindow, corner_radius=settings.uism.HELP_AND_INFO_BUTTON_CORNER_RADIUS, ) - vrct_gui.help_and_info_button_container.grid(row=0, column=3, padx=settings.uism.HELP_AND_INFO_BUTTON_PADX, pady=settings.uism.HELP_AND_INFO_BUTTON_PADY, sticky="e") + vrct_gui.help_and_info_button_container.grid(row=0, column=4, padx=settings.uism.HELP_AND_INFO_BUTTON_PADX, pady=settings.uism.HELP_AND_INFO_BUTTON_PADY, sticky="e") createSidebar(settings, vrct_gui, view_variable) diff --git a/vrct_gui/main_window/widgets/create_sidebar.py b/vrct_gui/main_window/widgets/create_sidebar.py index 95e4eec6..51f7ddab 100644 --- a/vrct_gui/main_window/widgets/create_sidebar.py +++ b/vrct_gui/main_window/widgets/create_sidebar.py @@ -60,6 +60,16 @@ def createSidebar(settings, main_window, view_variable): main_window.sidebar_config_button.grid(row=0, column=0, padx=0, pady=settings.uism.SIDEBAR_CONFIG_BUTTON_IPADY) + # main_window.sidebar_config_button_update_badge = CTkFrame( + # main_window.sidebar_config_button, + # corner_radius=3, + # fg_color="#ca5361", + # width=6, + # height=6, + # ) + # main_window.sidebar_config_button_update_badge.place(relx=0.9, rely=0.1, anchor="center") + + bindButtonFunctionAndColor( target_widgets=[main_window.sidebar_config_button_wrapper, main_window.sidebar_config_button], enter_color=settings.ctm.CONFIG_BUTTON_HOVERED_BG_COLOR, diff --git a/vrct_gui/ui_managers/ImageFileManager.py b/vrct_gui/ui_managers/ImageFileManager.py index 62dcc122..8bb71b4a 100644 --- a/vrct_gui/ui_managers/ImageFileManager.py +++ b/vrct_gui/ui_managers/ImageFileManager.py @@ -30,6 +30,7 @@ class ImageFileManager(): self.ARROW_LEFT = getImageFileFromUiUtils("arrow_left_white.png") self.ARROW_LEFT_DISABLED = getImageFileFromUiUtils("arrow_left_disabled.png") + self.REFRESH_ICON = getImageFileFromUiUtils("refresh_icon.png") self.HELP_ICON = getImageFileFromUiUtils("help_icon_white.png") def _createLightModeImages(self):