From a2db8c56536d287b4a82b77aa81303dac78e6836 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 7 Nov 2011 02:10:35 +0000 Subject: [PATCH] Truncate the message to locate the source path if it currently wouldn't fit within the string view's bounds. Partially resolves #8094. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43207 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../user_interface/gui/team_window/TeamWindow.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp index 1a72850d5c..8ed0f3e8a2 100644 --- a/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp +++ b/src/apps/debugger/user_interface/gui/team_window/TeamWindow.cpp @@ -1108,6 +1108,7 @@ TeamWindow::_HandleSourceCodeChanged() SourceCode* sourceCode = fActiveFunction->GetFunction()->GetSourceCode(); LocatableFile* sourceFile = NULL; BString sourceText; + BString truncatedText; if (sourceCode == NULL) sourceCode = fActiveFunction->GetSourceCode(); @@ -1121,7 +1122,12 @@ TeamWindow::_HandleSourceCodeChanged() && sourceFile != NULL) { sourceText.Prepend("Click to locate source file '"); sourceText += "'"; - fSourcePathView->SetText(sourceText.String()); + truncatedText = sourceText; + fSourcePathView->TruncateString(&truncatedText, B_TRUNCATE_MIDDLE, + fSourcePathView->Bounds().Width()); + if (sourceText != truncatedText) + fSourcePathView->SetToolTip(sourceText.String()); + fSourcePathView->SetText(truncatedText.String()); } else if (sourceFile != NULL) { sourceText.Prepend("File: "); fSourcePathView->SetText(sourceText.String());