Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2015-02-08 12:17:27 +0000
committerAndrey Loskutov2015-02-08 12:17:27 +0000
commit215d754ed9fa8de993fa55855c55f7f2150216b1 (patch)
treef0052335dcaa4b53cd7c92387553782e5a96536a
parentd9754134f067f1617ec419ada7c40a1c58af42ec (diff)
downloadegit-215d754ed9fa8de993fa55855c55f7f2150216b1.tar.gz
egit-215d754ed9fa8de993fa55855c55f7f2150216b1.tar.xz
egit-215d754ed9fa8de993fa55855c55f7f2150216b1.zip
Don't apply fonts and colors if they are undefined in current theme
Bug: 432016 Change-Id: I74d75b61e6cb0a3f31d349bc390f4cc6b0b840b4 Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
index 38be58be70..32559506a8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitLightweightDecorator.java
@@ -385,26 +385,33 @@ public class GitLightweightDecorator extends LabelProvider implements
private void decorateFontAndColour(IDecoration decoration,
IDecoratableResource resource) {
ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
+ Color bc = null;
+ Color fc = null;
+ Font f = null;
if (resource.isIgnored()) {
- Color bc = current.getColorRegistry().get(
+ bc = current.getColorRegistry().get(
UIPreferences.THEME_IgnoredResourceBackgroundColor);
- Color fc = current.getColorRegistry().get(
+ fc = current.getColorRegistry().get(
UIPreferences.THEME_IgnoredResourceForegroundColor);
- Font f = current.getFontRegistry().get(
+ f = current.getFontRegistry().get(
UIPreferences.THEME_IgnoredResourceFont);
-
- setBackgroundColor(decoration, bc);
- decoration.setForegroundColor(fc);
- decoration.setFont(f);
} else if (!resource.isTracked()
|| resource.isDirty()
|| resource.staged() != Staged.NOT_STAGED) {
- Color bc = current.getColorRegistry().get(UIPreferences.THEME_UncommittedChangeBackgroundColor);
- Color fc = current.getColorRegistry().get(UIPreferences.THEME_UncommittedChangeForegroundColor);
- Font f = current.getFontRegistry().get(UIPreferences.THEME_UncommittedChangeFont);
-
+ bc = current.getColorRegistry().get(
+ UIPreferences.THEME_UncommittedChangeBackgroundColor);
+ fc = current.getColorRegistry().get(
+ UIPreferences.THEME_UncommittedChangeForegroundColor);
+ f = current.getFontRegistry().get(
+ UIPreferences.THEME_UncommittedChangeFont);
+ }
+ if (bc != null) {
setBackgroundColor(decoration, bc);
+ }
+ if (fc != null) {
decoration.setForegroundColor(fc);
+ }
+ if (f != null) {
decoration.setFont(f);
}
}

Back to the top