All of lore.kernel.org
 help / color / mirror / Atom feed
* [INFO] Does Git GUI support Dark Mode on Windows 10 ?
@ 2021-09-26 15:09 Sashank Bandi
  2021-09-27  6:32 ` Bagas Sanjaya
  0 siblings, 1 reply; 20+ messages in thread
From: Sashank Bandi @ 2021-09-26 15:09 UTC (permalink / raw)
  To: git

Hello,

I am new to the concept of mailing lists so please bear with me.

I'm a JS developer. I love Git GUI for its minimalism in both size and
layout. I have been using Git and Git GUI on Windows for a long time.
I think the only thing missing from the "Official" Git GUI is dark
mode.

I use dark mode on almost all places. Firefox, Discord, GitHub,
Outlook, Notepad++, VS Code and even Reddit too. The only place that
is missing dark mode in my workflow is Git GUI.

Is there any way I can make Git GUI dark mode ?

I don't know a lot of Tcl/Tk but I am currently trying to learn it. I
did a few edits and made the About page in dark mode.
You can look at it here:
https://user-images.githubusercontent.com/76554862/134190271-d861407a-31be-436d-aac4-9ea3d72f0fb0.png
.

I have found two threads in the mailing list but those are just dead
ends for me. Hence I reached this mailing list.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  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
  0 siblings, 1 reply; 20+ messages in thread
From: Bagas Sanjaya @ 2021-09-27  6:32 UTC (permalink / raw)
  To: Sashank Bandi, git

On 26/09/21 22.09, Sashank Bandi wrote:
> Hello,
> 
> I am new to the concept of mailing lists so please bear with me.
> 
> I'm a JS developer. I love Git GUI for its minimalism in both size and
> layout. I have been using Git and Git GUI on Windows for a long time.
> I think the only thing missing from the "Official" Git GUI is dark
> mode.
> 
> I use dark mode on almost all places. Firefox, Discord, GitHub,
> Outlook, Notepad++, VS Code and even Reddit too. The only place that
> is missing dark mode in my workflow is Git GUI.
> 
> Is there any way I can make Git GUI dark mode ?
> 
> I don't know a lot of Tcl/Tk but I am currently trying to learn it. I
> did a few edits and made the About page in dark mode.
> You can look at it here:
> https://user-images.githubusercontent.com/76554862/134190271-d861407a-31be-436d-aac4-9ea3d72f0fb0.png
> .
> 
> I have found two threads in the mailing list but those are just dead
> ends for me. Hence I reached this mailing list.
> 

I would rather like to see yourself posted PR to the dedicated subsytem 
at [1].

I think you want to implement tri-state `Dark mode` option. When it is 
set to `Yes`, always use dark theme regardless of system settings; when 
it is `No` the opposite; and `Auto` use dark theme when it is enabled in 
system settings, normal the opposite.

[1]: https://github.com/prati0100/git-gui.git

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-09-27  6:32 ` Bagas Sanjaya
@ 2021-09-27 10:19   ` Sashank Bandi
  2021-09-27 10:39     ` Bagas Sanjaya
  0 siblings, 1 reply; 20+ messages in thread
From: Sashank Bandi @ 2021-09-27 10:19 UTC (permalink / raw)
  To: git; +Cc: bagasdotme, me

On Mon, Sep 27, 2021 at 12:02 PM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
>
> On 26/09/21 22.09, Sashank Bandi wrote:
> > Hello,
> >
> > I am new to the concept of mailing lists so please bear with me.
> >
> > I'm a JS developer. I love Git GUI for its minimalism in both size and
> > layout. I have been using Git and Git GUI on Windows for a long time.
> > I think the only thing missing from the "Official" Git GUI is dark
> > mode.
> >
> > I use dark mode on almost all places. Firefox, Discord, GitHub,
> > Outlook, Notepad++, VS Code and even Reddit too. The only place that
> > is missing dark mode in my workflow is Git GUI.
> >
> > Is there any way I can make Git GUI dark mode ?
> >
> > I don't know a lot of Tcl/Tk but I am currently trying to learn it. I
> > did a few edits and made the About page in dark mode.
> > You can look at it here:
> > https://user-images.githubusercontent.com/76554862/134190271-d861407a-31be-436d-aac4-9ea3d72f0fb0.png
> > .
> >
> > I have found two threads in the mailing list but those are just dead
> > ends for me. Hence I reached this mailing list.
> >
>
> I would rather like to see yourself posted PR to the dedicated subsytem
> at [1].
Nice to hear that you like my design.
I think this confirms my suspicion that there is no "Official" Git GUI Dark
Mode on Windows 10.

