Merge branch 'view' into develop
This commit is contained in:
@@ -13,6 +13,12 @@ def callbackUpdateSoftware():
|
||||
def callbackRestartSoftware():
|
||||
model.reStartSoftware()
|
||||
|
||||
def callbackFilepathLogs():
|
||||
print("callbackFilepathLogs")
|
||||
|
||||
def callbackFilepathConfigFile():
|
||||
print("callbackFilepathConfigFile")
|
||||
|
||||
# func transcription send message
|
||||
def sendMicMessage(message):
|
||||
if len(message) > 0:
|
||||
@@ -700,6 +706,8 @@ def createMainWindow():
|
||||
common_registers={
|
||||
"callback_update_software": callbackUpdateSoftware,
|
||||
"callback_restart_software": callbackRestartSoftware,
|
||||
"callback_filepath_logs": callbackFilepathLogs,
|
||||
"callback_filepath_config_file": callbackFilepathConfigFile,
|
||||
},
|
||||
|
||||
window_action_registers={
|
||||
|
||||
BIN
img/folder_open_icon.png
Normal file
BIN
img/folder_open_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 703 B |
@@ -193,4 +193,7 @@ config_window:
|
||||
label: OSC IP Address
|
||||
|
||||
osc_port:
|
||||
label: OSC Port
|
||||
label: OSC Port
|
||||
|
||||
open_config_filepath:
|
||||
label: Open Config File
|
||||
@@ -192,4 +192,7 @@ config_window:
|
||||
label: OSC IP Address
|
||||
|
||||
osc_port:
|
||||
label: OSC Port
|
||||
label: OSC Port
|
||||
|
||||
open_config_filepath:
|
||||
label: 設定ファイルを開く
|
||||
7
view.py
7
view.py
@@ -82,6 +82,8 @@ class View():
|
||||
# Common
|
||||
CALLBACK_RESTART_SOFTWARE=None,
|
||||
CALLBACK_UPDATE_SOFTWARE=None,
|
||||
CALLBACK_OPEN_FILEPATH_LOGS=None,
|
||||
CALLBACK_OPEN_FILEPATH_CONFIG_FILE=None,
|
||||
|
||||
CALLBACK_QUIT_VRCT=vrct_gui._quitVRCT,
|
||||
|
||||
@@ -384,6 +386,9 @@ class View():
|
||||
VAR_DESC_OSC_PORT=None,
|
||||
CALLBACK_SET_OSC_PORT=None,
|
||||
VAR_OSC_PORT=StringVar(value=config.OSC_PORT),
|
||||
|
||||
VAR_LABEL_OPEN_CONFIG_FILEPATH=StringVar(value=i18n.t("config_window.open_config_filepath.label")),
|
||||
VAR_DESC_OPEN_CONFIG_FILEPATH=None,
|
||||
)
|
||||
|
||||
|
||||
@@ -400,6 +405,8 @@ class View():
|
||||
if common_registers is not None:
|
||||
self.view_variable.CALLBACK_UPDATE_SOFTWARE=common_registers.get("callback_update_software", None)
|
||||
self.view_variable.CALLBACK_RESTART_SOFTWARE=common_registers.get("callback_restart_software", None)
|
||||
self.view_variable.CALLBACK_OPEN_FILEPATH_LOGS=common_registers.get("callback_filepath_logs", None)
|
||||
self.view_variable.CALLBACK_OPEN_FILEPATH_CONFIG_FILE=common_registers.get("callback_filepath_config_file", None)
|
||||
|
||||
|
||||
if window_action_registers is not None:
|
||||
|
||||
@@ -254,6 +254,67 @@ class _SettingBoxGenerator():
|
||||
|
||||
|
||||
|
||||
def createSettingBoxAutoExportMessageLogs(
|
||||
self,
|
||||
for_var_label_text, for_var_desc_text,
|
||||
checkbox_attr_name,
|
||||
checkbox_command,
|
||||
button_command,
|
||||
variable,
|
||||
):
|
||||
|
||||
(setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(checkbox_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)
|
||||
|
||||
|
||||
|
||||
|
||||
button_widget = createButtonWithImage(
|
||||
parent_widget=all_wrapper,
|
||||
button_fg_color=self.settings.ctm.SB__BUTTON_COLOR,
|
||||
button_enter_color=self.settings.ctm.SB__BUTTON_HOVERED_COLOR,
|
||||
button_clicked_color=self.settings.ctm.SB__BUTTON_CLICKED_COLOR,
|
||||
button_image_file=self.settings.image_file.FOLDER_OPEN_ICON,
|
||||
button_image_size=self.settings.uism.SB__BUTTON_ICON_SIZE,
|
||||
button_ipadxy=self.settings.uism.SB__BUTTON_IPADXY,
|
||||
button_command=button_command,
|
||||
)
|
||||
button_widget.grid(row=0, column=0, padx=0, sticky="w")
|
||||
|
||||
|
||||
|
||||
checkbox_widget = CTkCheckBox(
|
||||
all_wrapper,
|
||||
text=None,
|
||||
width=0,
|
||||
checkbox_width=self.settings.uism.SB__CHECKBOX_SIZE,
|
||||
checkbox_height=self.settings.uism.SB__CHECKBOX_SIZE,
|
||||
onvalue=True,
|
||||
offvalue=False,
|
||||
variable=variable,
|
||||
command=checkbox_command,
|
||||
corner_radius=self.settings.uism.SB__CHECKBOX_CORNER_RADIUS,
|
||||
border_width=self.settings.uism.SB__CHECKBOX_BORDER_WIDTH,
|
||||
border_color=self.settings.ctm.SB__CHECKBOX_BORDER_COLOR,
|
||||
hover_color=self.settings.ctm.SB__CHECKBOX_HOVER_COLOR,
|
||||
checkmark_color=self.settings.ctm.SB__CHECKBOX_CHECKMARK_COLOR,
|
||||
fg_color=self.settings.ctm.SB__CHECKBOX_CHECKED_COLOR,
|
||||
)
|
||||
setattr(self.config_window, checkbox_attr_name, checkbox_widget)
|
||||
|
||||
checkbox_widget.grid(row=0, column=2, sticky="e")
|
||||
|
||||
return setting_box_frame
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def createSettingBoxSlider(
|
||||
@@ -679,6 +740,33 @@ class _SettingBoxGenerator():
|
||||
|
||||
|
||||
|
||||
def createSettingBoxButtonWithImage(
|
||||
self,
|
||||
for_var_label_text, for_var_desc_text,
|
||||
button_attr_name,
|
||||
button_image,
|
||||
button_command,
|
||||
):
|
||||
|
||||
(setting_box_frame, setting_box_item_frame) = self._createSettingBoxFrame(button_attr_name, for_var_label_text, for_var_desc_text)
|
||||
|
||||
|
||||
button_with_image_widget = createButtonWithImage(
|
||||
parent_widget=setting_box_item_frame,
|
||||
button_fg_color=self.settings.ctm.SB__BUTTON_COLOR,
|
||||
button_enter_color=self.settings.ctm.SB__BUTTON_HOVERED_COLOR,
|
||||
button_clicked_color=self.settings.ctm.SB__BUTTON_CLICKED_COLOR,
|
||||
button_image_file=button_image,
|
||||
button_image_size=self.settings.uism.SB__OPEN_CONFIG_FILE_BUTTON_ICON_SIZE,
|
||||
button_ipadxy=self.settings.uism.SB__OPEN_CONFIG_FILE_BUTTON_IPADXY,
|
||||
button_command=button_command,
|
||||
)
|
||||
button_with_image_widget.grid(row=1, column=SETTING_BOX_COLUMN, sticky="e")
|
||||
|
||||
return setting_box_frame
|
||||
|
||||
|
||||
|
||||
|
||||
def createSettingBoxArrowSwitch(
|
||||
self,
|
||||
@@ -710,12 +798,12 @@ class _SettingBoxGenerator():
|
||||
|
||||
for_opening_button_wrapper = createButtonWithImage(
|
||||
parent_widget=setting_box_item_frame,
|
||||
button_fg_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_COLOR,
|
||||
button_enter_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_HOVERED_COLOR,
|
||||
button_clicked_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_CLICKED_COLOR,
|
||||
button_fg_color=self.settings.ctm.SB__BUTTON_COLOR,
|
||||
button_enter_color=self.settings.ctm.SB__BUTTON_HOVERED_COLOR,
|
||||
button_clicked_color=self.settings.ctm.SB__BUTTON_CLICKED_COLOR,
|
||||
button_image_file=self.settings.image_file.ARROW_LEFT.rotate(270),
|
||||
button_image_size=self.settings.uism.SB__ARROW_SWITCH_BUTTON_ICON_SIZE,
|
||||
button_ipadxy=self.settings.uism.SB__ARROW_SWITCH_BUTTON_IPADXY,
|
||||
button_image_size=self.settings.uism.SB__BUTTON_ICON_SIZE,
|
||||
button_ipadxy=self.settings.uism.SB__BUTTON_IPADXY,
|
||||
button_command=open_command,
|
||||
)
|
||||
for_opening_button_wrapper.grid(row=1, column=ARROW_BUTTON_COLUMN, padx=self.settings.uism.SB__ARROW_SWITCH_LEFT_PADX, sticky="e")
|
||||
@@ -724,12 +812,12 @@ class _SettingBoxGenerator():
|
||||
|
||||
for_closing_button_wrapper = createButtonWithImage(
|
||||
parent_widget=setting_box_item_frame,
|
||||
button_fg_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_COLOR,
|
||||
button_enter_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_HOVERED_COLOR,
|
||||
button_clicked_color=self.settings.ctm.SB__ARROW_SWITCH_BUTTON_CLICKED_COLOR,
|
||||
button_fg_color=self.settings.ctm.SB__BUTTON_COLOR,
|
||||
button_enter_color=self.settings.ctm.SB__BUTTON_HOVERED_COLOR,
|
||||
button_clicked_color=self.settings.ctm.SB__BUTTON_CLICKED_COLOR,
|
||||
button_image_file=self.settings.image_file.ARROW_LEFT.rotate(90),
|
||||
button_image_size=self.settings.uism.SB__ARROW_SWITCH_BUTTON_ICON_SIZE,
|
||||
button_ipadxy=self.settings.uism.SB__ARROW_SWITCH_BUTTON_IPADXY,
|
||||
button_image_size=self.settings.uism.SB__BUTTON_ICON_SIZE,
|
||||
button_ipadxy=self.settings.uism.SB__BUTTON_IPADXY,
|
||||
button_command=close_command,
|
||||
)
|
||||
for_closing_button_wrapper.grid(row=1, column=ARROW_BUTTON_COLUMN, padx=self.settings.uism.SB__ARROW_SWITCH_LEFT_PADX, sticky="e")
|
||||
|
||||
@@ -5,6 +5,7 @@ from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||
def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settings, view_variable):
|
||||
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
|
||||
createSettingBoxEntry = sbg.createSettingBoxEntry
|
||||
createSettingBoxButtonWithImage = sbg.createSettingBoxButtonWithImage
|
||||
|
||||
|
||||
def entry_ip_address_callback(value):
|
||||
@@ -13,6 +14,9 @@ def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settin
|
||||
def entry_port_callback(value):
|
||||
callFunctionIfCallable(view_variable.CALLBACK_SET_OSC_PORT, value)
|
||||
|
||||
def open_config_filepath_callback():
|
||||
callFunctionIfCallable(view_variable.CALLBACK_OPEN_FILEPATH_CONFIG_FILE)
|
||||
|
||||
row=0
|
||||
config_window.sb__ip_address = createSettingBoxEntry(
|
||||
for_var_label_text=view_variable.VAR_LABEL_OSC_IP_ADDRESS,
|
||||
@@ -34,5 +38,15 @@ def createSettingBox_AdvancedSettings(setting_box_wrapper, config_window, settin
|
||||
entry_bind__Any_KeyRelease=lambda value: entry_port_callback(value),
|
||||
entry_textvariable=view_variable.VAR_OSC_PORT,
|
||||
)
|
||||
config_window.sb__port.grid(row=row, pady=0)
|
||||
config_window.sb__port.grid(row=row)
|
||||
row+=1
|
||||
|
||||
config_window.sb__open_config_filepath = createSettingBoxButtonWithImage(
|
||||
for_var_label_text=view_variable.VAR_LABEL_OPEN_CONFIG_FILEPATH,
|
||||
for_var_desc_text=view_variable.VAR_DESC_OPEN_CONFIG_FILEPATH,
|
||||
button_attr_name="sb__button_open_config_filepath",
|
||||
button_command=lambda _e: open_config_filepath_callback(),
|
||||
button_image=settings.image_file.FOLDER_OPEN_ICON,
|
||||
)
|
||||
config_window.sb__open_config_filepath.grid(row=row, pady=0)
|
||||
row+=1
|
||||
@@ -5,6 +5,7 @@ from .._SettingBoxGenerator import _SettingBoxGenerator
|
||||
def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_variable):
|
||||
sbg = _SettingBoxGenerator(setting_box_wrapper, config_window, settings, view_variable)
|
||||
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||
createSettingBoxAutoExportMessageLogs = sbg.createSettingBoxAutoExportMessageLogs
|
||||
createSettingBox_Labels = sbg.createSettingBox_Labels
|
||||
createSettingBoxMessageFormatEntries = sbg.createSettingBoxMessageFormatEntries
|
||||
|
||||
@@ -19,6 +20,9 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
|
||||
def checkbox_auto_export_message_logs_callback(checkbox_box_widget):
|
||||
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_AUTO_EXPORT_MESSAGE_LOGS, checkbox_box_widget.get())
|
||||
|
||||
def button_auto_export_message_logs_callback():
|
||||
callFunctionIfCallable(view_variable.CALLBACK_OPEN_FILEPATH_LOGS)
|
||||
|
||||
def checkbox_enable_send_message_to_vrc_callback(checkbox_box_widget):
|
||||
callFunctionIfCallable(view_variable.CALLBACK_SET_ENABLE_SEND_MESSAGE_TO_VRC, checkbox_box_widget.get())
|
||||
|
||||
@@ -53,11 +57,12 @@ def createSettingBox_Others(setting_box_wrapper, config_window, settings, view_v
|
||||
row+=1
|
||||
|
||||
|
||||
config_window.sb__auto_export_message_logs = createSettingBoxCheckbox(
|
||||
config_window.sb__auto_export_message_logs = createSettingBoxAutoExportMessageLogs(
|
||||
for_var_label_text=view_variable.VAR_LABEL_ENABLE_AUTO_EXPORT_MESSAGE_LOGS,
|
||||
for_var_desc_text=view_variable.VAR_DESC_ENABLE_AUTO_EXPORT_MESSAGE_LOGS,
|
||||
checkbox_attr_name="sb__checkbox_auto_export_message_logs",
|
||||
command=lambda: checkbox_auto_export_message_logs_callback(config_window.sb__checkbox_auto_export_message_logs),
|
||||
checkbox_command=lambda: checkbox_auto_export_message_logs_callback(config_window.sb__checkbox_auto_export_message_logs),
|
||||
button_command=lambda _e: button_auto_export_message_logs_callback(),
|
||||
variable=view_variable.VAR_ENABLE_AUTO_EXPORT_MESSAGE_LOGS,
|
||||
)
|
||||
config_window.sb__auto_export_message_logs.grid(row=row)
|
||||
|
||||
@@ -160,6 +160,10 @@ def _darkTheme(base_color):
|
||||
|
||||
LABELS_TEXT_DISABLED_COLOR = base_color.DARK_600_COLOR,
|
||||
|
||||
SB__BUTTON_COLOR = base_color.DARK_888_COLOR,
|
||||
SB__BUTTON_HOVERED_COLOR = base_color.DARK_800_COLOR,
|
||||
SB__BUTTON_CLICKED_COLOR = base_color.DARK_900_COLOR,
|
||||
|
||||
|
||||
# Top bar
|
||||
TOP_BAR_BG_COLOR = base_color.DARK_850_COLOR,
|
||||
@@ -231,11 +235,6 @@ def _darkTheme(base_color):
|
||||
SB__PROGRESSBAR_X_SLIDER__ACTIVE_BUTTON_HOVERED_COLOR = base_color.PRIMARY_500_COLOR,
|
||||
SB__PROGRESSBAR_X_SLIDER__ACTIVE_BUTTON_CLICKED_COLOR = base_color.PRIMARY_800_COLOR,
|
||||
|
||||
|
||||
SB__ARROW_SWITCH_BUTTON_COLOR = base_color.DARK_888_COLOR,
|
||||
SB__ARROW_SWITCH_BUTTON_HOVERED_COLOR = base_color.DARK_800_COLOR,
|
||||
SB__ARROW_SWITCH_BUTTON_CLICKED_COLOR = base_color.DARK_900_COLOR,
|
||||
|
||||
SB__ADD_AND_DELETE_ABLE_LIST__ADD_BUTTON_COLOR = base_color.PRIMARY_600_COLOR,
|
||||
SB__ADD_AND_DELETE_ABLE_LIST__ADD_BUTTON_HOVERED_COLOR = base_color.PRIMARY_500_COLOR,
|
||||
SB__ADD_AND_DELETE_ABLE_LIST__ADD_BUTTON_CLICKED_COLOR = base_color.PRIMARY_700_COLOR,
|
||||
@@ -306,6 +305,7 @@ def _darkTheme(base_color):
|
||||
CANCEL_ICON = getImageFileFromUiUtils("cancel_icon.png"),
|
||||
REDO_ICON = getImageFileFromUiUtils("redo_white.png"),
|
||||
SWAP_ICON = getImageFileFromUiUtils("swap_icon.png"),
|
||||
FOLDER_OPEN_ICON = getImageFileFromUiUtils("folder_open_icon.png"),
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -282,10 +282,6 @@ class UiScalingManager():
|
||||
self.config_window.SB__PROGRESSBAR_X_SLIDER__BUTTON_IPADXY = self._calculateUiSize(10)
|
||||
self.config_window.SB__PROGRESSBAR_X_SLIDER__BUTTON_ICON_SIZE = self._calculateUiSize(20)
|
||||
|
||||
|
||||
|
||||
self.config_window.SB__ARROW_SWITCH_BUTTON_IPADXY = self._calculateUiSize(16)
|
||||
self.config_window.SB__ARROW_SWITCH_BUTTON_ICON_SIZE = self._calculateUiSize(24)
|
||||
self.config_window.SB__ARROW_SWITCH_DESC_FONT_SIZE = self._calculateUiSize(16)
|
||||
self.config_window.SB__ARROW_SWITCH_LEFT_PADX = (self._calculateUiSize(20), 0)
|
||||
|
||||
@@ -324,6 +320,12 @@ class UiScalingManager():
|
||||
self.config_window.SB__MESSAGE_FORMAT__ENTRIES_BOTTOM_PADY = (0, self._calculateUiSize(14))
|
||||
|
||||
|
||||
self.config_window.SB__BUTTON_IPADXY = self._calculateUiSize(16)
|
||||
self.config_window.SB__BUTTON_ICON_SIZE = self._calculateUiSize(24)
|
||||
|
||||
self.config_window.SB__OPEN_CONFIG_FILE_BUTTON_IPADXY = self._calculateUiSize(10)
|
||||
self.config_window.SB__OPEN_CONFIG_FILE_BUTTON_ICON_SIZE = self._calculateUiSize(20)
|
||||
|
||||
|
||||
def _calculateUiSize(self, default_size, is_allowed_odd:bool=False, is_zero_allowed:bool=False):
|
||||
size = calculateUiSize(default_size, self.SCALING_FLOAT, is_allowed_odd, is_zero_allowed)
|
||||
|
||||
Reference in New Issue
Block a user