Update deps and add a setting for rounded corners on windows
This commit is contained in:
@@ -18,7 +18,7 @@ body {
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
@apply bg-[#1f1f1f];
|
||||
@apply bg-[#1f1f1f] rounded-lg;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
@@ -70,3 +70,7 @@ body {
|
||||
.close-button {
|
||||
@apply flex justify-center items-center absolute bg-[#323232] hover:bg-[#484848] text-2xl cursor-pointer text-gray-300 hover:text-white h-12 w-12 p-3 rounded-xl left-2 top-2 transition-colors border border-[#484848] hover:border-[#646464];
|
||||
}
|
||||
|
||||
*:focus {
|
||||
@apply outline-none;
|
||||
}
|
||||
|
||||
@@ -86,6 +86,11 @@ function App () {
|
||||
const versionsConfig = await readVersionsConfig()
|
||||
setDownloadedVersionsConfig(versionsConfig)
|
||||
setNormalConfig(normalConfig)
|
||||
if (platform() == 'windows') {
|
||||
invoke('windows_rounded_corners', {
|
||||
enabled: normalConfig.settings.useWindowsRoundedCorners
|
||||
})
|
||||
}
|
||||
setLoading(false)
|
||||
})()
|
||||
}, [])
|
||||
|
||||
@@ -3,12 +3,15 @@ import { Setting } from '../componets/Setting'
|
||||
import { writeNormalConfig } from '../util/BazookaManager'
|
||||
import { platform } from '@tauri-apps/plugin-os'
|
||||
import { SettingsProps } from '../types/SettingsProps'
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
export default function Settings ({ normalConfig }: SettingsProps) {
|
||||
const [checkForNewVersionOnLoad, setCheckForNewVersionOnLoad] =
|
||||
useState(false)
|
||||
const [useWineOnUnixWhenNeeded, setUseWineOnUnixWhenNeeded] = useState(false)
|
||||
const [allowNotifications, setAllowNotifications] = useState(false)
|
||||
const [useWineOnUnixWhenNeeded, setUseWineOnUnixWhenNeeded] = useState(false)
|
||||
const [useWindowsRoundedCorners, setUseWindowsRoundedCorners] =
|
||||
useState(false)
|
||||
const [loaded, setLoaded] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -21,6 +24,9 @@ export default function Settings ({ normalConfig }: SettingsProps) {
|
||||
normalConfig.settings.useWineOnUnixWhenNeeded
|
||||
)
|
||||
setAllowNotifications(normalConfig.settings.allowNotifications)
|
||||
setUseWindowsRoundedCorners(
|
||||
normalConfig.settings.useWindowsRoundedCorners
|
||||
)
|
||||
setLoaded(true)
|
||||
break
|
||||
}
|
||||
@@ -71,6 +77,23 @@ export default function Settings ({ normalConfig }: SettingsProps) {
|
||||
}}
|
||||
className={platform() == 'linux' ? '' : 'hidden'}
|
||||
/>
|
||||
<Setting
|
||||
label='Use rounded corners (if supported)'
|
||||
value={useWindowsRoundedCorners}
|
||||
onChange={async () => {
|
||||
while (normalConfig != null) {
|
||||
setUseWindowsRoundedCorners(!useWindowsRoundedCorners)
|
||||
normalConfig.settings.useWindowsRoundedCorners =
|
||||
!useWindowsRoundedCorners
|
||||
await writeNormalConfig(normalConfig)
|
||||
invoke('windows_rounded_corners', {
|
||||
enabled: !useWindowsRoundedCorners
|
||||
})
|
||||
break
|
||||
}
|
||||
}}
|
||||
className={platform() == 'windows' ? '' : 'hidden'}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -2,6 +2,7 @@ export class SettingsType {
|
||||
constructor (
|
||||
public checkForNewVersionOnLoad: boolean = true,
|
||||
public allowNotifications: boolean = true,
|
||||
public useWineOnUnixWhenNeeded: boolean = false
|
||||
public useWineOnUnixWhenNeeded: boolean = false,
|
||||
public useWindowsRoundedCorners: boolean = false
|
||||
) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user