Skip to content

Commit 61c0cfe

Browse files
committed
gitk: use text labels for commit ID buttons
gitk maintains a stack of commit ids visited, and allows navigating these using a pair of buttons shown with arrows using bitmaps. An attempt is made to recolor these bitmaps to handle different color schemes, but this is unreliable across multiple themes as the required colors are not universally known. Let's just use text labels for these buttons, allowing the themes to recolor the text along with everything else. Use utf code points for the text, presuming that these arrow glyphs are available in the selected font. Signed-off-by: Mark Levedahl <[email protected]>
1 parent 7754656 commit 61c0cfe

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

gitk

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2507,32 +2507,11 @@ proc makewindow {} {
25072507
trace add variable sha1string write sha1change
25082508
pack $sha1entry -side left -pady 2
25092509
2510-
set bm_left_data {
2511-
#define left_width 16
2512-
#define left_height 16
2513-
static unsigned char left_bits[] = {
2514-
0x00, 0x00, 0xc0, 0x01, 0xe0, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1c, 0x00,
2515-
0x0e, 0x00, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x0e, 0x00, 0x1c, 0x00,
2516-
0x38, 0x00, 0x70, 0x00, 0xe0, 0x00, 0xc0, 0x01};
2517-
}
2518-
set bm_right_data {
2519-
#define right_width 16
2520-
#define right_height 16
2521-
static unsigned char right_bits[] = {
2522-
0x00, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00, 0x07, 0x00, 0x0e, 0x00, 0x1c,
2523-
0x00, 0x38, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0x00, 0x38, 0x00, 0x1c,
2524-
0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc0, 0x01};
2525-
}
2526-
image create bitmap bm-left -data $bm_left_data -foreground $uifgcolor
2527-
image create bitmap bm-left-gray -data $bm_left_data -foreground $uifgdisabledcolor
2528-
image create bitmap bm-right -data $bm_right_data -foreground $uifgcolor
2529-
image create bitmap bm-right-gray -data $bm_right_data -foreground $uifgdisabledcolor
2530-
2531-
ttk::button .tf.bar.leftbut -command goback -state disabled -width 26
2532-
.tf.bar.leftbut configure -image [list bm-left disabled bm-left-gray]
2510+
ttk::button .tf.bar.leftbut -command goback -state disabled
2511+
.tf.bar.leftbut configure -text \u2190 -width 3
25332512
pack .tf.bar.leftbut -side left -fill y
2534-
ttk::button .tf.bar.rightbut -command goforw -state disabled -width 26
2535-
.tf.bar.rightbut configure -image [list bm-right disabled bm-right-gray]
2513+
ttk::button .tf.bar.rightbut -command goforw -state disabled
2514+
.tf.bar.rightbut configure -text \u2192 -width 3
25362515
pack .tf.bar.rightbut -side left -fill y
25372516
25382517
ttk::label .tf.bar.rowlabel -text [mc "Row"]

0 commit comments

Comments
 (0)