[Update] Add Font Family.
This commit is contained in:
24
src-ui/logics/configs/useSelectedFontFamily.js
Normal file
24
src-ui/logics/configs/useSelectedFontFamily.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_SelectedFontFamily } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useSelectedFontFamily = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentSelectedFontFamily, updateSelectedFontFamily, pendingSelectedFontFamily } = useStore_SelectedFontFamily();
|
||||
|
||||
const getSelectedFontFamily = () => {
|
||||
pendingSelectedFontFamily();
|
||||
asyncStdoutToPython("/get/data/font_family");
|
||||
};
|
||||
|
||||
const setSelectedFontFamily = (selected_font_family) => {
|
||||
pendingSelectedFontFamily();
|
||||
asyncStdoutToPython("/set/data/font_family", selected_font_family);
|
||||
};
|
||||
|
||||
return {
|
||||
currentSelectedFontFamily,
|
||||
getSelectedFontFamily,
|
||||
updateSelectedFontFamily,
|
||||
setSelectedFontFamily,
|
||||
};
|
||||
};
|
||||
@@ -25,6 +25,7 @@ import { useMicThreshold } from "@logics_configs/useMicThreshold";
|
||||
import { useSpeakerThreshold } from "@logics_configs/useSpeakerThreshold";
|
||||
import { useEnableAutoClearMessageBox } from "@logics_configs/useEnableAutoClearMessageBox";
|
||||
import { useSendMessageButtonType } from "@logics_configs/useSendMessageButtonType";
|
||||
import { useSelectedFontFamily } from "@logics_configs/useSelectedFontFamily";
|
||||
|
||||
import { useUiLanguage } from "@logics_configs/useUiLanguage";
|
||||
import { useUiScaling } from "@logics_configs/useUiScaling";
|
||||
@@ -75,6 +76,7 @@ export const useReceiveRoutes = () => {
|
||||
} = useVolume();
|
||||
|
||||
const { updateMessageInputBoxRatio } = useMessageInputBoxRatio();
|
||||
const { updateSelectedFontFamily } = useSelectedFontFamily();
|
||||
|
||||
|
||||
const routes = {
|
||||
@@ -208,6 +210,9 @@ export const useReceiveRoutes = () => {
|
||||
"/get/data/textbox_ui_scaling": updateMessageLogUiScaling,
|
||||
"/set/data/textbox_ui_scaling": updateMessageLogUiScaling,
|
||||
|
||||
"/get/data/font_family": updateSelectedFontFamily,
|
||||
"/set/data/font_family": updateSelectedFontFamily,
|
||||
|
||||
// Others Tab
|
||||
"/get/data/auto_clear_message_box": updateEnableAutoClearMessageBox,
|
||||
"/set/enable/auto_clear_message_box": updateEnableAutoClearMessageBox,
|
||||
|
||||
Reference in New Issue
Block a user