| | |
| | | "sample.wallpaper", |
| | | "sample.clock", |
| | | "sample.system-info", |
| | | "sample.audio-visualizer" |
| | | "sample.audio-visualizer", |
| | | "sample.llm-command-palette" |
| | | }; |
| | | |
| | | private readonly DesktopPaths _paths; |
| | |
| | | ClickThrough = manifest.DefaultLayout.ClickThrough, |
| | | Opacity = manifest.DefaultLayout.Opacity, |
| | | Scale = manifest.DefaultLayout.Scale, |
| | | DisplayPriority = manifest.DefaultLayout.DisplayPriority |
| | | DisplayLayer = manifest.DefaultLayout.DisplayLayer |
| | | }); |
| | | changed = true; |
| | | } |
| | |
| | | private static bool IsAudioVisualizer(PluginManifest manifest) |
| | | => string.Equals(manifest.Id, "sample.audio-visualizer", StringComparison.OrdinalIgnoreCase); |
| | | |
| | | private static bool IsLlmCommandPalette(PluginManifest manifest) |
| | | => string.Equals(manifest.Id, "sample.llm-command-palette", StringComparison.OrdinalIgnoreCase); |
| | | |
| | | private static double ResolveDefaultX(PluginManifest manifest) |
| | | => IsAudioVisualizer(manifest) ? 0 : manifest.DefaultLayout.X; |
| | | { |
| | | if (IsAudioVisualizer(manifest)) |
| | | { |
| | | return 0; |
| | | } |
| | | |
| | | if (IsLlmCommandPalette(manifest)) |
| | | { |
| | | var width = ResolveDefaultWidth(manifest); |
| | | return Math.Max(0, (SystemParameters.PrimaryScreenWidth - width) / 2); |
| | | } |
| | | |
| | | return manifest.DefaultLayout.X; |
| | | } |
| | | |
| | | private static double ResolveDefaultY(PluginManifest manifest) |
| | | => IsAudioVisualizer(manifest) ? SystemParameters.PrimaryScreenHeight * 2 / 3 : manifest.DefaultLayout.Y; |
| | | |
| | | private static double ResolveDefaultWidth(PluginManifest manifest) |
| | | => IsAudioVisualizer(manifest) ? SystemParameters.PrimaryScreenWidth : manifest.DefaultLayout.Width; |
| | | => IsAudioVisualizer(manifest) |
| | | ? SystemParameters.PrimaryScreenWidth |
| | | : IsLlmCommandPalette(manifest) |
| | | ? Math.Min(manifest.DefaultLayout.Width, SystemParameters.PrimaryScreenWidth * 0.72) |
| | | : manifest.DefaultLayout.Width; |
| | | |
| | | private static double ResolveDefaultHeight(PluginManifest manifest) |
| | | => IsAudioVisualizer(manifest) |