> I think you want to implement tri-state `Dark mode` option. When it is
> set to `Yes`, always use dark theme regardless of system settings; when
> it is `No` the opposite; and `Auto` use dark theme when it is enabled in
> system settings, normal the opposite.
Our interests conflict here.
I think we should rather provide 3 different options here.
1. System Default
2. Light Mode
3. Dark Mode
I find these options easy rather than the "Yes" or "No" options.

I'm currently planning to convert this into a C++ program as there is no
way from the Tcl itself to change the color and background color of the title
bar or menu of the Git GUI window.

I also CCed Pratyush Yadav as he is the official maintainer of the project.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  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
  0 siblings, 2 replies; 20+ messages in thread
From: Bagas Sanjaya @ 2021-09-27 10:39 UTC (permalink / raw)
  To: Sashank Bandi, git; +Cc: me, Johannes Schindelin

On 27/09/21 17.19, Sashank Bandi wrote:
> I'm currently planning to convert this into a C++ program as there is no
> way from the Tcl itself to change the color and background color of the title
> bar or menu of the Git GUI window.
> 
> I also CCed Pratyush Yadav as he is the official maintainer of the project.
> 

Regarding GUI toolkit, you should pick the replacement carefully - 
tooling used in Git for Windows will need to be adapted in order to 
compile your chosen toolkit (whether it is Qt, GTK, or wxWidgets) for 
Windows.

CC also Johannes Schindelin for comments.

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-09-27 10:39     ` Bagas Sanjaya
@ 2021-09-27 10:51       ` Sashank Bandi
  2021-09-27 18:08       ` David Aguilar
  1 sibling, 0 replies; 20+ messages in thread
From: Sashank Bandi @ 2021-09-27 10:51 UTC (permalink / raw)
  To: Bagas Sanjaya; +Cc: git, me, Johannes Schindelin

I forgot to mention that we also have an alternative.

We can completely ditch C++ idea here and instead remove the native
title bar or border that the Window Manager gives and instead draw our
own title bar in Tcl/Tk. But that means rewriting the menu system.

So, I'm waiting for the decision of Pratyush Yadav here.

> Regarding GUI toolkit, you should pick the replacement carefully -
> tooling used in Git for Windows will need to be adapted in order to
> compile your chosen toolkit (whether it is Qt, GTK, or wxWidgets) for
> Windows.
No, I'm not choosing a toolkit. Whatever I will do, it will be in
native C++ without any other toolkit. It might be a little hard, but
it is better than including another whole library in here. Lightweight
is a reason I chose Git GUI and I will make sure that my contribution
does not make that go.

>
> CC also Johannes Schindelin for comments.
>
> --
> An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  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
  1 sibling, 1 reply; 20+ messages in thread
From: David Aguilar @ 2021-09-27 18:08 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: Sashank Bandi, Git Mailing List, Pratyush Yadav, Johannes Schindelin

On Mon, Sep 27, 2021 at 3:41 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
>
> On 27/09/21 17.19, Sashank Bandi wrote:
> > I'm currently planning to convert this into a C++ program as there is no
> > way from the Tcl itself to change the color and background color of the title
> > bar or menu of the Git GUI window.
> >
> > I also CCed Pratyush Yadav as he is the official maintainer of the project.
> >
>
> Regarding GUI toolkit, you should pick the replacement carefully -
> tooling used in Git for Windows will need to be adapted in order to
> compile your chosen toolkit (whether it is Qt, GTK, or wxWidgets) for
> Windows.

Have you tried git cola? [1]

It uses Qt. It's cross-platform and written in Python.

Git GUI is useful because it's built in, but from a usability
perspective cola has many advantages.

It has a dark mode that works more or less how you described:
- system default
- user-specified theme (dark/light with a few color variations)

.. and beyond these rather small differences, git cola even has image
diffs[2]. That alone is a killer feature.

[1] https://github.com/git-cola/git-cola/

[2] http://git-cola.github.io/screenshots.html
-- 
David

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-09-27 18:08       ` David Aguilar
@ 2021-09-28  3:21         ` Sashank Bandi
  2021-10-03 14:33           ` Sashank Bandi
  0 siblings, 1 reply; 20+ messages in thread
