Skip to content

Commit 2f331ef

Browse files
committed
Sync with master
2 parents 374f81d + 2a809ec commit 2f331ef

File tree

16 files changed

+65275
-50499
lines changed

16 files changed

+65275
-50499
lines changed

git-gui/git-gui.sh

Lines changed: 54 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,9 @@ proc rmsel_tag {text} {
720720
-background [$text cget -background] \
721721
-foreground [$text cget -foreground] \
722722
-borderwidth 0
723-
$text tag conf in_sel -background lightgray
723+
$text tag conf in_sel\
724+
-background $color::select_bg \
725+
-foreground $color::select_fg
724726
bind $text <Motion> break
725727
return $text
726728
}
@@ -863,6 +865,7 @@ proc apply_config {} {
863865
set NS ttk
864866
bind [winfo class .] <<ThemeChanged>> [list InitTheme]
865867
pave_toplevel .
868+
color::sync_with_theme
866869
}
867870
}
868871
}
@@ -947,15 +950,15 @@ if {![regsub {^git version } $_git_version {} _git_version]} {
947950
}
948951
949952
proc get_trimmed_version {s} {
950-
set r {}
951-
foreach x [split $s -._] {
952-
if {[string is integer -strict $x]} {
953-
lappend r $x
954-
} else {
955-
break
956-
}
957-
}
958-
return [join $r .]
953+
set r {}
954+
foreach x [split $s -._] {
955+
if {[string is integer -strict $x]} {
956+
lappend r $x
957+
} else {
958+
break
959+
}
960+
}
961+
return [join $r .]
959962
}
960963
set _real_git_version $_git_version
961964
set _git_version [get_trimmed_version $_git_version]
@@ -967,7 +970,7 @@ if {![regexp {^[1-9]+(\.[0-9]+)+$} $_git_version]} {
967970
-type yesno \
968971
-default no \
969972
-title "[appname]: warning" \
970-
-message [mc "Git version cannot be determined.
973+
-message [mc "Git version cannot be determined.
971974
972975
%s claims it is version '%s'.
973976
@@ -1653,7 +1656,7 @@ proc prepare_commit_msg_hook_wait {fd_ph} {
16531656
set pch_error {}
16541657
catch {file delete [gitdir PREPARE_COMMIT_MSG]}
16551658
return
1656-
}
1659+
}
16571660
fconfigure $fd_ph -blocking 0
16581661
catch {file delete [gitdir PREPARE_COMMIT_MSG]}
16591662
}
@@ -2001,72 +2004,72 @@ set filemask {
20012004
#define mask_width 14
20022005
#define mask_height 15
20032006
static unsigned char mask_bits[] = {
2004-
0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f,
2005-
0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f,
2006-
0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f};
2007+
0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f,
2008+
0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f,
2009+
0xfe, 0x1f, 0xfe, 0x1f, 0xfe, 0x1f};
20072010
}
20082011
20092012
image create bitmap file_plain -background white -foreground black -data {
20102013
#define plain_width 14
20112014
#define plain_height 15
20122015
static unsigned char plain_bits[] = {
2013-
0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x02, 0x10,
2014-
0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10,
2015-
0x02, 0x10, 0x02, 0x10, 0xfe, 0x1f};
2016+
0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x02, 0x10,
2017+
0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x10,
2018+
0x02, 0x10, 0x02, 0x10, 0xfe, 0x1f};
20162019
} -maskdata $filemask
20172020
20182021
image create bitmap file_mod -background white -foreground blue -data {
20192022
#define mod_width 14
20202023
#define mod_height 15
20212024
static unsigned char mod_bits[] = {
2022-
0xfe, 0x01, 0x02, 0x03, 0x7a, 0x05, 0x02, 0x09, 0x7a, 0x1f, 0x02, 0x10,
2023-
0xfa, 0x17, 0x02, 0x10, 0xfa, 0x17, 0x02, 0x10, 0xfa, 0x17, 0x02, 0x10,
2024-
0xfa, 0x17, 0x02, 0x10, 0xfe, 0x1f};
2025+
0xfe, 0x01, 0x02, 0x03, 0x7a, 0x05, 0x02, 0x09, 0x7a, 0x1f, 0x02, 0x10,
2026+
0xfa, 0x17, 0x02, 0x10, 0xfa, 0x17, 0x02, 0x10, 0xfa, 0x17, 0x02, 0x10,
2027+
0xfa, 0x17, 0x02, 0x10, 0xfe, 0x1f};
20252028
} -maskdata $filemask
20262029
20272030
image create bitmap file_fulltick -background white -foreground "#007000" -data {
20282031
#define file_fulltick_width 14
20292032
#define file_fulltick_height 15
20302033
static unsigned char file_fulltick_bits[] = {
2031-
0xfe, 0x01, 0x02, 0x1a, 0x02, 0x0c, 0x02, 0x0c, 0x02, 0x16, 0x02, 0x16,
2032-
0x02, 0x13, 0x00, 0x13, 0x86, 0x11, 0x8c, 0x11, 0xd8, 0x10, 0xf2, 0x10,
2033-
0x62, 0x10, 0x02, 0x10, 0xfe, 0x1f};
2034+
0xfe, 0x01, 0x02, 0x1a, 0x02, 0x0c, 0x02, 0x0c, 0x02, 0x16, 0x02, 0x16,
2035+
0x02, 0x13, 0x00, 0x13, 0x86, 0x11, 0x8c, 0x11, 0xd8, 0x10, 0xf2, 0x10,
2036+
0x62, 0x10, 0x02, 0x10, 0xfe, 0x1f};
20342037
} -maskdata $filemask
20352038
20362039
image create bitmap file_question -background white -foreground black -data {
20372040
#define file_question_width 14
20382041
#define file_question_height 15
20392042
static unsigned char file_question_bits[] = {
2040-
0xfe, 0x01, 0x02, 0x02, 0xe2, 0x04, 0xf2, 0x09, 0x1a, 0x1b, 0x0a, 0x13,
2041-
0x82, 0x11, 0xc2, 0x10, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10, 0x62, 0x10,
2042-
0x62, 0x10, 0x02, 0x10, 0xfe, 0x1f};
2043+
0xfe, 0x01, 0x02, 0x02, 0xe2, 0x04, 0xf2, 0x09, 0x1a, 0x1b, 0x0a, 0x13,
2044+
0x82, 0x11, 0xc2, 0x10, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10, 0x62, 0x10,
2045+
0x62, 0x10, 0x02, 0x10, 0xfe, 0x1f};
20432046
} -maskdata $filemask
20442047
20452048
image create bitmap file_removed -background white -foreground red -data {
20462049
#define file_removed_width 14
20472050
#define file_removed_height 15
20482051
static unsigned char file_removed_bits[] = {
2049-
0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x02, 0x10,
2050-
0x1a, 0x16, 0x32, 0x13, 0xe2, 0x11, 0xc2, 0x10, 0xe2, 0x11, 0x32, 0x13,
2051-
0x1a, 0x16, 0x02, 0x10, 0xfe, 0x1f};
2052+
0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x02, 0x10,
2053+
0x1a, 0x16, 0x32, 0x13, 0xe2, 0x11, 0xc2, 0x10, 0xe2, 0x11, 0x32, 0x13,
2054+
0x1a, 0x16, 0x02, 0x10, 0xfe, 0x1f};
20522055
} -maskdata $filemask
20532056
20542057
image create bitmap file_merge -background white -foreground blue -data {
20552058
#define file_merge_width 14
20562059
#define file_merge_height 15
20572060
static unsigned char file_merge_bits[] = {
2058-
0xfe, 0x01, 0x02, 0x03, 0x62, 0x05, 0x62, 0x09, 0x62, 0x1f, 0x62, 0x10,
2059-
0xfa, 0x11, 0xf2, 0x10, 0x62, 0x10, 0x02, 0x10, 0xfa, 0x17, 0x02, 0x10,
2060-
0xfa, 0x17, 0x02, 0x10, 0xfe, 0x1f};
2061+
0xfe, 0x01, 0x02, 0x03, 0x62, 0x05, 0x62, 0x09, 0x62, 0x1f, 0x62, 0x10,
2062+
0xfa, 0x11, 0xf2, 0x10, 0x62, 0x10, 0x02, 0x10, 0xfa, 0x17, 0x02, 0x10,
2063+
0xfa, 0x17, 0x02, 0x10, 0xfe, 0x1f};
20612064
} -maskdata $filemask
20622065
20632066
image create bitmap file_statechange -background white -foreground green -data {
20642067
#define file_statechange_width 14
20652068
#define file_statechange_height 15
20662069
static unsigned char file_statechange_bits[] = {
2067-
0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x62, 0x10,
2068-
0x62, 0x10, 0xba, 0x11, 0xba, 0x11, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10,
2069-
0x02, 0x10, 0x02, 0x10, 0xfe, 0x1f};
2070+
0xfe, 0x01, 0x02, 0x03, 0x02, 0x05, 0x02, 0x09, 0x02, 0x1f, 0x62, 0x10,
2071+
0x62, 0x10, 0xba, 0x11, 0xba, 0x11, 0x62, 0x10, 0x62, 0x10, 0x02, 0x10,
2072+
0x02, 0x10, 0x02, 0x10, 0xfe, 0x1f};
20702073
} -maskdata $filemask
20712074
20722075
set ui_index .vpane.files.index.list
@@ -3272,7 +3275,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
32723275
textframe .vpane.files.workdir -height 100 -width 200
32733276
tlabel .vpane.files.workdir.title -text [mc "Unstaged Changes"] \
32743277
-background lightsalmon -foreground black
3275-
ttext $ui_workdir -background white -foreground black \
3278+
ttext $ui_workdir \
32763279
-borderwidth 0 \
32773280
-width 20 -height 10 \
32783281
-wrap none \
@@ -3294,7 +3297,7 @@ textframe .vpane.files.index -height 100 -width 200
32943297
tlabel .vpane.files.index.title \
32953298
-text [mc "Staged Changes (Will Commit)"] \
32963299
-background lightgreen -foreground black
3297-
ttext $ui_index -background white -foreground black \
3300+
ttext $ui_index \
32983301
-borderwidth 0 \
32993302
-width 20 -height 10 \
33003303
-wrap none \
@@ -3321,7 +3324,9 @@ if {!$use_ttk} {
33213324
33223325
foreach i [list $ui_index $ui_workdir] {
33233326
rmsel_tag $i
3324-
$i tag conf in_diff -background [$i tag cget in_sel -background]
3327+
$i tag conf in_diff \
3328+
-background $color::select_bg \
3329+
-foreground $color::select_fg
33253330
}
33263331
unset i
33273332
@@ -3429,7 +3434,7 @@ if {![is_enabled nocommit]} {
34293434
}
34303435
34313436
textframe .vpane.lower.commarea.buffer.frame
3432-
ttext $ui_comm -background white -foreground black \
3437+
ttext $ui_comm \
34333438
-borderwidth 1 \
34343439
-undo true \
34353440
-maxundo 20 \
@@ -3558,7 +3563,7 @@ bind .vpane.lower.diff.header.path <Button-1> {do_file_open $current_diff_path}
35583563
#
35593564
textframe .vpane.lower.diff.body
35603565
set ui_diff .vpane.lower.diff.body.t
3561-
ttext $ui_diff -background white -foreground black \
3566+
ttext $ui_diff \
35623567
-borderwidth 0 \
35633568
-width 80 -height 5 -wrap none \
35643569
-font font_diff \
@@ -3878,18 +3883,18 @@ proc on_application_mapped {} {
38783883
set gm $repo_config(gui.geometry)
38793884
if {$use_ttk} {
38803885
bind .vpane <Map> \
3881-
[list on_ttk_pane_mapped %W 0 [lindex $gm 1]]
3886+
[list on_ttk_pane_mapped %W 0 [lindex $gm 1]]
38823887
bind .vpane.files <Map> \
3883-
[list on_ttk_pane_mapped %W 0 [lindex $gm 2]]
3888+
[list on_ttk_pane_mapped %W 0 [lindex $gm 2]]
38843889
} else {
38853890
bind .vpane <Map> \
3886-
[list on_tk_pane_mapped %W 0 \
3887-
[lindex $gm 1] \
3888-
[lindex [.vpane sash coord 0] 1]]
3891+
[list on_tk_pane_mapped %W 0 \
3892+
[lindex $gm 1] \
3893+
[lindex [.vpane sash coord 0] 1]]
38893894
bind .vpane.files <Map> \
3890-
[list on_tk_pane_mapped %W 0 \
3891-
[lindex [.vpane.files sash coord 0] 0] \
3892-
[lindex $gm 2]]
3895+
[list on_tk_pane_mapped %W 0 \
3896+
[lindex [.vpane.files sash coord 0] 0] \
3897+
[lindex $gm 2]]
38933898
}
38943899
wm geometry . [lindex $gm 0]
38953900
}

git-gui/lib/blame.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ constructor new {i_commit i_path i_jump} {
328328
bind $i <Any-Motion> [cb _show_tooltip $i @%x,%y]
329329
bind $i <Any-Enter> [cb _hide_tooltip]
330330
bind $i <Any-Leave> [cb _hide_tooltip]
331+
bind $i <Deactivate> [cb _hide_tooltip]
331332
bind_button3 $i "
332333
[cb _hide_tooltip]
333334
set cursorX %x

git-gui/lib/themed.tcl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,44 @@
11
# Functions for supporting the use of themed Tk widgets in git-gui.
22
# Copyright (C) 2009 Pat Thoyts <[email protected]>
33

4+
5+
namespace eval color {
6+
# Variable colors
7+
# Preffered way to set widget colors is using add_option.
8+
# In some cases, like with tags in_diff/in_sel, we use these colors.
9+
variable select_bg lightgray
10+
variable select_fg black
11+
12+
proc sync_with_theme {} {
13+
set base_bg [ttk::style lookup . -background]
14+
set base_fg [ttk::style lookup . -foreground]
15+
set text_bg [ttk::style lookup Treeview -background]
16+
set text_fg [ttk::style lookup Treeview -foreground]
17+
set select_bg [ttk::style lookup Default -selectbackground]
18+
set select_fg [ttk::style lookup Default -selectforeground]
19+
20+
set color::select_bg $select_bg
21+
set color::select_fg $select_fg
22+
23+
proc add_option {key val} {
24+
option add $key $val widgetDefault
25+
}
26+
# Add options for plain Tk widgets
27+
# Using `option add` instead of tk_setPalette to avoid unintended
28+
# consequences.
29+
if {![is_MacOSX]} {
30+
add_option *Menu.Background $base_bg
31+
add_option *Menu.Foreground $base_fg
32+
add_option *Menu.activeBackground $select_bg
33+
add_option *Menu.activeForeground $select_fg
34+
}
35+
add_option *Text.Background $text_bg
36+
add_option *Text.Foreground $text_fg
37+
add_option *Text.HighlightBackground $base_bg
38+
add_option *Text.HighlightColor $select_bg
39+
}
40+
}
41+
442
proc ttk_get_current_theme {} {
543
# Handle either current Tk or older versions of 8.5
644
if {[catch {set theme [ttk::style theme use]}]} {

po/TEAMS

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ Members: Changwoo Ryu <[email protected]>
4343
Sihyeon Jang <[email protected]>
4444

4545
Language: pt_PT (Portuguese - Portugal)
46-
Repository: https://github.com/vascool/git-po-pt/
47-
Leader: Vasco Almeida <[email protected]>
48-
Members: Marco Sousa <marcomsousa AT gmail.com>
46+
Repository: https://github.com/git-l10n-pt-PT/git-po/
47+
Leader: Daniel Santos <[email protected]>
4948

5049
Language: ru (Russian)
5150
Repository: https://github.com/DJm00n/git-po-ru/

0 commit comments

Comments
 (0)