prati0100 / git-gui

Tcl/Tk based UI for Git. I am currently acting as the project's maintainer.
161 stars 87 forks source link

add option to disable dark mode (themed widgets) #30

Closed martin-weiser-allegro-packets closed 3 years ago

martin-weiser-allegro-packets commented 4 years ago

git-gui version 0.21.0.53.g0d211

When running in dark mode on macOS the UI looks pretty broken and e.g. the cursor is not even visible in the commit message text box.

gitk provides an option to enable/disable "Use themed widgets" which allows you to go back to the normal UI despite using dark mode in the rest of the OS. Something like that should be available for git-gui, too.

prati0100 commented 4 years ago

Hi,

Does setting gui.usettk to 0 work for you?

You can do that by running:

git config gui.usettk 0

If it does, it might be a good idea to add an option to toggle this in the settings menu.

martin-weiser-allegro-packets commented 4 years ago

Thanx for the suggestion but unfortunately it does not make a difference. I can see that the that the value is set (gui.usettk=0) in 'git config --list' but the application looks and behaves the same.

prati0100 commented 4 years ago

Do you set the "Use themed widgets" in gitk to yes or no? Make the config variable gui.usettk reflect that value. So, if you choose "Use themed widgets" as yes, then set gui.usettk to 1 and vice versa.

Since both gitk and git-gui use very similar mechanisms for theming (ttk), their behaviour should be largely the same. If this doesn't work for you, can you send screenshots of both git-gui and gitk with ttk enabled and disabled?

martin-weiser-allegro-packets commented 4 years ago

I disabled "Use themed widgets" in gitk.

Actually setting gui.usettk did change the appearance of git-gui slightly, which I did not notice before. But it does not fix the issue of a strange appearance and the cursor not being visible.

This is gitk with "Use themed widgets" enabled:

gitk-themed

This is gitk with "Use themed widgets" disabled:

gitk-not-themed

This is git-gui with gui.usettk=1

git-gui-ttk-1

This is git-gui with gui.usettk=0

git-gui-ttk-0

And this is git-gui when I set macOS to light mode:

git-gui-light

prati0100 commented 3 years ago

@last-partizan sent out a patch to add basic dark mode support for git-gui that can be found here. Can you please test it and see if it works for you?

last-partizan commented 3 years ago

My main OS is Linux, but i've had an opportunity to test this on mac.

Screenshot 2020-09-26 at 16 12 04

My patch indeed fixes invisible cursor, but i need to do this,

export PATH="/usr/local/opt/tcl-tk/bin:$PATH"

otherwise theme was not applied and fonts was looking horrible.

I still working on sending this patch to maillist, but you can check it here: https://github.com/last-partizan/git-gui/tree/dark-colors

last-partizan commented 3 years ago

I think this issue must be closed, as "adding option to disable dark mode" is workaround, and proper way is to fix a bug #39.

prati0100 commented 3 years ago

Closing. #39 should fix this problem too.