浏览代码

Always show the tab list. #593

oldj 3 年之前
父节点
当前提交
b89cd43fcb
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. 3 2
      src/renderer/components/Pref/index.tsx
  2. 9 0
      src/renderer/components/Pref/styles.less

+ 3 - 2
src/renderer/components/Pref/index.tsx

@@ -32,6 +32,7 @@ import { BiSliderAlt } from 'react-icons/bi'
 import Advanced from './Advanced'
 import Commands from './Commands'
 import General from './General'
+import styles from './styles.less'
 
 interface Props {}
 
@@ -91,7 +92,7 @@ const PreferencePanel = (props: Props) => {
         </DrawerHeader>
 
         <DrawerBody>
-          <Tabs>
+          <Tabs className={styles.tabs}>
             <TabList>
               <Tab>{lang.general}</Tab>
               <Tab>{lang.commands}</Tab>
@@ -99,7 +100,7 @@ const PreferencePanel = (props: Props) => {
               <Tab>{lang.advanced}</Tab>
             </TabList>
 
-            <TabPanels>
+            <TabPanels className={styles.tab_panels}>
               <TabPanel>
                 <General data={data} onChange={onUpdate} />
               </TabPanel>

+ 9 - 0
src/renderer/components/Pref/styles.less

@@ -5,6 +5,15 @@
   color: inherit;
 }
 
+.tabs {
+  height: 100%;
+}
+
+.tab_panels {
+  height: calc(100% - 37px);
+  overflow: auto;
+}
+
 :global {
   label {
     span.chakra-radio__control {