From: Sashank Bandi @ 2021-09-28  3:21 UTC (permalink / raw)
  To: Git Mailing List
  Cc: Bagas Sanjaya, David Aguilar, Pratyush Yadav, Johannes Schindelin

On Mon, Sep 27, 2021 at 11:39 PM David Aguilar <davvid@gmail.com> wrote:
> Have you tried git cola? [1]
Yes, I did try it.

> Git GUI is useful because it's built in, but from a usability
> perspective cola has many advantages.
But it is just too much for my very light usage. I want something
light and embedded in Git for Windows itself.

> .. and beyond these rather small differences, git cola even has image
> diffs[2]. That alone is a killer feature.
It is a really great feature. But it isn't useful for me in my projects.

I have looked at tortoise Git, Git Cola, lazygit and some others too
but Git GUI seems perfect for my usage, except dark mode.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  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
  0 siblings, 2 replies; 20+ messages in thread
From: Sashank Bandi @ 2021-10-03 14:33 UTC (permalink / raw)
  To: Git Mailing List
  Cc: Bagas Sanjaya, David Aguilar, Pratyush Yadav, Johannes Schindelin

Hey!
Is there any way to reach Pratyush Yadav ?
This thread has been stale for days.

On Tue, Sep 28, 2021 at 8:51 AM Sashank Bandi <bandi.rao999@gmail.com> wrote:
>
> On Mon, Sep 27, 2021 at 11:39 PM David Aguilar <davvid@gmail.com> wrote:
> > Have you tried git cola? [1]
> Yes, I did try it.
>
> > Git GUI is useful because it's built in, but from a usability
> > perspective cola has many advantages.
> But it is just too much for my very light usage. I want something
> light and embedded in Git for Windows itself.
>
> > .. and beyond these rather small differences, git cola even has image
> > diffs[2]. That alone is a killer feature.
> It is a really great feature. But it isn't useful for me in my projects.
>
> I have looked at tortoise Git, Git Cola, lazygit and some others too
> but Git GUI seems perfect for my usage, except dark mode.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-10-03 14:33           ` Sashank Bandi
@ 2021-10-04  3:29             ` Bagas Sanjaya
  2021-10-04  7:56             ` Pratyush Yadav
  1 sibling, 0 replies; 20+ messages in thread
From: Bagas Sanjaya @ 2021-10-04  3:29 UTC (permalink / raw)
  To: Sashank Bandi, Git Mailing List
  Cc: David Aguilar, Pratyush Yadav, Johannes Schindelin, Junio C Hamano

On 03/10/21 21.33, Sashank Bandi wrote:
> Hey!
> Is there any way to reach Pratyush Yadav ?
> This thread has been stale for days.

CC'ing Junio for now.

-- 
An old man doll... just what I always wanted! - Clara

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  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
  1 sibling, 1 reply; 20+ messages in thread
From: Pratyush Yadav @ 2021-10-04  7:56 UTC (permalink / raw)
  To: Sashank Bandi
  Cc: Git Mailing List, Bagas Sanjaya, David Aguilar, Johannes Schindelin

Hi Sashank,


On 03/10/21 08:03PM, Sashank Bandi wrote:
> Hey!
> Is there any way to reach Pratyush Yadav ?
> This thread has been stale for days.

Sorry, I couldn't find time to catch up on this because its been busy at 
$DAYJOB.

Anyway, git-gui does have some basic dark mode support, though I have 
seen reports that it does not work very well. You can change the Tk 
theme and it should enable dark mode on git-gui as well. See [0] for 
some more info. I am not very familiar with how Tk theming would work on 
Windows.

I think it would be nice if we can have a theme picker in the options 
menu though, so that is something you might want to look into.

[0] https://lore.kernel.org/all/20201008082004.5643-1-serg.partizan@gmail.com/

> 
> On Tue, Sep 28, 2021 at 8:51 AM Sashank Bandi <bandi.rao999@gmail.com> wrote:
> >
> > On Mon, Sep 27, 2021 at 11:39 PM David Aguilar <davvid@gmail.com> wrote:
> > > Have you tried git cola? [1]
> > Yes, I did try it.
> >
> > > Git GUI is useful because it's built in, but from a usability
> > > perspective cola has many advantages.
> > But it is just too much for my very light usage. I want something
> > light and embedded in Git for Windows itself.
> >
> > > .. and beyond these rather small differences, git cola even has image
> > > diffs[2]. That alone is a killer feature.
> > It is a really great feature. But it isn't useful for me in my projects.
> >
> > I have looked at tortoise Git, Git Cola, lazygit and some others too
> > but Git GUI seems perfect for my usage, except dark mode.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-10-04  7:56             ` Pratyush Yadav
@ 2021-10-04 15:09               ` Sashank Bandi
  2021-10-06 11:39                 ` Pratyush Yadav
  0 siblings, 1 reply; 20+ messages in thread
