jmc icon indicating copy to clipboard operation
jmc copied to clipboard

7056: Fix dark mode

Open bric3 opened this issue 3 years ago • 5 comments

This change allows a user of the JMC RCP application to switch the appearance with the default Eclipse themes.

Those are shipped via the org.eclipse.ui.themes and org.eclipse.e4.ui.css.swt.theme plugin. In order to activate them all that is is required is to add the above in the application feature file, and to declare them in the application manifest file.

After Screenshot 2022-01-16 at 16 23 46 Screenshot 2022-01-16 at 16 26 21

Before Screenshot 2022-01-16 at 16 24 45 There's no theme, as such the combo box doesn't open either.


Progress

  • [x] Commit message must refer to an issue
  • [ ] Change must be properly reviewed

Issue

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jmc pull/362/head:pull/362
$ git checkout pull/362

Update a local copy of the PR:
$ git checkout pull/362
$ git pull https://git.openjdk.java.net/jmc pull/362/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 362

View PR using the GUI difftool:
$ git pr show -t 362

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jmc/pull/362.diff

bric3 avatar Jan 16 '22 15:01 bric3

:wave: Welcome back bric3! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Jan 16 '22 15:01 bridgekeeper[bot]

Note this PR doesn't fix the graph issues mentioned in JMC-7056.

For JMC-7056, I'm not quite sure how to fix that yet, but using the following APIs might prove useful:

  • PlatformUI.getWorkbench().getThemeManager().getCurrentTheme() gets an ITheme
  • theme.getColorRegistry().get(String) gets the Color or a symbolic name

bric3 avatar Jan 16 '22 15:01 bric3

I think we may have skipped having dark mode available due to the problems mentioned in JMC-7056. I think we need to fix JMC-7065 to re-enable.

thegreystone avatar Jan 16 '22 18:01 thegreystone

It makes sense, let's fix those.

bric3 avatar Jan 16 '22 23:01 bric3

Webrevs

mlbridge[bot] avatar Jan 17 '22 11:01 mlbridge[bot]

Looks like a temporary workaround for this is to (at least for GTK) set the GTK_THEME environment variable before starting jmc.

GTK_THEME="Adwaita:light" jmc &
GTK_THEME="Adwaita:dark" jmc &

image

ascopes avatar Oct 18 '22 11:10 ascopes

@aptmac I can see the side of this argument. Would you like me to re-name this PR and the associated ticket ? And then make a census of the "broken" items ?

Also maybe you have some insights to the SWT / Eclipse APIs to look for, in order to fix the broken components as in this https://github.com/openjdk/jmc/pull/362#issuecomment-1013900500

bric3 avatar Nov 29 '23 10:11 bric3

@aptmac I can see the side of this argument. Would you like me to re-name this PR and the associated ticket ? And then make a census of the "broken" items ?

Yeah I think that would be the right way to go.

Also maybe you have some insights to the SWT / Eclipse APIs to look for, in order to fix the broken components as in this #362 (comment)

I don't have anything off the top of my head. Thinking back I recall a lot of the backgrounds and colours being set manually within components in JMC, that's where my first search would go. Maybe for charts we could have some class/toolkit that can return standardized background/foreground/component colours, and these colour values change based on whether JMC is in light or dark mode?

aptmac avatar Nov 29 '23 14:11 aptmac

standardized background/foreground/component colours

I also think defining palette of colors might be what to look for.

However there are some challenges for "embedded app" like the JMX browser. Maybe applying a LaF is enough.

bric3 avatar Nov 29 '23 16:11 bric3

Hi @bric3! We're getting closer to shipping JMC 9. Is this something that you still want to get into JMC 9?

thegreystone avatar Jan 03 '24 18:01 thegreystone

@thegreystone Don't wait on this one I think it can go in a later version

bric3 avatar Jan 04 '24 12:01 bric3

Hi @bric3! Let's just take it and open issues on anything that doesn't work, otherwise this will stay in draft forever.

thegreystone avatar Jan 17 '24 18:01 thegreystone

OK I'll update the PR tomorrow morning.

bric3 avatar Jan 17 '24 20:01 bric3

@bric3 This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

7056: Fix dark mode

Reviewed-by: aptmac

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 1 new commit pushed to the master branch:

  • 793e8263a338a0251854510c8eb1a4bae3c3acc6: 8054: Support the new JPLIS agent events

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch. As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aptmac) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

openjdk[bot] avatar Jan 18 '24 09:01 openjdk[bot]

This will need a copyright bump to 2024 and can be integrated afterwards.

aptmac avatar Jan 18 '24 16:01 aptmac

@aptmac It think there's an issue in the script, or is is required to update copyrights on master?

image

bric3 avatar Jan 19 '24 14:01 bric3

@aptmac It think there's an issue in the script, or is is required to update copyrights on master?

Ah that's no good, I'll put this on my todo list of things to take a look. I'm wondering if the script didn't like the merge commit. At first glance it looks like it's checking the files that were updated in the rjmx & flightrecorder configuration shuffle. Maybe because the original commit for this PR was on an older master, when the merge commit occured to update this PR the license check script might have compared the new master to what master looked like when this PR was opened.

It's pretty easy to verify the two files on this PR, I think this should be okay and we ignore the results of the copyright script.

aptmac avatar Jan 19 '24 15:01 aptmac

/integrate

bric3 avatar Jan 23 '24 11:01 bric3

@bric3 Your change (at version 91043de2cf57efeac5202a228134c94d5202070a) is now ready to be sponsored by a Committer.

openjdk[bot] avatar Jan 23 '24 11:01 openjdk[bot]

/sponsor

aptmac avatar Jan 23 '24 13:01 aptmac

Going to push as commit b61f6a798d63f2ba4616fa734440d170e2ed06ad. Since your change was applied there has been 1 commit pushed to the master branch:

  • 793e8263a338a0251854510c8eb1a4bae3c3acc6: 8054: Support the new JPLIS agent events

Your commit was automatically rebased without conflicts.

openjdk[bot] avatar Jan 23 '24 13:01 openjdk[bot]

@aptmac @bric3 Pushed as commit b61f6a798d63f2ba4616fa734440d170e2ed06ad.

:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

openjdk[bot] avatar Jan 23 '24 13:01 openjdk[bot]