git-gui: Reverted file name text field to a label.

So although a text field with a flat relief looks like a label on
Windows it doesn't on Mac OS X.  The Aqua version of Tk is still
drawing a border around the text field and that makes the diff pane
header look pretty ugly.

Earlier I had made the file name area into a text widget so the user
could highlight parts of it and copy them onto the clipboard; but with
the context menu being present this isn't quite as necessary as the user
can copy the file name to the clipboard using that instead.  So although
this is a small loss in functionality for non-Mac OS X systems I think it
is still reasonable.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Shawn O. Pearce 2006-11-13 00:48:44 -05:00
parent 1e5c18fb43
commit fce89e466a

34
git-gui
View File

@ -2290,33 +2290,23 @@ label .vpane.lower.diff.header.l1 -text {File:} \
-background orange \ -background orange \
-font font_ui -font font_ui
set ui_fname .vpane.lower.diff.header.l2 set ui_fname .vpane.lower.diff.header.l2
text $ui_fname \ label $ui_fname \
-textvariable ui_fname_value \
-background orange \ -background orange \
-height 1 \ -anchor w \
-wrap none \ -justify left \
-relief flat \
-state disabled \
-font font_ui -font font_ui
menu $ui_fname.ctxm -tearoff 0 menu $ui_fname.ctxm -tearoff 0
$ui_fname.ctxm add command -label "Copy Only Selection" \ $ui_fname.ctxm add command -label "Copy" \
-font font_ui \ -font font_ui \
-command "tk_textCopy $ui_fname" -command {
$ui_fname.ctxm add command -label "Copy Complete Name" \ clipboard clear
-font font_ui \ clipboard append \
-command " -format STRING \
$ui_fname tag add sel 0.0 {end -1c} -type STRING \
tk_textCopy $ui_fname -- $ui_fname_value
$ui_fname tag remove sel 0.0 end }
"
bind_button3 $ui_fname "tk_popup $ui_fname.ctxm %X %Y" bind_button3 $ui_fname "tk_popup $ui_fname.ctxm %X %Y"
trace add variable ui_fname_value write $ui_fname.update
proc $ui_fname.update {varname args} {
global ui_fname ui_fname_value
$ui_fname configure -state normal
$ui_fname delete 0.0 end
$ui_fname insert end [escape_path $ui_fname_value]
$ui_fname configure -state disabled
}
pack .vpane.lower.diff.header.l4 -side left pack .vpane.lower.diff.header.l4 -side left
pack .vpane.lower.diff.header.l1 -side left pack .vpane.lower.diff.header.l1 -side left
pack $ui_fname -fill x pack $ui_fname -fill x