Browse Source

adjust the display conditions of some configuration options.

oldj 4 years ago
parent
commit
56ec6b8834
3 changed files with 20 additions and 14 deletions
  1. 2 2
      scripts/make.js
  2. 17 11
      src/renderer/components/Pref/General.tsx
  3. 1 1
      src/version.json

+ 2 - 2
scripts/make.js

@@ -208,8 +208,8 @@ const makeDefault = async () => {
         artifactName: '${productName}_${version}(${buildVersion}).${ext}'
       },
       win: {
-        icon: 'assets/app.ico',
-        requestedExecutionLevel: 'requireAdministrator'
+        icon: 'assets/app.ico'
+        //requestedExecutionLevel: 'requireAdministrator'
       },
       nsis: {
         installerIcon: 'assets/installer-icon.ico',

+ 17 - 11
src/renderer/components/Pref/General.tsx

@@ -17,6 +17,7 @@ import {
   Select,
   VStack,
 } from '@chakra-ui/react'
+import { agent } from '@renderer/core/agent'
 import { ConfigsType, ThemeType } from '@root/common/default_configs'
 import { LocaleName } from '@root/common/i18n'
 import React from 'react'
@@ -30,6 +31,7 @@ interface IProps {
 const General = (props: IProps) => {
   const { data, onChange } = props
   const { i18n, lang } = useModel('useI18n')
+  const { platform } = agent
 
   const label_width = 20
 
@@ -63,7 +65,7 @@ const General = (props: IProps) => {
         </HStack>
       </FormControl>
 
-      <FormControl>
+      <FormControl pb={6}>
         <HStack>
           <FormLabel w={label_width}>{lang.choice_mode}</FormLabel>
           <VStack align="left">
@@ -85,16 +87,20 @@ const General = (props: IProps) => {
         </HStack>
       </FormControl>
 
-      <FormControl pt={6}>
-        <HStack>
-          <Checkbox
-            isChecked={data.show_title_on_tray}
-            onChange={e => onChange({ show_title_on_tray: e.target.checked })}
-          >
-            {lang.show_title_on_tray}
-          </Checkbox>
-        </HStack>
-      </FormControl>
+      {
+        platform === 'darwin' ? (
+          <FormControl>
+            <HStack>
+              <Checkbox
+                isChecked={data.show_title_on_tray}
+                onChange={e => onChange({ show_title_on_tray: e.target.checked })}
+              >
+                {lang.show_title_on_tray}
+              </Checkbox>
+            </HStack>
+          </FormControl>
+        ) : null
+      }
 
       <FormControl>
         <HStack>

+ 1 - 1
src/version.json

@@ -1 +1 @@
-[4, 0, 0, 6023]
+[4, 0, 0, 6025]