-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dark mode using flatlaf #4145
Add dark mode using flatlaf #4145
Conversation
Useful indeed. There is some stirring taking place... |
Small thing, noticed that Tip of the day window still had a white box in it. Hard coded to white, link below to line. |
How do you install this? It's not clear to me. Are we just supposed to use ghidra-dark and rely on the commit to fix any issues, or does Ghidra need to be recompiled with Flatlaf? ghidra-dark installs, but it breaks things for me on the latest 10.1.5 (Void Linux). I had to remove Ghidra, purge ~/.ghidra, and reinstall. I don't see the two new 'Flat' theme options either, before or after installing Flatlaf/ghidra-dark. I must be doing something wrong. |
@jjc224 What I did was clone @Happyholic1203's repo and re-build Ghidra from source. The zip file created after building has the dark mode. |
Had this error when trying to do a patch instruction Log (Click to View)
|
This needs to be rebased to resolve the conflicts wtih the current code. |
Thank you for your effort in this PR. We have taken the initial work and used that as inspiration for our new Theming feature. Commit: e657a70 |
The tooltip is still off though: Also,
|
I believe the exception had been fixed. I will add the tooltip to the list of items that still need updating. |
What this commit is about
I integrated a dark mode into Ghidra using flatlaf.
The idea is to introduce a new Look and Feel option for dark mode (flatlaf), and a different set of default color values for dark mode, so:
This commit is coded with these principles in mind:
JPanel
knows which color to use for its background when in dark mode, so I'll try to letJPanel
pick its colors in dark modeColorContext
interface is introduced to manage all the default color values by computing them once when Ghidra starts upMost of the colors are borrowed from the ghidra-dark repo (many thanks, Zack!), which I've been using for quite some time.
Why?
There are several great repos that bring dark mode into Ghidra, and I find myself using ghidra-dark the most.
The way it works: it uses a python script to
However, some color values in Ghidra aren't configurable, such as the background of graphs and
GTable
.This commit aims to fix all that by integrating the spirit of ghidra-dark into Ghidra, and introduce a different set of default color values for those that aren't configurable.
How it looks like
Some of the most commonly used windows look like this:
The file chooser:
The banner:
How to use it
Step 1:

Step 2:

Step 3: restart Ghidra
That's it!
As you might have noticed, there are 2 new Swing Look And Feel themes:
Known issues
Ghidra/Features/Decompiler/src/main/help/help/topics/DecompilePlugin/DecompilerConcepts.html
has a hardcodedbgcolor="white"
→ I guess the html files might be auto-generated (so this might not be the right place to patch), but I didn't look into itGTables
are gone (in dark mode)I have little sense in colors, so I tend not to solve the above problems because they involve a little more sense in colors.
Feedback is welcome
I might not be very responsive, but I'll try my best to answer questions.
There might be better ways to do this, and I'd appreciate any suggestions/insights.
I hope you find this useful. =)