[Update] Main Page: Message Input Box Ratio. saveable the ratio.
This commit is contained in:
22
src-ui/logics/main/useMessageInputBoxRatio.js
Normal file
22
src-ui/logics/main/useMessageInputBoxRatio.js
Normal 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,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user