Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > Here is the preview I said: https://pasteboard.co/rwUBvWbX6m66.png .
> > The checkbox needs some tinkering.
> > Looking forward to any suggestions.
>
> I would really appreciate it if you could help me make my git-gui look
> like this. What do I need to do, exactly?

It's really good to know that there are people interested in this.
But I am sorry to say that my work on it is temporarily stopped as I
cannot figure out a way to make the top caption bar of a window black
on Windows.
I am trying workarounds in C++ by disabling DWM, but they don't seem to work.
There is a hidden unpublished API in Windows 10 and 11. But I would
like to instead make it work for all OSes starting from Windows 7 at
least.

But, I have the code that will make the screenshot possible.
Simply put:
1. Press Win + R
2. Enter "git-gui.exe --trace" and press Enter
3. Paste the following code(indented for clarity) in the console
window(a white window with red and black text) that appears.
    ttk::style theme use default
    ttk::style configure TFrame -background #333
    ttk::style configure TLabelframe -background #333
    ttk::style configure TLabelframe.Label -background #333 -foreground #fff
    ttk::style configure TPanedwindow  -background #333
    ttk::style configure EntryFrame -background #333
    ttk::style configure TScrollbar -background #666 -troughcolor #444
-arrowcolor #fff -arrowsize 15
    ttk::style map TScrollbar -background \
        [list active #333 disabled #000]
    ttk::style configure TLabel -background #333 -foreground #fff
    ttk::style configure TButton -background #333 -foreground #fff
-borderwidth 2 -bordercolor #fff
    ttk::style map TButton -background \
        [list active #555 disabled #111 readonly #000]
    ttk::style configure TCheckbutton -background #333 -foreground
#fff -indicatorbackground #666 -indicatorcolor #fff
    ttk::style map TCheckbutton -background \
        [list active #555 disabled #111 readonly #000]
    ttk::style configure TEntry -fieldbackground #333 -background #333
-foreground #fff -insertcolor #fff
    ttk::style configure TRadiobutton -background #333 -foreground #fff
    ttk::style map TRadiobutton -background \
        [list active #555 disabled #111 readonly #000]
    option add *TCombobox*Listbox.background #333 interactive
    option add *TCombobox*Listbox.foreground #fff interactive
    option add *TCombobox*Listbox.selectBackground blue interactive
    option add *TCombobox*Listbox.selectForeground #fff interactive
    option add *Listbox.Background #333 interactive
    option add *Listbox.Foreground #fff interactive
    option add *Text.Background #333 interactive
    option add *Text.Foreground #fff interactive
    ttk::style configure TSpinbox -fieldbackground #333 -background
#333 -foreground #fff -insertcolor #fff -arrowcolor #fff
    .vpane.lower.commarea.buffer.frame.t configure -background #0d1117
-foreground #fff -insertbackground #fff
    .vpane.lower.diff.body.t configure -background #0d1117 -foreground #fff
    .vpane.files.workdir.list configure -background #0d1117 -foreground #fff
    .vpane.files.index.list configure -background #0d1117 -foreground #fff
    .about_dialog.git_logo configure -background #333
4. Enjoy Git GUI.

If you get "git-gui.exe: command not found", it implies that the exe
for Git GUI isn't installed in your path. Then you should manually
find the path to the exe(mostly will be in "C:\Program Files\Git\cmd")
and execute it in Win + R prompt as "C:\Program
Files\Git\cmd\git-gui.exe --trace" and then press Enter. Then enter
the code.

The code I provided also changes some of the Tcl/Tk core defaults for
maximum dark mode effect. So, it isn't possible to revert to light
mode on the run. Closing and reopening all the Git GUI windows will
revert it back.
I did not test a location for the persistence of dark mode, I will dig
deeper into the TCL soon.
You should execute the code at the start of the Git GUI for it to work
perfectly.

Preview for
"Create Branch": [0]
"Checkout Branch": [1]
"Options": [2]

[0]: https://pasteboard.co/PVXqzigC1Hvs.png
[1]: https://pasteboard.co/MRjlQ23ldVKO.png
[2]: https://pasteboard.co/HalaJ8Rw1BDU.png



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux