Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2010-06-08 13:13:20 -0400
committermkersten2010-06-08 13:13:20 -0400
commite9bb2bb6357dc313d4b8be6c71d7f93ab13479da (patch)
tree566a7b429524a1ba7bfb258c10544745622e3dd3 /org.eclipse.mylyn.tasks.ui
parentdb0f97c1a13d7ddbb9608298dd819d22852d9ddc (diff)
downloadorg.eclipse.mylyn.tasks-e9bb2bb6357dc313d4b8be6c71d7f93ab13479da.tar.gz
org.eclipse.mylyn.tasks-e9bb2bb6357dc313d4b8be6c71d7f93ab13479da.tar.xz
org.eclipse.mylyn.tasks-e9bb2bb6357dc313d4b8be6c71d7f93ab13479da.zip
NEW - bug 316174: improve Task List category gradient rendering on Windows 7
https://bugs.eclipse.org/bugs/show_bug.cgi?id=316174
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/GradientDrawer.java26
1 files changed, 20 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/GradientDrawer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/GradientDrawer.java
index 28a96ac0b..bf4905f12 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/GradientDrawer.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/GradientDrawer.java
@@ -36,6 +36,9 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.themes.IThemeManager;
+/**
+ * @author Mik Kersten
+ */
public class GradientDrawer {
private final Listener CATEGORY_GRADIENT_DRAWER = new Listener() {
@@ -147,10 +150,12 @@ public class GradientDrawer {
}
private void configureGradientColors() {
- categoryGradientStart = themeManager.getCurrentTheme().getColorRegistry().get(
- CommonThemes.COLOR_CATEGORY_GRADIENT_START);
- categoryGradientEnd = themeManager.getCurrentTheme().getColorRegistry().get(
- CommonThemes.COLOR_CATEGORY_GRADIENT_END);
+ categoryGradientStart = themeManager.getCurrentTheme()
+ .getColorRegistry()
+ .get(CommonThemes.COLOR_CATEGORY_GRADIENT_START);
+ categoryGradientEnd = themeManager.getCurrentTheme()
+ .getColorRegistry()
+ .get(CommonThemes.COLOR_CATEGORY_GRADIENT_END);
boolean customized = true;
if (categoryGradientStart != null && categoryGradientStart.getRed() == 240
@@ -167,8 +172,17 @@ public class GradientDrawer {
if (!customized) {
// Set parent-based colors
Color parentBackground = getViewer().getTree().getParent().getBackground();
- double GRADIENT_TOP = 1.05;// 1.02;
- double GRADIENT_BOTTOM = .995;// 1.035;
+ double GRADIENT_TOP;// = 1.05;// 1.02;
+ double GRADIENT_BOTTOM;// = .995;// 1.035;
+
+ // Constants to darken or lighten the default gradients
+ if ("Windows 7".equals(System.getProperty("os.name"))) {
+ GRADIENT_TOP = 1.05;
+ GRADIENT_BOTTOM = 1.13;
+ } else {
+ GRADIENT_TOP = 1.05;
+ GRADIENT_BOTTOM = .995;
+ }
int red = Math.min(255, (int) (parentBackground.getRed() * GRADIENT_TOP));
int green = Math.min(255, (int) (parentBackground.getGreen() * GRADIENT_TOP));

Back to the top