[Update] Add Message Log Ui Scaling.

This commit is contained in:
Sakamoto Shiina
2024-09-30 10:33:54 +09:00
parent d2e03e0093
commit 6828c255a6
9 changed files with 100 additions and 12 deletions

View File

@@ -0,0 +1,24 @@
import { useStore_MessageLogUiScaling } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useMessageLogUiScaling = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentMessageLogUiScaling, updateMessageLogUiScaling, pendingMessageLogUiScaling } = useStore_MessageLogUiScaling();
const getMessageLogUiScaling = () => {
pendingMessageLogUiScaling();
asyncStdoutToPython("/get/data/textbox_ui_scaling");
};
const setMessageLogUiScaling = (selected_ui_scaling) => {
pendingMessageLogUiScaling();
asyncStdoutToPython("/set/data/textbox_ui_scaling", selected_ui_scaling);
};
return {
currentMessageLogUiScaling,
getMessageLogUiScaling,
updateMessageLogUiScaling,
setMessageLogUiScaling,
};
};

View File

@@ -28,6 +28,7 @@ import { useSendMessageButtonType } from "@logics_configs/useSendMessageButtonTy
import { useUiLanguage } from "@logics_configs/useUiLanguage";
import { useUiScaling } from "@logics_configs/useUiScaling";
import { useMessageLogUiScaling } from "@logics_configs/useMessageLogUiScaling";
export const useReceiveRoutes = () => {
const { updateIsMainPageCompactMode } = useIsMainPageCompactMode();
@@ -65,6 +66,7 @@ export const useReceiveRoutes = () => {
const { updateSendMessageButtonType } = useSendMessageButtonType();
const { updateUiLanguage } = useUiLanguage();
const { updateUiScaling } = useUiScaling();
const { updateMessageLogUiScaling } = useMessageLogUiScaling();
const {
updateVolumeVariable_Mic,
updateVolumeVariable_Speaker,
@@ -203,6 +205,9 @@ export const useReceiveRoutes = () => {
"/get/data/ui_scaling": updateUiScaling,
"/set/data/ui_scaling": updateUiScaling,
"/get/data/textbox_ui_scaling": updateMessageLogUiScaling,
"/set/data/textbox_ui_scaling": updateMessageLogUiScaling,
// Others Tab
"/get/data/auto_clear_message_box": updateEnableAutoClearMessageBox,
"/set/enable/auto_clear_message_box": updateEnableAutoClearMessageBox,