diff --git a/src-ui/app/config_page/setting_section/SettingSection.jsx b/src-ui/app/config_page/setting_section/SettingSection.jsx index c39e6221..b70b7763 100644 --- a/src-ui/app/config_page/setting_section/SettingSection.jsx +++ b/src-ui/app/config_page/setting_section/SettingSection.jsx @@ -2,14 +2,22 @@ import { useRef, useLayoutEffect, useEffect } from "react"; import styles from "./SettingSection.module.scss"; import { SettingBox } from "./setting_box/SettingBox"; -import { store } from "@store"; +import { store, useStore_SelectedConfigTabId } from "@store"; +import { useSettingBoxScrollPosition } from "@logics_configs"; export const SettingSection = () => { + const { currentSelectedConfigTabId } = useStore_SelectedConfigTabId(); + const { resetScrollPosition } = useSettingBoxScrollPosition(); const scrollContainerRef = useRef(null); + useLayoutEffect(() => { store.setting_box_scroll_container = scrollContainerRef; }, []); + useEffect(() => { + resetScrollPosition(); + }, [currentSelectedConfigTabId.data]); + return (
diff --git a/src-ui/app/config_page/setting_section/setting_box/_components/deepl_auth_key/DeeplAuthKey.module.scss b/src-ui/app/config_page/setting_section/setting_box/_components/deepl_auth_key/DeeplAuthKey.module.scss index 575ec8bc..915f300c 100644 --- a/src-ui/app/config_page/setting_section/setting_box/_components/deepl_auth_key/DeeplAuthKey.module.scss +++ b/src-ui/app/config_page/setting_section/setting_box/_components/deepl_auth_key/DeeplAuthKey.module.scss @@ -4,6 +4,7 @@ justify-content: center; align-items: center; gap: 1rem; + flex-shrink: 0; } .entry_section_wrapper { @@ -72,13 +73,14 @@ } .open_webpage_button { - padding: 0.6rem 3.2rem; + padding: 0.6rem 2.8rem; display: flex; gap: 1rem; justify-content: center; align-items: center; border-radius: 0.4rem; cursor: pointer; + flex-shrink: 0; &:hover { background-color: var(--dark_825_color); } @@ -95,4 +97,5 @@ .external_link_svg { color: var(--dark_500_color); width: 1.6rem; + flex-shrink: 0; } \ No newline at end of file diff --git a/src-ui/app/config_page/setting_section/setting_box/_components/label_component/LabelComponent.module.scss b/src-ui/app/config_page/setting_section/setting_box/_components/label_component/LabelComponent.module.scss index 7aa82d3c..c49055a8 100644 --- a/src-ui/app/config_page/setting_section/setting_box/_components/label_component/LabelComponent.module.scss +++ b/src-ui/app/config_page/setting_section/setting_box/_components/label_component/LabelComponent.module.scss @@ -10,6 +10,7 @@ font-weight: 400; color: var(--dark_basic_text_color); white-space: nowrap; + width: max-content; } .desc { diff --git a/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.jsx b/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.jsx index 4a5e6edf..3e896a59 100644 --- a/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/_components/slider/Slider.jsx @@ -5,7 +5,7 @@ import { clsx } from "clsx"; export const Slider = (props) => { return ( -
+
{ return ( - + ); }; diff --git a/src-ui/app/config_page/setting_section/setting_box/_templates/Templates.module.scss b/src-ui/app/config_page/setting_section/setting_box/_templates/Templates.module.scss index 66bb6464..cab3118a 100644 --- a/src-ui/app/config_page/setting_section/setting_box/_templates/Templates.module.scss +++ b/src-ui/app/config_page/setting_section/setting_box/_templates/Templates.module.scss @@ -4,7 +4,7 @@ justify-content: space-between; align-items: center; padding: 2rem; - gap: 10rem; + gap: 2rem; &.flex_column { flex-direction: column; } diff --git a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx index cf19c1ab..e1197b22 100644 --- a/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx +++ b/src-ui/app/config_page/setting_section/setting_box/vr/Vr.jsx @@ -199,6 +199,7 @@ const PositionControls = ({settings, onchangeFunction, selectFunction, ui_config

{

{

{

{t("config_page.vr.display_duration")}

{

{t("config_page.vr.fadeout_duration")}

{ } }; const restoreScrollPosition = () => { - if (store.setting_box_scroll_container.current) { updateSettingBoxScrollPosition((pre) => { store.setting_box_scroll_container.current.scrollTop = pre.data; return pre.data; }) } - }; + const resetScrollPosition = () => { + if (store.setting_box_scroll_container.current) { + store.setting_box_scroll_container.current.scrollTop = 0; + updateSettingBoxScrollPosition(0); + } + } + return { saveScrollPosition, restoreScrollPosition, + resetScrollPosition, currentSettingBoxScrollPosition, updateSettingBoxScrollPosition, };