Permalink
Browse files

Signed-off-by: Jeeeyul <jeeeyul@gmail.com>

  • Loading branch information...
1 parent d9d1268 commit 0dcf8208705d50515845624e4ca1b6c2c211816d @jeeeyul committed Oct 8, 2012
Showing with 782 additions and 459 deletions.
  1. BIN net.jeeeyul.eclipse.themes.beta-updatesite/artifacts.jar
  2. BIN net.jeeeyul.eclipse.themes.beta-updatesite/content.jar
  3. BIN ...eclipse.themes.beta-updatesite/features/net.jeeeyul.eclipse.themes.feature_1.7.0.201210051701.jar
  4. BIN ...eclipse.themes.beta-updatesite/features/net.jeeeyul.eclipse.themes.feature_1.7.0.201210081249.jar
  5. BIN ...eeeyul.eclipse.themes_1.7.0.201210051701.jar → net.jeeeyul.eclipse.themes_1.7.0.201210081249.jar}
  6. BIN net.jeeeyul.eclipse.themes.beta-updatesite/update-site.zip
  7. +6 −7 net.jeeeyul.eclipse.themes.build/category.xml
  8. +32 −32 net.jeeeyul.eclipse.themes/META-INF/MANIFEST.MF
  9. BIN net.jeeeyul.eclipse.themes/icons/handle-embossed.gif
  10. +4 −4 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/css/ChromeCSSGenerator.xtend
  11. +11 −7 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/css/ChromeDynamicResourceLocator.java
  12. +52 −0 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/css/ChromeResourceURI.java
  13. +5 −0 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/css/ChromeResourceURIParser.java
  14. +10 −2 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/css/DragHandleFactory.java
  15. +3 −0 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/ChromeConstants.java
  16. +3 −1 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/ChromePage.java
  17. +2 −2 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/ChromePreferenceExtensions.java
  18. +7 −5 ...jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/ChromePreferenceInitializer.java
  19. +13 −2 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/ChromeThemeConfig.java
  20. +1 −0 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/ChromeThemePrefererncePage.java
  21. +22 −22 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/CommonPartPage.xtend
  22. +29 −42 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/GeneralPage.xtend
  23. +2 −0 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/IChromeThemeConfig.java
  24. +79 −0 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/OtherPage.xtend
  25. +43 −37 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/PartPage.xtend
  26. +59 −50 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/ToolbarPage.xtend
  27. +9 −9 ...eyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/preference/action/GlobalAdjustmentDialog.xtend
  28. +17 −17 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/ui/ColorFieldSet.xtend
  29. +39 −1 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/ui/HSB.java
  30. +324 −209 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/ui/SWTExtensions.java
  31. +10 −10 net.jeeeyul.eclipse.themes/src/net/jeeeyul/eclipse/themes/userpreset/UserPresetEditor.xtend
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,6 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<site>
- <feature id="net.jeeeyul.eclipse.themes.feature" url="features/net.jeeeyul.eclipse.themes.feature_1.7.0.qualifier.jar" version="1.7.0.qualifier">
- <category name="themes"/>
- </feature>
- <category-def label="Jeeeyul's themes" name="themes"/>
-</site>
+<?xml version="1.0" encoding="UTF-8"?><site>
+ <feature id="net.jeeeyul.eclipse.themes.feature" url="features/net.jeeeyul.eclipse.themes.feature_1.7.0.qualifier.jar" version="1.7.0.qualifier">
+ <category name="themes"/>
+ </feature>
+ <category-def label="Jeeeyul's themes" name="themes"/>
+</site>
@@ -1,32 +1,32 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Themes
-Bundle-SymbolicName: net.jeeeyul.eclipse.themes;singleton:=true
-Bundle-Version: 1.7.0.qualifier
-Bundle-Activator: net.jeeeyul.eclipse.themes.ChromeThemeCore
-Bundle-Vendor: Jeeeyul
-Require-Bundle: javax.annotation;bundle-version="1.0.0",
- org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.e4.ui.css.swt.theme,
- org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="0.10.1",
- org.eclipse.e4.ui.css.core;bundle-version="0.10.1",
- org.eclipse.e4.ui.css.swt;bundle-version="0.10.1",
- org.eclipse.e4.core.di;bundle-version="1.1.0",
- org.eclipse.e4.core.services;bundle-version="1.0.0",
- org.eclipse.e4.ui.workbench;bundle-version="0.10.2",
- javax.inject;bundle-version="1.0.0",
- org.eclipse.osgi.services;bundle-version="3.3.100",
- org.w3c.css.sac;bundle-version="1.3.1"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: lib/aopalliance.jar,
- lib/com.google.guava_10.0.1.v201203051515.jar,
- lib/guice-3.0.jar,
- lib/javax.inject.jar,
- lib/org.eclipse.nebula.widgets.compositetable_1.0.0.201206270822.jar,
- lib/org.eclipse.nebula.widgets.gallery_0.5.3.201206270822.jar,
- lib/org.eclipse.xtend.lib_2.4.0.v201207240245.jar,
- lib/org.eclipse.xtend2.lib_2.4.0.v201207240245.jar,
- lib/org.eclipse.xtext.xbase.lib_2.4.0.v201207240245.jar,
- .
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Themes
+Bundle-SymbolicName: net.jeeeyul.eclipse.themes;singleton:=true
+Bundle-Version: 1.7.0.qualifier
+Bundle-Activator: net.jeeeyul.eclipse.themes.ChromeThemeCore
+Bundle-Vendor: Jeeeyul
+Require-Bundle: javax.annotation;bundle-version="1.0.0",
+ org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.e4.ui.css.swt.theme,
+ org.eclipse.e4.ui.workbench.renderers.swt;bundle-version="0.10.1",
+ org.eclipse.e4.ui.css.core;bundle-version="0.10.1",
+ org.eclipse.e4.ui.css.swt;bundle-version="0.10.1",
+ org.eclipse.e4.core.di;bundle-version="1.1.0",
+ org.eclipse.e4.core.services;bundle-version="1.0.0",
+ org.eclipse.e4.ui.workbench;bundle-version="0.10.2",
+ javax.inject;bundle-version="1.0.0",
+ org.eclipse.osgi.services;bundle-version="3.3.100",
+ org.w3c.css.sac;bundle-version="1.3.1"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: lib/aopalliance.jar,
+ lib/com.google.guava_10.0.1.v201203051515.jar,
+ lib/guice-3.0.jar,
+ lib/javax.inject.jar,
+ lib/org.eclipse.nebula.widgets.compositetable_1.0.0.201206270822.jar,
+ lib/org.eclipse.nebula.widgets.gallery_0.5.3.201206270822.jar,
+ lib/org.eclipse.xtend.lib_2.4.0.v201207240245.jar,
+ lib/org.eclipse.xtend2.lib_2.4.0.v201207240245.jar,
+ lib/org.eclipse.xtext.xbase.lib_2.4.0.v201207240245.jar,
+ .
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -104,14 +104,14 @@ class ChromeCSSGenerator {
.MToolControl.TrimStack {
«IF config.useTrimStackImageBorder»
«IF junoSR1»
- frame-image: url(chrome://frame/«config.windowBackgroundColor.toHSB.serialize»);
+ frame-image: url(chrome://frame?background-color=«config.windowBackgroundColor.toHSB.toHTMLCode»);
«ELSE»
frame-image: url(images/frame.png);
«ENDIF»
frame-cuts: 5px 1px 5px 16px;
«ENDIF»
«IF junoSR1»
- handle-image: url(chrome://drag-handle/22/«config.windowBackgroundColor.toHSB.serialize»);
+ handle-image: url(chrome://drag-handle?height=22&background-color=«config.windowBackgroundColor.toHSB.toHTMLCode»&embossed=«config.useEmbossedDragHandle»);
«ELSE»
handle-image: url(images/handle.png);
«ENDIF»
@@ -152,11 +152,11 @@ class ChromeCSSGenerator {
«IF junoSR1»
.MToolBar.Draggable {
- handle-image: url(chrome://drag-handle/22/«config.toolbarGradientStart.toHSB.serialize»);
+ handle-image: url(chrome://drag-handle?height=22&background-color=«config.toolbarGradientStart.toHSB.toHTMLCode»&embossed=«config.useEmbossedDragHandle»);
}
.MToolControl.Draggable {
- handle-image: url(chrome://drag-handle/22/«config.windowBackgroundColor.toHSB.serialize»);
+ handle-image: url(chrome://drag-handle?height=22&background-color=«config.windowBackgroundColor.toHSB.toHTMLCode»&embossed=«config.useEmbossedDragHandle»);
}
«ENDIF»
@@ -32,12 +32,16 @@ public String resolve(String uri) {
@Override
public InputStream getInputStream(String uri) throws Exception {
- String[] segments = uri.substring(9).split("/");
- if (segments[0].equals("drag-handle")) {
- int height = Integer.parseInt(segments[1].trim());
- HSB hue = HSB.createFromString(segments[2].trim());
+ ChromeResourceURI curi = new ChromeResourceURI(uri);
- ImageData image = dragHandleFactory.create(height, hue);
+ String command = curi.getCommand();
+
+ if (command.equals("drag-handle")) {
+ int height = Integer.parseInt(curi.getArgument("height", "22"));
+ HSB backgroundColor = new HSB(curi.getArgument("background-color"));
+ boolean embossed = Boolean.parseBoolean(curi.getArgument("embossed", "false"));
+
+ ImageData image = dragHandleFactory.create(height, backgroundColor, embossed);
ImageLoader save = new ImageLoader();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -46,8 +50,8 @@ public InputStream getInputStream(String uri) throws Exception {
return new ByteArrayInputStream(baos.toByteArray());
}
- else if (segments[0].equals("frame")) {
- HSB hue = HSB.createFromString(segments[1].trim());
+ else if (command.equals("frame")) {
+ HSB hue = new HSB(curi.getArgument("background-color"));
ImageData image = frameFactory.create(hue);
ImageLoader save = new ImageLoader();
@@ -0,0 +1,52 @@
+package net.jeeeyul.eclipse.themes.css;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class ChromeResourceURI {
+ private static final String PREFIX = "chrome://";
+
+ private String command;
+ private Map<String, String> arguments;
+
+ public ChromeResourceURI() {
+ arguments = new HashMap<String, String>();
+ }
+
+ public ChromeResourceURI(String uri) {
+ this();
+
+ String substring = uri.substring(PREFIX.length());
+ String[] split = substring.split("\\?");
+
+ setCommand(split[0].trim());
+ if (split[1] != null) {
+ String[] pairs = split[1].split("&");
+ for (String each : pairs) {
+ String[] keyValue = each.split("=");
+ addArgument(keyValue[0].trim(), keyValue[1].trim());
+ }
+ }
+ }
+
+ public void addArgument(String argName, String value) {
+ arguments.put(argName, value);
+ }
+
+ public String getArgument(String argName) {
+ return getArgument(argName, null);
+ }
+
+ public String getArgument(String argName, String defaultValue) {
+ String result = arguments.get(argName);
+ return result != null ? result : defaultValue;
+ }
+
+ public String getCommand() {
+ return command;
+ }
+
+ public void setCommand(String command) {
+ this.command = command;
+ }
+}
@@ -0,0 +1,5 @@
+package net.jeeeyul.eclipse.themes.css;
+
+public class ChromeResourceURIParser {
+
+}
@@ -10,8 +10,16 @@
import org.eclipse.swt.graphics.RGB;
public class DragHandleFactory {
- public ImageData create(int height, HSB backgroundColor) {
- ImageData source = SharedImages.getImageDescriptor(SharedImages.HANDLE).getImageData();
+ public ImageData create(int height, HSB backgroundColor, boolean embossed) {
+
+ ImageData source = null;
+
+ if (embossed) {
+ source = SharedImages.getImageDescriptor(SharedImages.HANDLE_EMBOSSED).getImageData();
+ } else {
+ source = SharedImages.getImageDescriptor(SharedImages.HANDLE).getImageData();
+ }
+
ImageData result = new ImageData(source.width, height, source.depth, source.palette);
int offset = (result.height - source.height) / 2;
@@ -296,4 +296,7 @@
@ValueType(boolean.class)
public static final String CHROME_USE_TRIMSTACK_IMAGE_BORDER = "chrome-use-trimstack-image-border";
+
+ @ValueType(boolean.class)
+ public static final String CHROME_USE_EMBOSSED_DRAG_HANDLE = "chrome-use-embossed-drag-handle";
}
@@ -16,7 +16,9 @@
public ChromePage(String title, String imageURI) {
super();
this.title = title;
- this.pageImage = SharedImages.getImage(imageURI);
+
+ if (imageURI != null)
+ this.pageImage = SharedImages.getImage(imageURI);
}
public abstract void create(Composite control);
@@ -19,11 +19,11 @@ public Gradient getGradient(IPreferenceStore store, String key) {
}
public HSB getHSB(IPreferenceStore store, String key) {
- return HSB.createFromString(store.getString(key));
+ return HSB.deserialize(store.getString(key));
}
public HSB getDefaultHSB(IPreferenceStore store, String key) {
- return HSB.createFromString(store.getDefaultString(key));
+ return HSB.deserialize(store.getDefaultString(key));
}
public void setDefaultValue(IPreferenceStore store, String key, HSB value) {
@@ -95,10 +95,10 @@ public void initializeDefaultPreferences(IPreferenceStore store) {
} else if (os.equals(Platform.OS_MACOSX)) {
store.setDefault(ChromeConstants.CHROME_PART_FONT_NAME, "Lucida Grande");
store.setDefault(ChromeConstants.CHROME_PART_FONT_SIZE, 12f);
- } else if(os.equals(Platform.OS_LINUX)){
+ } else if (os.equals(Platform.OS_LINUX)) {
store.setDefault(ChromeConstants.CHROME_PART_FONT_NAME, "FreeSans");
store.setDefault(ChromeConstants.CHROME_PART_FONT_SIZE, 9f);
- }else {
+ } else {
store.setDefault(ChromeConstants.CHROME_PART_FONT_NAME, "Verdana");
store.setDefault(ChromeConstants.CHROME_PART_FONT_SIZE, 10f);
}
@@ -163,12 +163,14 @@ public void initializeDefaultPreferences(IPreferenceStore store) {
store.setDefault(ChromeConstants.CHROME_USE_STATUS_BAR_OUTLINE, false);
store.setDefault(ChromeConstants.CHROME_STATUS_BAR_OUTLINE_COLOR, new HSB(0f, 0f, 0.9f).serialize());
store.setDefault(ChromeConstants.CHROME_STATUS_BAR_BACKGROUND_COLOR, new HSB(0f, 0f, 0.94f).serialize());
-
- if(os.equals(Platform.OS_LINUX)){
+
+ if (os.equals(Platform.OS_LINUX)) {
store.setDefault(ChromeConstants.CHROME_USE_TRIMSTACK_IMAGE_BORDER, false);
- }else{
+ } else {
store.setDefault(ChromeConstants.CHROME_USE_TRIMSTACK_IMAGE_BORDER, true);
}
+
+ store.setDefault(ChromeConstants.CHROME_USE_EMBOSSED_DRAG_HANDLE, false);
}
@Override
@@ -80,6 +80,8 @@ public static IChromeThemeConfig getInstance() {
* https://github.com/jeeeyul/eclipse-themes/issues/issue/43
*/
private Integer partStackCornerRadius;
+
+ private Boolean useEmbossedDragHandle;
public ChromeThemeConfig() {
this(ChromeThemeCore.getDefault().getPreferenceStore());
@@ -440,7 +442,7 @@ public RGB getStatusBarBackgroundColor() {
if (getUseWindowBackgroundAsStatusBarBackground()) {
statusBarBackgroundColor = getWindowBackgroundColor();
} else {
- statusBarBackgroundColor = HSB.createFromString(getStore().getString(ChromeConstants.CHROME_STATUS_BAR_BACKGROUND_COLOR)).toRGB();
+ statusBarBackgroundColor = HSB.deserialize(getStore().getString(ChromeConstants.CHROME_STATUS_BAR_BACKGROUND_COLOR)).toRGB();
}
}
return statusBarBackgroundColor;
@@ -449,7 +451,7 @@ public RGB getStatusBarBackgroundColor() {
@Override
public RGB getStatusBarOutlineColor() {
if (statusBarOutlineColor == null) {
- statusBarOutlineColor = HSB.createFromString(getStore().getString(ChromeConstants.CHROME_STATUS_BAR_OUTLINE_COLOR)).toRGB();
+ statusBarOutlineColor = HSB.deserialize(getStore().getString(ChromeConstants.CHROME_STATUS_BAR_OUTLINE_COLOR)).toRGB();
}
return statusBarOutlineColor;
}
@@ -485,6 +487,14 @@ public RGB getToolbarGradientStart() {
}
@Override
+ public Boolean getUseEmbossedDragHandle() {
+ if (useEmbossedDragHandle == null) {
+ useEmbossedDragHandle = getStore().getBoolean(ChromeConstants.CHROME_USE_EMBOSSED_DRAG_HANDLE);
+ }
+ return useEmbossedDragHandle;
+ }
+
+ @Override
public Boolean getUseStatusBarOutline() {
if (useStatusBarOutline == null) {
useStatusBarOutline = getStore().getBoolean(ChromeConstants.CHROME_USE_STATUS_BAR_OUTLINE);
@@ -570,6 +580,7 @@ private void invalidate() {
statusBarOutlineColor = null;
useTrimStackImageBorder = null;
+ useEmbossedDragHandle = null;
}
@Override
@@ -288,5 +288,6 @@ private void setupPages() {
addPage(new PartPage("Inactive", false));
addPage(new CommonPartPage());
addPage(new ToolbarPage());
+ addPage(new OtherPage());
}
}
Oops, something went wrong.

0 comments on commit 0dcf820

Please sign in to comment.