[Update] Add feature Restore Main Window Geometry.

Note: the toggle-able setting, to restore or don't, has removed for now.
This commit is contained in:
Sakamoto Shiina
2024-10-13 03:57:23 +09:00
parent 0c3b36a43d
commit 0582091908
12 changed files with 183 additions and 22 deletions

View File

@@ -6,6 +6,7 @@ import { ConfigPage } from "./config_page/ConfigPage";
import styles from "./App.module.scss";
export const App = () => {
const { WindowGeometryController } = useWindow();
return (
<div className={styles.container}>
<StartPythonFacadeComponent />
@@ -14,6 +15,7 @@ export const App = () => {
<UiSizeController />
<FontFamilyController />
<TransparencyController />
<WindowGeometryController />
<WindowTitleBar />
<div className={styles.pages_wrapper}>
@@ -24,6 +26,11 @@ export const App = () => {
);
};
import {
useWindow,
useVolume,
useIsOpenedConfigPage,
} from "@logics_common";
import {
useSoftwareVersion,
@@ -59,6 +66,8 @@ const StartPythonFacadeComponent = () => {
const hasRunRef = useRef(false);
const { asyncFetchFonts } = useAsyncFetchFonts();
const { fetchAndUpdateWindowGeometry } = useWindow();
const { getMicHostList } = useMicHostList();
const { getMicDeviceList } = useMicDeviceList();
const { getSpeakerDeviceList } = useSpeakerDeviceList();
@@ -97,6 +106,8 @@ const StartPythonFacadeComponent = () => {
asyncStartPython().then(() => {
startFeedingToWatchDog();
fetchAndUpdateWindowGeometry();
getUiLanguage();
getUiScaling();
getMessageLogUiScaling();
@@ -156,10 +167,6 @@ const UiLanguageController = () => {
};
import { useStore_MainFunctionsStateMemory } from "@store";
import {
useVolume,
useIsOpenedConfigPage,
} from "@logics_common";
const ConfigPageCloseTrigger = () => {
const { currentIsOpenedConfigPage } = useIsOpenedConfigPage();

View File

@@ -9,12 +9,13 @@ import {
useMessageLogUiScaling,
useSelectedFontFamily,
useTransparency,
// useRestoreWindowGeometry,
} from "@logics_configs";
export const Appearance = () => {
const { t } = useTranslation();
const {
DropdownMenuContainer,
// DropdownMenuContainer,
// SliderContainer,
// CheckboxContainer,
// SwitchboxContainer,
@@ -33,6 +34,7 @@ export const Appearance = () => {
<MessageLogUiScalingContainer />
<FontFamilyContainer />
<TransparencyContainer />
{/* <RestoreWindowGeometryContainer /> */}
@@ -253,4 +255,20 @@ const TransparencyContainer = () => {
track={false}
/>
);
};
};
// import { CheckboxContainer } from "../components/useSettingBox";
// const RestoreWindowGeometryContainer = () => {
// const { t } = useTranslation();
// const { currentRestoreWindowGeometry, toggleRestoreWindowGeometry } = useRestoreWindowGeometry();
// return (
// <CheckboxContainer
// label={t("config_page.to_restore_main_page_geometry.label")}
// desc={t("config_page.to_restore_main_page_geometry.desc")}
// variable={currentRestoreWindowGeometry}
// toggleFunction={toggleRestoreWindowGeometry}
// />
// );
// };

View File

@@ -45,17 +45,16 @@ export const SliderContainer = (props) => {
);
};
export const CheckboxContainer = (props) => {
return (
<div className={styles.container}>
<LabelComponent label={props.label} desc={props.desc} />
<Checkbox {...props}/>
</div>
);
};
export const useSettingBox = () => {
const CheckboxContainer = (props) => {
return (
<div className={styles.container}>
<LabelComponent label={props.label} desc={props.desc} />
<Checkbox {...props}/>
</div>
);
};
const SwitchboxContainer = (props) => {
return (
<div className={styles.container}>