[Update] Main Page: Message Input Box Ratio. saveable the ratio.

This commit is contained in:
Sakamoto Shiina
2024-09-25 11:56:28 +09:00
parent 14470e5217
commit b3d7d3f87e
6 changed files with 113 additions and 20 deletions

View File

@@ -0,0 +1,22 @@
import { useStore_MessageInputBoxRatio } from "@store";
import { useStdoutToPython } from "@logics/useStdoutToPython";
export const useMessageInputBoxRatio = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentMessageInputBoxRatio, updateMessageInputBoxRatio } = useStore_MessageInputBoxRatio();
const getMessageInputBoxRatio = () => {
asyncStdoutToPython("/get/data/message_box_ratio");
};
const setMessageInputBoxRatio = (ratio) => {
asyncStdoutToPython("/set/data/message_box_ratio", parseFloat(ratio.toFixed(2)));
};
return {
currentMessageInputBoxRatio,
getMessageInputBoxRatio,
updateMessageInputBoxRatio,
setMessageInputBoxRatio,
};
};