[Update] Add Message Log Ui Scaling.
This commit is contained in:
24
src-ui/logics/configs/useMessageLogUiScaling.js
Normal file
24
src-ui/logics/configs/useMessageLogUiScaling.js
Normal 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,
|
||||
};
|
||||
};
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user