A lightweight, macOS-style dock for Windows 11, with glass visuals, smooth magnification, and Genie effect.
feat: implement Windows animation settings and update genie effect behavior
CristianOlivera13d13aface0dc
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex de2f80a..5f5145e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,6 +10,10 @@ copia la sección de la versión que se publica a la release de GitHub.### English+- The Genie effect follows Windows' "Animation effects" setting, which+ "Adjust for best performance" also turns off, and did so silently: the+ switch in Settings stayed on and nothing happened. Settings now says when+ Windows animations are off and opens the right Windows page to turn them on.- A pixel crab comes out for moments worth it, and only then: it hops with aheart under an AI provider whose limit just reset, trembles with a droppast 90 %, falls asleep at 100 %, scurries along the dock when the charger@@ -28,6 +32,11 @@ copia la sección de la versión que se publica a la release de GitHub.### Español+- El efecto genio sigue el ajuste «Efectos de animación» de Windows, que también+ apaga «Ajustar para obtener el mejor rendimiento», y lo hacía en silencio: el+ interruptor de Ajustes seguía activo y no pasaba nada. Ahora Ajustes avisa+ cuando las animaciones de Windows están desactivadas y abre la página de+ Windows correcta para activarlas.- Un cangrejo pixelado aparece en los momentos que lo merecen, y soloentonces: salta con un corazón bajo el proveedor de IA cuyo límite se acabade reiniciar, tiembla con una gota al pasar del 90 %, se duerme al llegar aldiff --git a/apps/settings/src-tauri/src/main.rs b/apps/settings/src-tauri/src/main.rsindex 765c25a..f82ed43 100644--- a/apps/settings/src-tauri/src/main.rs+++ b/apps/settings/src-tauri/src/main.rs@@ -57,6 +57,25 @@ fn set_config(config: Config) -> Result<Config, String> {Ok(config)}+/// Windows' own animation setting, which the genie follows: off, the+/// genie does not play, and the window says so.+#[tauri::command]+fn windows_animations() -> bool {+ muelle_shell::system::animations_enabled()+}++/// The page of Windows Settings with that switch: "Animation effects" on+/// Windows 11, "Show animations in Windows" on Windows 10.+#[tauri::command]+fn open_animation_settings() -> Result<(), String> {+ let page = if muelle_shell::system::is_windows_11() {+ "ms-settings:easeofaccess-visualeffects"+ } else {+ "ms-settings:easeofaccess-display"+ };+ launcher::open(page).map_err(|error| error.to_string())+}+#[tauri::command]fn get_autostart() -> bool {autostart::is_enabled()@@ -236,6 +255,8 @@ fn main() {set_config,get_autostart,set_autostart,+ windows_animations,+ open_animation_settings,check_update,install_update,open_release_notesdiff --git a/apps/settings/src/App.tsx b/apps/settings/src/App.tsxindex d48f273..8d586b3 100644--- a/apps/settings/src/App.tsx+++ b/apps/settings/src/App.tsx@@ -11,6 +11,8 @@ import {checkUpdate,defaultConfig,getAutostart,+ openAnimationSettings,+ windowsAnimations,installUpdate,loadConfig,openReleaseNotes,@@ -61,6 +63,19 @@ function textsFor(language: Language): Texts {export function App() {const [config, setConfig] = useState<Config | null>(null);const [autostart, setAutostartState] = useState(false);+ // Assumed on until asked, so the notice never flashes on a normal PC.+ const [animations, setAnimations] = useState(true);+ useEffect(() => {+ const check = () => {+ windowsAnimations()+ .then(setAnimations)+ .catch(() => {});+ };+ check();+ // Back from Windows Settings after turning them on: the notice goes.+ window.addEventListener("focus", check);+ return () => window.removeEventListener("focus", check);+ }, []);const [section, setSection] = useState<SectionId>("dock");const [failed, setFailed] = useState(false);const [version, setVersion] = useState("");@@ -309,6 +324,11 @@ export function App() {onChange={(genie) => update({ genie })}/></Row>+ <SubRow label={t.genieOff} hint={t.genieOffHint} open={config.genie && !animations}>+ <button type="button" className="push" onClick={() => void openAnimationSettings()}>+ {t.genieOffAction}+ </button>+ </SubRow><Row label={t.showMinimized} hint={t.showMinimizedHint}><Togglelabel={t.showMinimized}diff --git a/apps/settings/src/config.ts b/apps/settings/src/config.tsindex e1b0a5c..a8efe77 100644--- a/apps/settings/src/config.ts+++ b/apps/settings/src/config.ts@@ -32,6 +32,9 @@ export const loadConfig = () => invoke<Config>("get_config");export const defaultConfig = () => invoke<Config>("default_config");export const saveConfig = (config: Config) => invoke<Config>("set_config", { config });export const getAutostart = () => invoke<boolean>("get_autostart");+/** Windows' animation setting; the genie only plays while it is on. */+export const windowsAnimations = () => invoke<boolean>("windows_animations");+export const openAnimationSettings = () => invoke<void>("open_animation_settings");export const setAutostart = (enabled: boolean) => invoke<void>("set_autostart", { enabled });export interface UpdateInfo {version: string;diff --git a/apps/settings/src/i18n/en.json b/apps/settings/src/i18n/en.jsonindex 9733ee0..9c32b32 100644--- a/apps/settings/src/i18n/en.json+++ b/apps/settings/src/i18n/en.json@@ -11,6 +11,9 @@"autoHideHint": "It reappears when you touch the bottom edge of the screen.","genie": "Genie effect","genieHint": "While it is on, windows do not use the Windows animations for maximizing or closing.",+ "genieOff": "Windows animations are off",+ "genieOffHint": "The genie follows Windows' \"Animation effects\" setting, as every app should, so it does not play. Choosing \"Adjust for best performance\" in Windows turns it off too.",+ "genieOffAction": "Open Windows settings","showMinimized": "Show minimized windows","showMinimizedHint": "As thumbnails on the right side of the Dock, instead of inside their app's icon.","menuBar": "Menu bar",diff --git a/apps/settings/src/i18n/es.json b/apps/settings/src/i18n/es.jsonindex 15bd556..d1d0b12 100644--- a/apps/settings/src/i18n/es.json+++ b/apps/settings/src/i18n/es.json@@ -11,6 +11,9 @@"autoHideHint": "Reaparece al tocar el borde inferior de la pantalla.","genie": "Efecto genio","genieHint": "Mientras está activo, las ventanas no usan las animaciones de Windows al maximizar ni al cerrar.",+ "genieOff": "Las animaciones de Windows están desactivadas",+ "genieOffHint": "El genio sigue el ajuste «Efectos de animación» de Windows, como debe hacer toda app, así que no se reproduce. La opción «Ajustar para obtener el mejor rendimiento» también lo apaga.",+ "genieOffAction": "Abrir la configuración de Windows","showMinimized": "Mostrar ventanas minimizadas","showMinimizedHint": "Como miniaturas a la derecha del Dock, en lugar de dentro del icono de su app.","menuBar": "Barra superior",