mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: add option to start minimized in user settings
This commit is contained in:
parent
6dd454a982
commit
7af56cd7cc
3 changed files with 22 additions and 2 deletions
|
@ -17,6 +17,7 @@ export function SettingsBehavior() {
|
|||
const [form, setForm] = useState({
|
||||
preferQuitInsteadOfHiding: false,
|
||||
runAtStartup: false,
|
||||
startMinimized: false,
|
||||
});
|
||||
|
||||
const { t } = useTranslation("settings");
|
||||
|
@ -26,10 +27,13 @@ export function SettingsBehavior() {
|
|||
setForm({
|
||||
preferQuitInsteadOfHiding: userPreferences.preferQuitInsteadOfHiding,
|
||||
runAtStartup: userPreferences.runAtStartup,
|
||||
startMinimized: userPreferences.startMinimized,
|
||||
});
|
||||
}
|
||||
}, [userPreferences]);
|
||||
|
||||
console.log(userPreferences?.startMinimized);
|
||||
|
||||
useEffect(() => {
|
||||
window.electron.isPortableVersion().then((isPortableVersion) => {
|
||||
setShowRunAtStartup(!isPortableVersion);
|
||||
|
@ -63,6 +67,20 @@ export function SettingsBehavior() {
|
|||
checked={form.runAtStartup}
|
||||
/>
|
||||
)}
|
||||
|
||||
{showRunAtStartup && (
|
||||
<div style={{ opacity: form.runAtStartup ? 1 : 0.5 }}>
|
||||
<CheckboxField
|
||||
label={t("launch_minimized")}
|
||||
style={{ cursor: form.runAtStartup ? "pointer" : "not-allowed" }}
|
||||
checked={form.runAtStartup && form.startMinimized}
|
||||
disabled={!form.runAtStartup}
|
||||
onChange={() => {
|
||||
handleChange({ startMinimized: !form.startMinimized });
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue