diff --git a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/icon.lua b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/icon.lua index dc8250ba..c10dd294 100644 --- a/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/icon.lua +++ b/app/MindWork AI Studio/Plugins/languages/de-de-43065dbc-78d0-45b7-92be-f14c2926e2dc/icon.lua @@ -1,5 +1,11 @@ -SVG = [[ - - - +SVG = [[ + + + + + + + + + ]] \ No newline at end of file diff --git a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/icon.lua b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/icon.lua index d6cea58c..75320473 100644 --- a/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/icon.lua +++ b/app/MindWork AI Studio/Plugins/languages/en-us-97dfb1ba-50c4-4440-8dfa-6575daf543c8/icon.lua @@ -1,25 +1,12 @@ -SVG = [[ - - - - - - - - - - - - - - - - - - - - - - - +SVG = [[ + + + + + + + + + + ]] \ No newline at end of file diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs new file mode 100644 index 00000000..5c6140c8 --- /dev/null +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.Icon.cs @@ -0,0 +1,45 @@ +namespace AIStudio.Tools.PluginSystem; + +public abstract partial class PluginBase +{ + private const string DEFAULT_ICON_SVG = + """ + + """; + + #region Initialization-related methods + + /// + /// Tries to initialize the icon of the plugin. + /// + /// + /// When no icon is specified, the default icon will be used. + /// + /// The error message, when the icon could not be read. + /// The read icon as SVG. + /// True, when the icon could be read successfully. + + // ReSharper disable once OutParameterValueIsAlwaysDiscarded.Local + // ReSharper disable once UnusedMethodReturnValue.Local + private bool TryInitIconSVG(out string message, out string iconSVG) + { + if (!this.state.Environment["ICON_SVG"].TryRead(out iconSVG)) + { + iconSVG = DEFAULT_ICON_SVG; + message = "The field ICON_SVG does not exist or is not a valid string."; + return true; + } + + if (string.IsNullOrWhiteSpace(iconSVG)) + { + iconSVG = DEFAULT_ICON_SVG; + message = "The field ICON_SVG is empty. The icon must be a non-empty string."; + return true; + } + + message = string.Empty; + return true; + } + + #endregion +} \ No newline at end of file diff --git a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs index 61c42354..daa7a16d 100644 --- a/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs +++ b/app/MindWork AI Studio/Tools/PluginSystem/PluginBase.cs @@ -6,7 +6,7 @@ namespace AIStudio.Tools.PluginSystem; /// /// Represents the base of any AI Studio plugin. /// -public abstract class PluginBase : IPluginMetadata +public abstract partial class PluginBase : IPluginMetadata { private static readonly Guid[] MANDATORY_INTERNAL_PLUGINS = [ @@ -448,31 +448,7 @@ public abstract class PluginBase : IPluginMetadata message = string.Empty; return true; } - - /// - /// Tries to initialize the icon of the plugin. - /// - /// - /// When no icon is specified, the default icon will be used. - /// - /// The error message, when the icon could not be read. - /// The read icon as SVG. - /// True, when the icon could be read successfully. - // ReSharper disable once OutParameterValueIsAlwaysDiscarded.Local - // ReSharper disable once UnusedMethodReturnValue.Local - private bool TryInitIconSVG(out string message, out string iconSVG) - { - if (!this.state.Environment["ICON_SVG"].TryRead(out iconSVG)) - { - iconSVG = Icons.Material.TwoTone.Extension; - message = "The field ICON_SVG does not exist or is not a valid string."; - return false; - } - - message = string.Empty; - return true; - } - + /// /// Tries to initialize the UI text content of the plugin. /// diff --git a/app/MindWork AI Studio/wwwroot/app.css b/app/MindWork AI Studio/wwwroot/app.css index 8159e22c..af0e139a 100644 --- a/app/MindWork AI Studio/wwwroot/app.css +++ b/app/MindWork AI Studio/wwwroot/app.css @@ -41,8 +41,8 @@ } .plugin-icon-container svg { - width: 200%; - height: 200%; + width: 100%; + height: 100%; } .mud-popover-open.InnerScrollingFix {