AObuchow / Eclipse-Spectrum-Theme

Eclipse plugin which adds the Spectrum theme.
https://marketplace.eclipse.org/content/spectrum-dark-theme
Eclipse Public License 2.0
23 stars 5 forks source link

Dynamically set the git uncommitted changes font to background color #114

Closed AObuchow closed 4 years ago

AObuchow commented 4 years ago

Signed-off-by: Andrew Obuchowicz aobuchow@redhat.com

AObuchow commented 4 years ago

The code is quite messy right now but this is getting really cool. The git uncommitted changes background is set to the theme's background color with its luminance increased by 0.1.

AObuchow commented 4 years ago

@ingomohr I seem to be having a bit of a dependency issue, maybe you can help out? I'm trying to use the new constructor for Color which does not require a Display:

/**
 * Constructs a new instance of this class given the
 * desired red, green and blue values expressed as ints in the range
 * 0 to 255 (where 0 is black and 255 is full brightness).
 *
 * @param red the amount of red in the color
 * @param green the amount of green in the color
 * @param blue the amount of blue in the color
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255</li>
 * </ul>
 * @since 3.115
 */
public Color(int red, int green, int blue) {
    super();
    init(red, green, blue, 255);
}

It was only introduced in org.eclipse.swt in 3.115 (maybe Eclipse 4.16 is using an earlier version of SWT?).

When trying to compile with maven, I'm getting:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.aobuchow.themes.spectrum.preferences 1.0.0.qualifier
[ERROR]   Missing requirement: com.aobuchow.themes.spectrum.preferences 1.0.0.qualifier requires 'osgi.bundle; org.eclipse.swt 3.115.0' but it could not be found
ingomohr commented 4 years ago

@ingomohr I seem to be having a bit of a dependency issue, maybe you can help out? I'm trying to use the new constructor for Color which does not require a Display:

/**
 * Constructs a new instance of this class given the
 * desired red, green and blue values expressed as ints in the range
 * 0 to 255 (where 0 is black and 255 is full brightness).
 *
 * @param red the amount of red in the color
 * @param green the amount of green in the color
 * @param blue the amount of blue in the color
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255</li>
 * </ul>
 * @since 3.115
 */
public Color(int red, int green, int blue) {
  super();
  init(red, green, blue, 255);
}

It was only introduced in org.eclipse.swt in 3.115 (maybe Eclipse 4.16 is using an earlier version of SWT?).

When trying to compile with maven, I'm getting:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.aobuchow.themes.spectrum.preferences 1.0.0.qualifier
[ERROR]   Missing requirement: com.aobuchow.themes.spectrum.preferences 1.0.0.qualifier requires 'osgi.bundle; org.eclipse.swt 3.115.0' but it could not be found

Okay, there's the thing. :)

Two problems (as discussed w/ @AObuchow :

One: SWT 3.115 has not been released yet
Two: .classpath is on .gitignore.
AObuchow commented 4 years ago

@ingomohr I seem to be having a bit of a dependency issue, maybe you can help out? I'm trying to use the new constructor for Color which does not require a Display:

/**
 * Constructs a new instance of this class given the
 * desired red, green and blue values expressed as ints in the range
 * 0 to 255 (where 0 is black and 255 is full brightness).
 *
 * @param red the amount of red in the color
 * @param green the amount of green in the color
 * @param blue the amount of blue in the color
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_ARGUMENT - if the red, green or blue argument is not between 0 and 255</li>
 * </ul>
 * @since 3.115
 */
public Color(int red, int green, int blue) {
    super();
    init(red, green, blue, 255);
}

It was only introduced in org.eclipse.swt in 3.115 (maybe Eclipse 4.16 is using an earlier version of SWT?). When trying to compile with maven, I'm getting:

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: com.aobuchow.themes.spectrum.preferences 1.0.0.qualifier
[ERROR]   Missing requirement: com.aobuchow.themes.spectrum.preferences 1.0.0.qualifier requires 'osgi.bundle; org.eclipse.swt 3.115.0' but it could not be found

Okay, there's the thing. :)

Two problems (as discussed w/ @AObuchow :

One: SWT 3.115 has not been released yet
* SWT 3.115 is released only w/ Eclipse 2020-09 in september

* The build fails because the latest release updatesites are used to build the theme

* Solution:

  * Remove the SWT dependency line from `MANIFEST.MF`
  * Don't use the (int, int, int) constructor for `Color`which isn't available in the current Eclipse release

I'll stick to the 2020-06 constructor of Color till 2020-09 is released, thanks for the investigation :)!

Two: .classpath is on .gitignore.
* If you checkout the branch, the preferences bundle won't build in Eclipse

* You'd have to add the `.classpath` file yourself.

* Solution:

  * Add the `.classpath` file to the files and remove the entry from `.gitignore`.

Thank you for catching this!!! I really appreciate it :)

AObuchow commented 4 years ago

@ingomohr asides from the lack of tests & using deprecated & internal API's (oops), this should be good to merge. If you have any comments let me know, I'll wait a bit.

ingomohr commented 4 years ago

@ingomohr asides from the lack of tests & using deprecated & internal API's (oops), this should be good to merge. If you have any comments let me know, I'll wait a bit.

@AObuchow Yes, I agree. Also, this PR goes to Experimental first, anyway - not right into Master. Merging sounds good. :)