Code

git-gui: Use a label instead of a button for the back button
authorShawn O. Pearce <spearce@spearce.org>
Sat, 2 Jun 2007 03:48:18 +0000 (23:48 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 6 Jun 2007 05:26:48 +0000 (01:26 -0400)
Apparently Tk on Mac OS X won't draw a button with an image using a
transparent background.  Instead it draws the button using some sort
of 3D effect, even though I asked for no relief and no border.  The
background is also not our orange that we expected it to be.

Earlier I had tried this same trick on Windows and it draws the same
way as the button did, so I'm going to switch to the label as that
seems to be more portable.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/blame.tcl

index bd8e631f34dffcfc5835e0788500adc900633a4c..2f7503ad6b099f0b0938aa44d5c94a2f63eddc40 100644 (file)
@@ -66,14 +66,18 @@ constructor new {i_commit i_path} {
                -anchor w \
                -justify left
        set w_back $w.header.commit_b
-       button $w_back \
-               -command [cb _history_menu] \
+       label $w_back \
                -image ::blame::img_back_arrow \
                -borderwidth 0 \
                -relief flat \
                -state disabled \
                -background orange \
                -activebackground orange
+       bind $w_back <Button-1> "
+               if {\[$w_back cget -state\] eq {normal}} {
+                       [cb _history_menu]
+               }
+               "
        label $w.header.commit \
                -textvariable @commit \
                -background orange \