[Update] Add Ui Scaling.
This commit is contained in:
24
src-ui/logics/configs/useUiScaling.js
Normal file
24
src-ui/logics/configs/useUiScaling.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_UiScaling } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useUiScaling = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentUiScaling, updateUiScaling, pendingUiScaling } = useStore_UiScaling();
|
||||
|
||||
const getUiScaling = () => {
|
||||
pendingUiScaling();
|
||||
asyncStdoutToPython("/get/data/ui_scaling");
|
||||
};
|
||||
|
||||
const setUiScaling = (selected_ui_scaling) => {
|
||||
pendingUiScaling();
|
||||
asyncStdoutToPython("/set/data/ui_scaling", selected_ui_scaling);
|
||||
};
|
||||
|
||||
return {
|
||||
currentUiScaling,
|
||||
getUiScaling,
|
||||
updateUiScaling,
|
||||
setUiScaling,
|
||||
};
|
||||
};
|
||||
@@ -27,6 +27,7 @@ import { useEnableAutoClearMessageBox } from "@logics_configs/useEnableAutoClear
|
||||
import { useSendMessageButtonType } from "@logics_configs/useSendMessageButtonType";
|
||||
|
||||
import { useUiLanguage } from "@logics_configs/useUiLanguage";
|
||||
import { useUiScaling } from "@logics_configs/useUiScaling";
|
||||
|
||||
export const useReceiveRoutes = () => {
|
||||
const { updateIsMainPageCompactMode } = useIsMainPageCompactMode();
|
||||
@@ -63,6 +64,7 @@ export const useReceiveRoutes = () => {
|
||||
const { updateEnableAutoClearMessageBox } = useEnableAutoClearMessageBox();
|
||||
const { updateSendMessageButtonType } = useSendMessageButtonType();
|
||||
const { updateUiLanguage } = useUiLanguage();
|
||||
const { updateUiScaling } = useUiScaling();
|
||||
const {
|
||||
updateVolumeVariable_Mic,
|
||||
updateVolumeVariable_Speaker,
|
||||
@@ -198,6 +200,9 @@ export const useReceiveRoutes = () => {
|
||||
"/get/data/ui_language": updateUiLanguage,
|
||||
"/set/data/ui_language": updateUiLanguage,
|
||||
|
||||
"/get/data/ui_scaling": updateUiScaling,
|
||||
"/set/data/ui_scaling": updateUiScaling,
|
||||
|
||||
// Others Tab
|
||||
"/get/data/auto_clear_message_box": updateEnableAutoClearMessageBox,
|
||||
"/set/enable/auto_clear_message_box": updateEnableAutoClearMessageBox,
|
||||
|
||||
Reference in New Issue
Block a user