Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-08-20 22:25:22 -0400
committerspingel2008-08-20 22:25:22 -0400
commitfd801766737c353bc51b821f5069b8b8269022d9 (patch)
treeb23a82f3c78fa3af72fde1391eba8bb598dba191
parente39da248df8a548ebc47082941d012a961036d66 (diff)
downloadorg.eclipse.mylyn.tasks-fd801766737c353bc51b821f5069b8b8269022d9.tar.gz
org.eclipse.mylyn.tasks-fd801766737c353bc51b821f5069b8b8269022d9.tar.xz
org.eclipse.mylyn.tasks-fd801766737c353bc51b821f5069b8b8269022d9.zip
NEW - bug 205861: improve tooltip presentation and content
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205861
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
index 0c043b292..9ac1ae176 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListToolTip.java
@@ -613,14 +613,12 @@ public class TaskListToolTip extends ToolTip {
textLabel.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
textLabel.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
textLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));
- textLabel.setText(TasksUiInternal.escapeLabelText(removeTrailingNewline(text)));
-
+ text = removeTrailingNewline(text);
+ textLabel.setText(TasksUiInternal.escapeLabelText(text));
GC gc = new GC(textLabel);
+ int width = Math.min(gc.textExtent(text).x, MAX_WIDTH);
try {
- if (gc.textExtent(text).x > MAX_WIDTH) {
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).hint(MAX_WIDTH, SWT.DEFAULT).applyTo(
- textLabel);
- }
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.BEGINNING).hint(width, SWT.DEFAULT).applyTo(textLabel);
} finally {
gc.dispose();
}

Back to the top