All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sashank Bandi <bandi.rao999@gmail.com>
To: Pratyush Yadav <me@yadavpratyush.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Bagas Sanjaya <bagasdotme@gmail.com>,
	David Aguilar <davvid@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
Date: Thu, 7 Oct 2021 16:57:37 +0530	[thread overview]
Message-ID: <CABkJDHFadi60bbwN758f2qov5dMXV2nWOwYHYVPtdfScze1XmQ@mail.gmail.com> (raw)
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.

> 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.

  reply	other threads:[~2021-10-07 11:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-26 15:09 [INFO] Does Git GUI support Dark Mode on Windows 10 ? Sashank Bandi
2021-09-27  6:32 ` Bagas Sanjaya
2021-09-27 10:19   ` Sashank Bandi
2021-09-27 10:39     ` Bagas Sanjaya
2021-09-27 10:51       ` Sashank Bandi
2021-09-27 18:08       ` David Aguilar
2021-09-28  3:21         ` Sashank Bandi
2021-10-03 14:33           ` Sashank Bandi
2021-10-04  3:29             ` Bagas Sanjaya
2021-10-04  7:56             ` Pratyush Yadav
2021-10-04 15:09               ` Sashank Bandi
2021-10-06 11:39                 ` Pratyush Yadav
2021-10-06 14:45                   ` Sashank Bandi
2021-10-06 18:03                     ` Pratyush Yadav
2021-10-07 11:27                       ` Sashank Bandi [this message]
2021-12-08 12:29 Birger Skogeng Pedersen
2021-12-13  8:03 Birger Skogeng Pedersen
2021-12-21 16:14 ` Sashank Bandi
2022-01-17 14:33   ` Birger Skogeng Pedersen
2022-01-17 14:40     ` Birger Skogeng Pedersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABkJDHFadi60bbwN758f2qov5dMXV2nWOwYHYVPtdfScze1XmQ@mail.gmail.com \
    --to=bandi.rao999@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=bagasdotme@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@yadavpratyush.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.