From 02e082a2bdf021241d7df795e39113a732701e7e Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Sun, 7 Dec 2025 17:41:32 +1000 Subject: [PATCH] refactor more StringNames --- .../Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs | 6 +++--- src/SharpIDE.Godot/InputStringNames.cs | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs index 12cba00..864ded5 100644 --- a/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs +++ b/src/SharpIDE.Godot/Features/CodeEditor/SharpIdeCodeEdit_SymbolHover.cs @@ -50,7 +50,7 @@ public partial class SharpIdeCodeEdit } }; // To debug location, make type a PopupPanel, and uncomment - //symbolNameHoverWindow.AddThemeStyleboxOverride("panel", new StyleBoxFlat { BgColor = new Color(1, 0, 0, 0.5f) }); + //symbolNameHoverWindow.AddThemeStyleboxOverride(ThemeStringNames.Panel, new StyleBoxFlat { BgColor = new Color(1, 0, 0, 0.5f) }); var startSymbolCharRect = GetRectAtLineColumn(linePositionSpan.Value.Start.Line, linePositionSpan.Value.Start.Character + 1); var endSymbolCharRect = GetRectAtLineColumn(linePositionSpan.Value.End.Line, linePositionSpan.Value.End.Character); @@ -122,7 +122,7 @@ public partial class SharpIdeCodeEdit ContentMarginRight = 12 }; var panel = new PanelContainer(); - panel.AddThemeStyleboxOverride("panel", styleBox); + panel.AddThemeStyleboxOverride(ThemeStringNames.Panel, styleBox); var symbolInfoNode = roslynSymbol switch { @@ -140,7 +140,7 @@ public partial class SharpIdeCodeEdit panel.AddChild(symbolInfoNode); var vboxContainer = new VBoxContainer(); - vboxContainer.AddThemeConstantOverride("separation", 0); + vboxContainer.AddThemeConstantOverride(ThemeStringNames.Separation, 0); vboxContainer.AddChild(panel); tooltipWindow.AddChild(vboxContainer); tooltipWindow.ChildControlsChanged(); diff --git a/src/SharpIDE.Godot/InputStringNames.cs b/src/SharpIDE.Godot/InputStringNames.cs index a73b8e2..7907e5f 100644 --- a/src/SharpIDE.Godot/InputStringNames.cs +++ b/src/SharpIDE.Godot/InputStringNames.cs @@ -5,8 +5,8 @@ namespace SharpIDE.Godot; public static class InputStringNames { public static readonly StringName RenameSymbol = nameof(RenameSymbol); - public static readonly StringName CodeFixes = "CodeFixes"; - public static readonly StringName StepOver = "StepOver"; + public static readonly StringName CodeFixes = nameof(CodeFixes); + public static readonly StringName StepOver = nameof(StepOver); public static readonly StringName FindInFiles = nameof(FindInFiles); public static readonly StringName FindFiles = nameof(FindFiles); public static readonly StringName SaveFile = nameof(SaveFile); @@ -21,4 +21,7 @@ public static class ThemeStringNames public static readonly StringName FontSelectedColor = "font_selected_color"; public static readonly StringName FontHoveredColor = "font_hovered_color"; public static readonly StringName FontHoveredSelectedColor = "font_hovered_selected_color"; + + public static readonly StringName Panel = "panel"; + public static readonly StringName Separation = "separation"; } \ No newline at end of file