git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
SBSashank Bandi <bandi.rao999@gmail.com>
Date
Oct 7, 2021, 11:27 UTC
Message-ID
<CABkJDHFadi60bbwN758f2qov5dMXV2nWOwYHYVPtdfScze1XmQ@mail.gmail.com>
In-Reply-To
<20211006180348.22e5c2z4pqkwtokx@yadavpratyush.com>
> You are of course free to design your own theme, but I would suggest you
> try all these themes already available first and see if any of them fit
> your needs.

I have tried all of these themes. "default" seems like it will fit. I have some color changes and a preview linked at the bottom. If you agree with that, I will work on other pages/sections too.

Show 59 quoted lines
> Anyway, I came up with a quick proof of concept for a theme selector. It
> has many limitations and is not fit to apply just yet, but it should
> help you get started.
>
> -- 8< --
> Subject: [PATCH] git-gui: Add a very crude theme selector
>
> Tk themeing is not very well documented and is not easy to get right.
> Ideally one would want to set the theme for a toolkit in one standard,
> but it is hard to find that standard config for Tk and even harder to
> get it to work consistently.
>
> Add a theme selection menu to make the lives of the user easier. Those
> who would wish to use the Tk provided theme should be able to do so.
>
> This is a very crude patch and it does not really ensure that. This is
> more of a proof of concept.
>
> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
> ---
>  git-gui.sh     | 4 ++++
>  lib/option.tcl | 1 +
>  2 files changed, 5 insertions(+)
>
> diff --git a/git-gui.sh b/git-gui.sh
> index 201524c..ff2ec1b 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -862,6 +862,9 @@ proc apply_config {} {
>                         set NS ttk
>                         bind [winfo class .] <<ThemeChanged>> [list InitTheme]
>                         pave_toplevel .
> +                       if {[get_config gui.theme] != {}} {
> +                               ttk::style theme use [get_config gui.theme]
> +                       }
>                         color::sync_with_theme
>                 }
>         }
> @@ -895,6 +898,7 @@ set default_config(gui.fontdiff) [font configure font_diff]
>  # TODO: this option should be added to the git-config documentation
>  set default_config(gui.maxfilesdisplayed) 5000
>  set default_config(gui.usettk) 1
> +set default_config(gui.theme) "default"
>  set default_config(gui.warndetachedcommit) 1
>  set default_config(gui.tabsize) 8
>  set font_descs {
> diff --git a/lib/option.tcl b/lib/option.tcl
> index e43971b..acce160 100644
> --- a/lib/option.tcl
> +++ b/lib/option.tcl
> @@ -160,6 +160,7 @@ proc do_options {} {
>                 {c gui.encoding {mc "Default File Contents Encoding"}}
>                 {b gui.warndetachedcommit {mc "Warn before committing to a detached head"}}
>                 {s gui.stageuntracked {mc "Staging of untracked files"} {list "yes" "no" "ask"}}
> +               {s gui.theme {mc "GUI theme"} {ttk::style theme names}}
>                 {b gui.displayuntracked {mc "Show untracked files"}}
>                 {i-1..99 gui.tabsize {mc "Tab spacing"}}
>                 } {
> --

Thank you. This helps me find the location of the options. I will further improve this.

Here is the preview I said: https://pasteboard.co/rwUBvWbX6m66.png . The checkbox needs some tinkering. Looking forward to any suggestions.

Previous: Pratyush Yadav
Message 15 of 15 in “[INFO] Does Git GUI support Dark Mode on Windows 10 ?”
  1. Sashank BandiSep 26, 2021
  2. Bagas SanjayaSep 27, 2021
  3. Sashank BandiSep 27, 2021
  4. Bagas SanjayaSep 27, 2021
  5. Sashank BandiSep 27, 2021
  6. David AguilarSep 27, 2021
  7. Sashank BandiSep 28, 2021
  8. Sashank BandiOct 3, 2021
  9. Bagas SanjayaOct 4, 2021
  10. Pratyush YadavOct 4, 2021
  11. Sashank BandiOct 4, 2021
  12. Pratyush YadavOct 6, 2021
  13. Sashank BandiOct 6, 2021
  14. Pratyush YadavOct 6, 2021
  15. Sashank BandiOct 7, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.