[Refactor] Refactor the way import files.
Organize some codes.
This commit is contained in:
24
src-ui/logics/configs/appearance/useMessageLogUiScaling.js
Normal file
24
src-ui/logics/configs/appearance/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,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/appearance/useSelectedFontFamily.js
Normal file
24
src-ui/logics/configs/appearance/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,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/appearance/useSendMessageButtonType.js
Normal file
24
src-ui/logics/configs/appearance/useSendMessageButtonType.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_SendMessageButtonType } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useSendMessageButtonType = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentSendMessageButtonType, updateSendMessageButtonType, pendingSendMessageButtonType } = useStore_SendMessageButtonType();
|
||||
|
||||
const getSendMessageButtonType = () => {
|
||||
pendingSendMessageButtonType();
|
||||
asyncStdoutToPython("/get/data/send_message_button_type");
|
||||
};
|
||||
|
||||
const setSendMessageButtonType = (selected_type) => {
|
||||
pendingSendMessageButtonType();
|
||||
asyncStdoutToPython("/set/data/send_message_button_type", selected_type);
|
||||
};
|
||||
|
||||
return {
|
||||
currentSendMessageButtonType,
|
||||
getSendMessageButtonType,
|
||||
setSendMessageButtonType,
|
||||
updateSendMessageButtonType,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/appearance/useTransparency.js
Normal file
24
src-ui/logics/configs/appearance/useTransparency.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_Transparency } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useTransparency = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentTransparency, updateTransparency, pendingTransparency } = useStore_Transparency();
|
||||
|
||||
const getTransparency = () => {
|
||||
pendingTransparency();
|
||||
asyncStdoutToPython("/get/data/transparency");
|
||||
};
|
||||
|
||||
const setTransparency = (selected_transparency) => {
|
||||
pendingTransparency();
|
||||
asyncStdoutToPython("/set/data/transparency", selected_transparency);
|
||||
};
|
||||
|
||||
return {
|
||||
currentTransparency,
|
||||
getTransparency,
|
||||
updateTransparency,
|
||||
setTransparency,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/appearance/useUiLanguage.js
Normal file
24
src-ui/logics/configs/appearance/useUiLanguage.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { useStore_UiLanguage } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useUiLanguage = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentUiLanguage, updateUiLanguage, pendingUiLanguage } = useStore_UiLanguage();
|
||||
|
||||
const getUiLanguage = () => {
|
||||
pendingUiLanguage();
|
||||
asyncStdoutToPython("/get/data/ui_language");
|
||||
};
|
||||
|
||||
const setUiLanguage = (selected_ui_language) => {
|
||||
pendingUiLanguage();
|
||||
asyncStdoutToPython("/set/data/ui_language", selected_ui_language);
|
||||
};
|
||||
|
||||
return {
|
||||
currentUiLanguage,
|
||||
getUiLanguage,
|
||||
updateUiLanguage,
|
||||
setUiLanguage,
|
||||
};
|
||||
};
|
||||
24
src-ui/logics/configs/appearance/useUiScaling.js
Normal file
24
src-ui/logics/configs/appearance/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,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user