From: Sashank Bandi @ 2021-10-04 15:09 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Git Mailing List, Bagas Sanjaya, David Aguilar, Johannes Schindelin

On Mon, Oct 4, 2021 at 1:26 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> Sorry, I couldn't find time to catch up on this because its been busy at
> $DAYJOB.
Well, I hope you got a little time for this thread.

> Anyway, git-gui does have some basic dark mode support, though I have
> seen reports that it does not work very well. You can change the Tk
> theme and it should enable dark mode on git-gui as well. See [0] for
> some more info. I am not very familiar with how Tk theming would work on
> Windows.
I am not even familiar with Tcl/Tk language itself. But from what I
have found, the Tk uses "vista" theme which is Windows-only default
theme.

> I think it would be nice if we can have a theme picker in the options
> menu though, so that is something you might want to look into.
Yes, I thought of adding a menu between "Tools" and "Help". It will
contain 3 options(system, light, dark) as I said before.

> [0] https://lore.kernel.org/all/20201008082004.5643-1-serg.partizan@gmail.com/
Well, this works only for Linux as Windows doesn't use X Server. But
we can use `ttk::style theme use` for it all over the application.

My plan is to use a new theme, that is based on default, but can
imitate the look of [0].

[0]: https://github.com/TkinterEP/ttkthemes/blob/master/ttkthemes/png/equilux/equilux.tcl

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-10-04 15:09               ` Sashank Bandi
@ 2021-10-06 11:39                 ` Pratyush Yadav
  2021-10-06 14:45                   ` Sashank Bandi
  0 siblings, 1 reply; 20+ messages in thread
From: Pratyush Yadav @ 2021-10-06 11:39 UTC (permalink / raw)
  To: Sashank Bandi
  Cc: Git Mailing List, Bagas Sanjaya, David Aguilar, Johannes Schindelin

On 04/10/21 08:39PM, Sashank Bandi wrote:
> On Mon, Oct 4, 2021 at 1:26 PM Pratyush Yadav <me@yadavpratyush.com> wrote:
> > Sorry, I couldn't find time to catch up on this because its been busy at
> > $DAYJOB.
> Well, I hope you got a little time for this thread.
> 
> > Anyway, git-gui does have some basic dark mode support, though I have
> > seen reports that it does not work very well. You can change the Tk
> > theme and it should enable dark mode on git-gui as well. See [0] for
> > some more info. I am not very familiar with how Tk theming would work on
> > Windows.
> I am not even familiar with Tcl/Tk language itself. But from what I
> have found, the Tk uses "vista" theme which is Windows-only default
> theme.

Does the Windows installation come with any other themes? You can use 
`ttk::style theme names` to list all available themes.

> 
> > I think it would be nice if we can have a theme picker in the options
> > menu though, so that is something you might want to look into.
> Yes, I thought of adding a menu between "Tools" and "Help". It will
> contain 3 options(system, light, dark) as I said before.

I think it would be better to put it in the "options" dialog.

> 
> > [0] https://lore.kernel.org/all/20201008082004.5643-1-serg.partizan@gmail.com/
> Well, this works only for Linux as Windows doesn't use X Server. But
> we can use `ttk::style theme use` for it all over the application.

Right.

> 
> My plan is to use a new theme, that is based on default, but can
> imitate the look of [0].

I don't mind carrying themes in the git-gui repo since Tk theming 
support is not very well documented or standardized. But please do be 
careful of licence compatibility when porting code.

> 
> [0]: https://github.com/TkinterEP/ttkthemes/blob/master/ttkthemes/png/equilux/equilux.tcl

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-10-06 11:39                 ` Pratyush Yadav
@ 2021-10-06 14:45                   ` Sashank Bandi
  2021-10-06 18:03                     ` Pratyush Yadav
  0 siblings, 1 reply; 20+ messages in thread
