Re: [PATCH 4/4] git-gui--askyesno (mingw): use Git for Windows' icon, if available
- From
Pratyush Yadav <me@yadavpratyush.com>
- Date
- Sep 29, 2019, 18:01 UTC
- Message-ID
- <20190929180157.ogwmiaer4pjjduoj@yadavpratyush.com>
- In-Reply-To
- <6025b38d2659caa111d2e5e9a1fa48d47de0e827.1569511793.git.gitgitgadget@gmail.com>
Since this is a git-gui dialog/prompt, why not use the git-gui icon? This will mean some uniformity between all the platforms (though I'm not sure if other platforms even use GIT_ASK_YESNO). It would also probably save you the hacks needed to find out the git-for-windows icon.
Well, there is the problem that the git-gui logo is not in any external file, and is inside git-gui.sh (as a vector image, but I'm not sure). But I'd like to at least start some discussion in this direction.
On 26/09/19 08:30AM, Johannes Schindelin via GitGitGadget wrote:
Show 33 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> For additional GUI goodness.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> git-gui--askyesno | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/git-gui--askyesno b/git-gui--askyesno
> index 45b0260eff..c0c82e7cbd 100755
> --- a/git-gui--askyesno
> +++ b/git-gui--askyesno
> @@ -52,5 +52,17 @@ proc yes {} {
> exit 0
> }
>
> +if {$::tcl_platform(platform) eq {windows}} {
> + set icopath [file dirname [file normalize $argv0]]
> + if {[file tail $icopath] eq {git-core}} {
> + set icopath [file dirname $icopath]
> + }
> + set icopath [file dirname $icopath]
> + set icopath [file join $icopath share git git-for-windows.ico]
> + if {[file exists $icopath]} {
> + wm iconbitmap . -default $icopath
> + }
> +}
> +
> wm title . $title
> tk::PlaceWindow .
> --
> gitgitgadget-- Regards, Pratyush Yadav