diff --git a/MultilineGreyText/StatusBar.cs b/MultilineGreyText/StatusBar.cs index 053f6fb..4381f58 100644 --- a/MultilineGreyText/StatusBar.cs +++ b/MultilineGreyText/StatusBar.cs @@ -40,6 +40,7 @@ public void ShowDefaultStatusBar(){ stack.Children.Clear(); stack.Background = transparentBrush; stack.Children.Add(CreateText("|{ Refact")); + stack.ToolTip = null; // Clear the tooltip when idle } public void ShowStatusBarError(string error){ @@ -47,7 +48,7 @@ public void ShowStatusBarError(string error){ stack.Background = errorBrush; stack.Children.Add(CreateImage("debug-disconnect.png")); stack.Children.Add(CreateText("Refact.ai")); - stack.ToolTip = createToolTip(text: error, stack); + ShowErrorToolTip(error); // Display the error message in a tooltip } public void ShowLoadingSymbol(){ @@ -92,5 +93,13 @@ Image CreateImage(string filename){ return myImage; } + // Method to show the error message in a tooltip + private void ShowErrorToolTip(string errorMessage) + { + ToolTip errorToolTip = new ToolTip(); + errorToolTip.Content = errorMessage; + errorToolTip.IsOpen = true; + stack.ToolTip = errorToolTip; + } } }