From: Sashank Bandi @ 2021-10-06 14:45 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Git Mailing List, Bagas Sanjaya, David Aguilar, Johannes Schindelin

> Does the Windows installation come with any other themes? You can use
> `ttk::style theme names` to list all available themes.
It contains all these themes in Windows 10 x64.
"winnative clam alt default classic vista xpnative"
Based of [0] (the best source I could find),
"winnative", "vista", "xpnative" are Windows-only but built-in themes and
"clam", "alt", "default", "classic" are built-in themes for all OSes.
And this is part of the reason I am considering "default" to be the
base of the new theme that I want to create instead of "vista".

> > > I think it would be nice if we can have a theme picker in the options
> > > menu though, so that is something you might want to look into.
> > Yes, I thought of adding a menu between "Tools" and "Help". It will
> > contain 3 options(system, light, dark) as I said before.
>
> I think it would be better to put it in the "options" dialog.
Ok.

> I don't mind carrying themes in the git-gui repo since Tk theming
> support is not very well documented or standardized. But please do be
> careful of licence compatibility when porting code.
No, I want to imitate the look. And I don't actually know much about
the license or legal side of the software so I try to avoid it at all
costs and start from scratch.
Kinda like "Linux is Unix-like, but it doesn't contain Unix's code" -
The great Linus Torvalds.

The "equilux" theme is GPLv3, but I didn't find a license file in the
repo. In the "Help > About" part of Git GUI, you mentioned it being
GPL(I think v1). Please include it in the repo too.

[0]: https://wiki.tcl-lang.org/page/List+of+ttk+Themes

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-10-06 14:45                   ` Sashank Bandi
@ 2021-10-06 18:03                     ` Pratyush Yadav
  2021-10-07 11:27                       ` Sashank Bandi
  0 siblings, 1 reply; 20+ messages in thread
From: Pratyush Yadav @ 2021-10-06 18:03 UTC (permalink / raw)
  To: Sashank Bandi
  Cc: Git Mailing List, Bagas Sanjaya, David Aguilar, Johannes Schindelin

On 06/10/21 08:15PM, Sashank Bandi wrote:
> > Does the Windows installation come with any other themes? You can use
> > `ttk::style theme names` to list all available themes.
> It contains all these themes in Windows 10 x64.
> "winnative clam alt default classic vista xpnative"
> Based of [0] (the best source I could find),
> "winnative", "vista", "xpnative" are Windows-only but built-in themes and
> "clam", "alt", "default", "classic" are built-in themes for all OSes.
> And this is part of the reason I am considering "default" to be the
> base of the new theme that I want to create instead of "vista".

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 think it would be nice if we can have a theme picker in the options
> > > > menu though, so that is something you might want to look into.
> > > Yes, I thought of adding a menu between "Tools" and "Help". It will
> > > contain 3 options(system, light, dark) as I said before.
> >
> > I think it would be better to put it in the "options" dialog.
> Ok.
> 
> > I don't mind carrying themes in the git-gui repo since Tk theming
> > support is not very well documented or standardized. But please do be
> > careful of licence compatibility when porting code.
> No, I want to imitate the look. And I don't actually know much about
> the license or legal side of the software so I try to avoid it at all
> costs and start from scratch.
> Kinda like "Linux is Unix-like, but it doesn't contain Unix's code" -
> The great Linus Torvalds.

Well, I am not expert on software licenses either. Though using a quick 
Google search for license compatibility generally does the trick for me.

> 
> The "equilux" theme is GPLv3, but I didn't find a license file in the
> repo. In the "Help > About" part of Git GUI, you mentioned it being
> GPL(I think v1). Please include it in the repo too.

git-gui is GPL v2 or later. So I would assume it is compatible with GPL 
v3 but I am not entirely sure.

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"}}
 		} {
-- 
Regards,
Pratyush Yadav

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-10-06 18:03                     ` Pratyush Yadav
@ 2021-10-07 11:27                       ` Sashank Bandi
  0 siblings, 0 replies; 20+ messages in thread
From: Sashank Bandi @ 2021-10-07 11:27 UTC (permalink / raw)
  To: Pratyush Yadav
  Cc: Git Mailing List, Bagas Sanjaya, David Aguilar, Johannes Schindelin

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2022-01-17 14:33   ` Birger Skogeng Pedersen
@ 2022-01-17 14:40     ` Birger Skogeng Pedersen
  0 siblings, 0 replies; 20+ messages in thread
From: Birger Skogeng Pedersen @ 2022-01-17 14:40 UTC (permalink / raw)
  To: Sashank Bandi; +Cc: Git Mailing List

Hi again,

I think I found the problem. Should be okay now.

Thanks, again

On Mon, Jan 17, 2022 at 3:33 PM Birger Skogeng Pedersen
<birger.sp@gmail.com> wrote:
>
> Thanks a lot for trying to help me, Sashank. There seems to be an
> issue with the code. I had to take a little guess at where the actual
> line breaks should be, maybe I messed up?
>
> I pasted the code here: https://github.com/prati0100/git-gui/issues/64
>
> Can you take a look?
>
> Best regards,
> Birger

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-12-21 16:14 ` Sashank Bandi
@ 2022-01-17 14:33   ` Birger Skogeng Pedersen
  2022-01-17 14:40     ` Birger Skogeng Pedersen
  0 siblings, 1 reply; 20+ messages in thread
