mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 579505: [hover] Unreadable text in expression hover
Use the current theme for the expression information control. If the theme doesn't provide information colors use the old implementation (system colors) as fallback. Change-Id: I0096a730364994dbd39e37c561f217bd3ff5979c Signed-off-by: Dominic Scharfe <dominic.scharfe@coseda-tech.com>
This commit is contained in:
parent
c4920f78f9
commit
be0a7410c1
1 changed files with 18 additions and 2 deletions
|
@ -33,6 +33,8 @@ import org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContaine
|
||||||
import org.eclipse.debug.ui.AbstractDebugView;
|
import org.eclipse.debug.ui.AbstractDebugView;
|
||||||
import org.eclipse.debug.ui.IDebugUIConstants;
|
import org.eclipse.debug.ui.IDebugUIConstants;
|
||||||
import org.eclipse.jface.dialogs.IDialogSettings;
|
import org.eclipse.jface.dialogs.IDialogSettings;
|
||||||
|
import org.eclipse.jface.preference.JFacePreferences;
|
||||||
|
import org.eclipse.jface.resource.ColorRegistry;
|
||||||
import org.eclipse.jface.text.AbstractInformationControl;
|
import org.eclipse.jface.text.AbstractInformationControl;
|
||||||
import org.eclipse.jface.text.IInformationControl;
|
import org.eclipse.jface.text.IInformationControl;
|
||||||
import org.eclipse.jface.text.IInformationControlCreator;
|
import org.eclipse.jface.text.IInformationControlCreator;
|
||||||
|
@ -56,6 +58,7 @@ import org.eclipse.swt.widgets.Tree;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
import org.eclipse.ui.IWorkbenchPartSite;
|
import org.eclipse.ui.IWorkbenchPartSite;
|
||||||
import org.eclipse.ui.PlatformUI;
|
import org.eclipse.ui.PlatformUI;
|
||||||
|
import org.eclipse.ui.themes.ITheme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an information control to display an expression in a hover control.
|
* Creates an information control to display an expression in a hover control.
|
||||||
|
@ -430,8 +433,21 @@ public class ExpressionInformationControlCreator implements IInformationControlC
|
||||||
|
|
||||||
fViewer.addViewerUpdateListener(fViewerUpdateListener);
|
fViewer.addViewerUpdateListener(fViewerUpdateListener);
|
||||||
|
|
||||||
setForegroundColor(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
ITheme currentTheme = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
|
||||||
setBackgroundColor(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
|
ColorRegistry colorRegistry = currentTheme.getColorRegistry();
|
||||||
|
|
||||||
|
Color fg = colorRegistry.get(JFacePreferences.INFORMATION_FOREGROUND_COLOR);
|
||||||
|
if (fg == null) {
|
||||||
|
fg = getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
Color bg = colorRegistry.get(JFacePreferences.INFORMATION_BACKGROUND_COLOR);
|
||||||
|
if (bg == null) {
|
||||||
|
bg = getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
|
||||||
|
}
|
||||||
|
|
||||||
|
setForegroundColor(fg);
|
||||||
|
setBackgroundColor(bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue