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>
Shawn O. Pearce committed
Nov 13, 2006 at 00:48 UTC
fce89e466ae75961018ab88fec7000568f981d46
1 file changed
+12
-22
git-gui
+12
-22
@@ -2290,33 +2290,23 @@ label .vpane.lower.diff.header.l1 -text {File:} \
2290
-background orange \
2291
-font font_ui
2292
set ui_fname .vpane.lower.diff.header.l2
2293
-text $ui_fname \
2293
+label $ui_fname \
2294
+ -textvariable ui_fname_value \
2295
-background orange \
2295
- -height 1 \
2296
- -wrap none \
2297
- -relief flat \
2298
- -state disabled \
2296
+ -anchor w \
2297
+ -justify left \
2298
-font font_ui
2299
menu $ui_fname.ctxm -tearoff 0
2301
-$ui_fname.ctxm add command -label "Copy Only Selection" \
2300
+$ui_fname.ctxm add command -label "Copy" \
2301
-font font_ui \
2303
- -command "tk_textCopy $ui_fname"
2304
-$ui_fname.ctxm add command -label "Copy Complete Name" \
2305
- -font font_ui \
2306
- -command "
2307
- $ui_fname tag add sel 0.0 {end -1c}
2308
- tk_textCopy $ui_fname
2309
- $ui_fname tag remove sel 0.0 end
2310
- "
2302
+ -command {
2303
+ clipboard clear
2304
+ clipboard append \
2305
+ -format STRING \
2306
+ -type STRING \
2307
+ -- $ui_fname_value
2308
+ }
2309
bind_button3 $ui_fname "tk_popup $ui_fname.ctxm %X %Y"
2312
-trace add variable ui_fname_value write $ui_fname.update
2313
-proc $ui_fname.update {varname args} {
2314
- global ui_fname ui_fname_value
2315
- $ui_fname configure -state normal
2316
- $ui_fname delete 0.0 end
2317
- $ui_fname insert end [escape_path $ui_fname_value]
2318
- $ui_fname configure -state disabled
2319
-}
2310
pack .vpane.lower.diff.header.l4 -side left
2311
pack .vpane.lower.diff.header.l1 -side left
2312
pack $ui_fname -fill x