mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-09 03:37:45 +03:00
feat: add option to start minimized in user settings
This commit is contained in:
parent
6dd454a982
commit
7af56cd7cc
@ -253,7 +253,8 @@
|
|||||||
"must_be_valid_url": "The source must be a valid URL",
|
"must_be_valid_url": "The source must be a valid URL",
|
||||||
"blocked_users": "Blocked users",
|
"blocked_users": "Blocked users",
|
||||||
"user_unblocked": "User has been unblocked",
|
"user_unblocked": "User has been unblocked",
|
||||||
"enable_achievement_notifications": "When an achievement in unlocked"
|
"enable_achievement_notifications": "When an achievement in unlocked",
|
||||||
|
"launch_minimized": "Launch Hydra minimized"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"download_complete": "Download complete",
|
"download_complete": "Download complete",
|
||||||
|
@ -249,7 +249,8 @@
|
|||||||
"must_be_valid_url": "A fonte deve ser uma URL válida",
|
"must_be_valid_url": "A fonte deve ser uma URL válida",
|
||||||
"blocked_users": "Usuários bloqueados",
|
"blocked_users": "Usuários bloqueados",
|
||||||
"user_unblocked": "Usuário desbloqueado",
|
"user_unblocked": "Usuário desbloqueado",
|
||||||
"enable_achievement_notifications": "Quando uma conquista é desbloqueada"
|
"enable_achievement_notifications": "Quando uma conquista é desbloqueada",
|
||||||
|
"launch_minimized": "Iniciar o Hydra minimizado"
|
||||||
},
|
},
|
||||||
"notifications": {
|
"notifications": {
|
||||||
"download_complete": "Download concluído",
|
"download_complete": "Download concluído",
|
||||||
|
@ -17,6 +17,7 @@ export function SettingsBehavior() {
|
|||||||
const [form, setForm] = useState({
|
const [form, setForm] = useState({
|
||||||
preferQuitInsteadOfHiding: false,
|
preferQuitInsteadOfHiding: false,
|
||||||
runAtStartup: false,
|
runAtStartup: false,
|
||||||
|
startMinimized: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useTranslation("settings");
|
const { t } = useTranslation("settings");
|
||||||
@ -26,10 +27,13 @@ export function SettingsBehavior() {
|
|||||||
setForm({
|
setForm({
|
||||||
preferQuitInsteadOfHiding: userPreferences.preferQuitInsteadOfHiding,
|
preferQuitInsteadOfHiding: userPreferences.preferQuitInsteadOfHiding,
|
||||||
runAtStartup: userPreferences.runAtStartup,
|
runAtStartup: userPreferences.runAtStartup,
|
||||||
|
startMinimized: userPreferences.startMinimized,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [userPreferences]);
|
}, [userPreferences]);
|
||||||
|
|
||||||
|
console.log(userPreferences?.startMinimized);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.electron.isPortableVersion().then((isPortableVersion) => {
|
window.electron.isPortableVersion().then((isPortableVersion) => {
|
||||||
setShowRunAtStartup(!isPortableVersion);
|
setShowRunAtStartup(!isPortableVersion);
|
||||||
@ -63,6 +67,20 @@ export function SettingsBehavior() {
|
|||||||
checked={form.runAtStartup}
|
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…
Reference in New Issue
Block a user