mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 00:46:12 +02:00
Add rotation setting to plugins
This commit is contained in:
@@ -241,21 +241,21 @@ public partial class PluginWindow : Window, IPluginWindow
|
||||
assemblyLoadContext = CreateAssemblyLoadContext();
|
||||
|
||||
// Show busy indicator
|
||||
await Dispatcher.InvokeAsync(() => busyMask.IsBusy = true);
|
||||
_ = await Dispatcher.InvokeAsync(() => busyMask.IsBusy = true);
|
||||
|
||||
// Reload the plugin
|
||||
await ExecuteSource();
|
||||
|
||||
// Hide busy indicator
|
||||
await Dispatcher.InvokeAsync(() => busyMask.IsBusy = false);
|
||||
_ = await Dispatcher.InvokeAsync(() => busyMask.IsBusy = false);
|
||||
|
||||
App.Logger.LogInfo($"\"{PluginMetadata.Name}\" - Plugin reloaded successfully", source: "Plugin");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.LogError($"\"{PluginMetadata.Name}\" - Failed to reload plugin: {ex}", source: "Plugin");
|
||||
|
||||
await Dispatcher.InvokeAsync(async () =>
|
||||
|
||||
_ = await Dispatcher.InvokeAsync(async () =>
|
||||
{
|
||||
Wpf.Ui.Controls.MessageBox messageBox = new Wpf.Ui.Controls.MessageBox
|
||||
{
|
||||
@@ -525,11 +525,13 @@ public partial class PluginWindow : Window, IPluginWindow
|
||||
{
|
||||
SetHorizontalAlignment();
|
||||
SetVerticalAlignment();
|
||||
SetRotation();
|
||||
SetThemeOverride();
|
||||
SetThemeOverrideItems();
|
||||
|
||||
pluginClassInstance.horizontalAlignment.OnValueChanged += SetHorizontalAlignment;
|
||||
pluginClassInstance.verticalAlignment.OnValueChanged += SetVerticalAlignment;
|
||||
pluginClassInstance.rotation.OnValueChanged += SetRotation;
|
||||
pluginClassInstance.themeOverride.OnValueChanged += SetThemeOverride;
|
||||
|
||||
DesktopMagicSettings desktopMagicSettings = MainWindowDataContext.GetSettings();
|
||||
@@ -564,6 +566,11 @@ public partial class PluginWindow : Window, IPluginWindow
|
||||
border.HorizontalAlignment = horizontalAlignment;
|
||||
}
|
||||
|
||||
void SetRotation()
|
||||
{
|
||||
image.LayoutTransform = new RotateTransform(pluginClassInstance.rotation.Value);
|
||||
}
|
||||
|
||||
void SetThemeOverride()
|
||||
{
|
||||
if (pluginClassInstance.themeOverride.Value == "<None>")
|
||||
|
||||
@@ -23,7 +23,10 @@ public abstract class Plugin
|
||||
[Setting("desktopmagic-vertical-alignment", "Vertical Alignment", -998)]
|
||||
internal ComboBox verticalAlignment = new ComboBox("Center", "Top", "Bottom");
|
||||
|
||||
[Setting("theme-override", "Theme Override", -997)]
|
||||
[Setting("rotation", "Rotation", -997)]
|
||||
internal IntegerUpDown rotation = new IntegerUpDown(-360, 360, 0);
|
||||
|
||||
[Setting("theme-override", "Theme Override", -996)]
|
||||
internal ComboBox themeOverride = new ComboBox("<None>");
|
||||
|
||||
private IPluginData application = null!;
|
||||
|
||||
Reference in New Issue
Block a user