From: Birger Skogeng Pedersen @ 2022-01-17 14:33 UTC (permalink / raw)
  To: Sashank Bandi; +Cc: Git Mailing List

Thanks a lot for trying to help me, Sashank. There seems to be an
issue with the code. I had to take a little guess at where the actual
line breaks should be, maybe I messed up?

I pasted the code here: https://github.com/prati0100/git-gui/issues/64

Can you take a look?

Best regards,
Birger

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
  2021-12-13  8:03 Birger Skogeng Pedersen
@ 2021-12-21 16:14 ` Sashank Bandi
  2022-01-17 14:33   ` Birger Skogeng Pedersen
  0 siblings, 1 reply; 20+ messages in thread
From: Sashank Bandi @ 2021-12-21 16:14 UTC (permalink / raw)
  To: Birger Skogeng Pedersen
  Cc: Johannes Schindelin, Bagas Sanjaya, David Aguilar,
	Git Mailing List, Pratyush Yadav

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

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
@ 2021-12-13  8:03 Birger Skogeng Pedersen
  2021-12-21 16:14 ` Sashank Bandi
  0 siblings, 1 reply; 20+ messages in thread
From: Birger Skogeng Pedersen @ 2021-12-13  8:03 UTC (permalink / raw)
  To: bandi.rao999; +Cc: Johannes.Schindelin, bagasdotme, davvid, git, me

Hi,


First of all just a BIG +1 to this issue. I'm on windows and opening
git-gui sometimes literally hurts my eyes. I even noticed I've started
squinting a little before opening it, then I move it to my side
monitor and open my IDE (which ofc is dark theme) on my main.

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


Best regards,
Birger

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [INFO] Does Git GUI support Dark Mode on Windows 10 ?
@ 2021-12-08 12:29 Birger Skogeng Pedersen
  0 siblings, 0 replies; 20+ messages in thread
From: Birger Skogeng Pedersen @ 2021-12-08 12:29 UTC (permalink / raw)
  To: bandi.rao999; +Cc: Johannes.Schindelin, bagasdotme, davvid, git, me

Hi,

Just wanted to give a BIG +1 to this issue. I have all my applications
switched to dark mode and a light filter installed on my computer, but
every time I open git-gui it really is a big flash to my eyes. I
started using other clients because of this but I prefer the workflow
I've had with git-gui over the alternatives.

What is a quick and easy way to apply a "dark" theme to git-gui in Windows 10?

Best regards,
Birger

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-01-17 14:40 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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.