-
Notifications
You must be signed in to change notification settings - Fork 85
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
Change the background colour #44
Comments
I have also just did update, which brought me to git 2.29 and git-gui git-gui version 0.21.0.78.g38c2a. I instantly noticed a change to both background and font color. The color don't match what you describe, but the issue is likely the same. I am also on Ubuntu MATE (but using 16.04). The readability of all text (in all 4 quadrants) has been worsened. Basically: The background is no longer white, is more of a grayish, and the text is now much lighter (used to be basically black). This makes the contrast a lot lower and makes it noticeably harder to read anything. Any help would be very appreciated |
@rdiez @MaxLap git-gui recently got better theming support. The background colors are the ones from the default Tk theme. Unfortunately it looks like the defaults are not very good because I have seen multiple reports about this. You have two options to fix this:
I am closing this issue for now because it really is not our fault some distros use weird default themes (things look sane on my Arch installation). Please feel free to repoen it if the above two options don't work for you. |
Thanks for the quick feedback. I tried using your 2nd point and it seemed to have no effect, or barely any effect, and not on those colors. I also tried tweaking the theming as your 1st point mention, but I had to have super generic rules such as *background and *foreground, which clearly broke too many thing. It's like I had a default theming customization, so even changing theme wouldn't fix the problem. I found this post: https://superuser.com/a/1351752, which explains that Ubuntu MATE as a weird default theme which is actually applied after user themes... Anyways, disabling as the post explains that bought back the colors I expected. From the post:
Feels so much better! |
Huh... That should not happen and is certainly a bug. I have some suspicion what is going wrong. Anyway, seeing how many people are struggling with theming I think it is a good idea to add a theme selector for git-gui. Other Tk application be damned, we can at least make theming easy for our users. |
I can confirm that "git config --global gui.usettk 0" has no effect on my computer either. |
@rdiez and this is really strange. Please try to put this into ~/.Xresources:
And use Now text should be white: |
I tried the fix linked by MaxLap above, and it worked. This is the command I used:
That change works after loging off and on again. On my system, that gave me the usual white background colour. In order to undo the change, I issued the following command:
Without that change, what you suggest with ~/.Xresources does not work on Ubuntu MATE 20.04. With that change in place, it does work. For example, you can change the background colour to pink with a ~/.Xresources file like this:
The trouble is, command So my advice would be not to use ~/.Xresources unless you really do not like the default colour that disabling Alas, it is not easy to find out what Tk themes are available: "The ability to retrieve a list of all currently available styles is currently not supported.". See https://tip.tcl.tk/584 . This is all too much work for most of us. It would be nice if git-gui had an option, or a command-line argument, to list all Tk themes available, and to specify the Tk theme to use. Another option would be to provide an option, or a command-line argument, to specify the background colour to use. With such options, it would be much easier to avoid hard-to-read colour combinations that result from strange Linux distros and/or strange Tk settings. |
I just loaded Ubuntu Mate 20.04 into virtual machine, and i'm looking at:
And this is exactly what causing this issues. Git-gui instead of hardcoded white/dark colors now respects what current theme suggests, and it suggests this. I'ts even not a theme, it's just preconfigured Xresources, so changing tk theme would not help. git-gui tries to get options from theme, but ubuntu overrides it with forced values.
Looks like Ubuntu just merges all this into Xresources database, and, because none of the files specifies app name (like As a workaround, setting color in
To revert it - just remove that file and relogin. At login this database is populated from app-defaults + ~/.Xresources. Proper solution is this case: report it to Ubuntu, so they would fix wildcard options in app-defaults. Adding options or command line arguments in git-gui to fix issues caused by other things is not good solution. @prati0100 maybe you can suggest other solution. Maybe there is a way change this: option add *Text.background $text_bg widgetDefault to something without wildcard, like We can change priority from |
Thanks for the information. It is not easy to find this kind of details in the documentation of Tk or xrdb. I can imagine that a user may want to change the colour of some element in git-gui, just like in any other application. May I suggest adding a section about this in the man page? Otherwise, how is the user supposed to know that the Tk application name is "git-citool"? I would have thought it would be "git gui" or "git-gui". A section like the following would help prevent frustration: ----8<----8<----8<---- The application name for Tk configuration purposes is "git-citool". For example, in order to change the text background colour, add to your ~/.Xresources file the following line: git-citool*Text.background: #fff And then issue the following command, in order to avoid having to relogin: xrdb -merge ~/.Xresources That's enough information to satisfy the most common requirement, and it provides some hints for anybody to search the Internet for more information if they wish. Note that it does not even mention the specific issues with Ubuntu MATE: it is just basic information to help configure git-gui without having to be an expert in X Windows or Tk. I am a (small) open source developer myself, and I try to help my users wherever I can. For extra karma points: ----8<----8<----8<----
|
I recently upgraded my Ubuntu MATE system from version 20.04 to 22.04, and I started having trouble with the colours again. After the upgrade, the Theme was set to "customized", which I do not remember doing myself.
After logging out and in again, the text background was white. But now I couldn't see the highlighting anymore when I selected text with the mouse. I created file ~/.Xresources with the following content:
Note that the Tk resource name prefix has apparently changed from 'git-citool' to 'git-gui'. I then issued this command:
And the text selection colour was OK afterwards. I still do not know why Ubuntu, or maybe only Ubuntu MATE, is setting the Tk colours like that. |
Hello, for 22.04, I first tried with a clean Ubuntu MATE install and had the same problems you mention. Not being familiar with these resources files, i flailed around for a while. I fixed the Text color part, but couldn't figure out the highlight part. I ended up switching to regular Ubuntu because of many papercuts including this one and had no issue with git-gui on Ubuntu. So I would blame MATE. Thanks for posting your fixes, if I switch back, they will useful I'm sure. |
I just realised that the text foreground colour was not really black, but some gray (*Text.foreground: #3d3d3d). I thought that the monitor had gone blurry, or that my eyes were tired. These are the settings I am using now, to be sure (at least for Git Gui):
|
One more thing I have noticed: you probably want to set Text.inactiveSelectBackground to the same value as Text.selectBackground, so:
|
In the meantime, I have realised that Emacs (when configured to use GTK 3, which is the default on my distribution) has similar text colour problems. I have also discovered that switching to Theme Clearlooks-Phénix (package But I have changed a lot of things on my system while testing this kind of problem. Can somebody else confirm that switching to Clearlooks-Phénix fixes the issue? |
I used to have Ubuntu MATE 18.04 with the Git PPA at https://launchpad.net/~git-core/+archive/ubuntu/ppa . I recently upgraded the system to 20.04.1, and with that PPA I now have git gui version 0.21.0.78.g38c2a.
I do not know exactly what triggered the change, but git gui now displays the file list on the left and the main patch window on the right with a rather dark gray background. The text is black and is no longer comfortable to read. The rest of the system displays a white background as usual.
Apparently, you cannot configure the colours inside git gui. So I searched around and found 2 links, because apparently other people wanted colour changes too:
Link 1) https://bbs.archlinux.org/viewtopic.php?id=193668
The command does not work and I am not familiar with X resource files.
Link 2) https://www.mail-archive.com/[email protected]/msg00194.html
That does not provide enough information, but there is a hint that, being a Tcl/Tk application, you may be able to do such things in some standard way. But I could not find a standard Tcl/Tk way to pass command-line arguments or specify some configuration file to change the theme or any other visual aspect.
Could you at least provide some practical instructions to change the background colour?
Thanks in advance,
rdiez
The text was updated successfully, but these errors were encountered: