From c80d7be5e1e0d110ea77cd41f658aabe5bcad0d8 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Tue, 26 Jan 2010 00:05:31 +0000 Subject: git-gui: use themed tk widgets with Tk 8.5 This patch enables the use of themed Tk widgets with Tk 8.5 and above. These make a significant difference on Windows in making the application appear native. On Windows and MacOSX ttk defaults to the native look as much as possible. On X11 the user may select a theme using the TkTheme XRDB resource class by adding an line to the .Xresources file. The set of installed theme names is available using the Tk command 'ttk::themes'. The default on X11 is similar to the current un-themed style - a kind of thin bordered motif look. A new git config variable 'gui.usettk' may be set to disable this if the user prefers the classic Tk look. Using Tk 8.4 will also avoid the use of themed widgets as these are only available since 8.5. Some support is included for Tk 8.6 features (themed spinbox and native font chooser for MacOSX and Windows). Signed-off-by: Pat Thoyts Signed-off-by: Shawn O. Pearce --- lib/search.tcl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/search.tcl') diff --git a/lib/search.tcl b/lib/search.tcl index b371e9a30a..7fdbf87bcd 100644 --- a/lib/search.tcl +++ b/lib/search.tcl @@ -14,15 +14,16 @@ field smarktop field smarkbot constructor new {i_w i_text args} { + global use_ttk NS set w $i_w set ctext $i_text - frame $w - label $w.l -text [mc Find:] + ${NS}::frame $w + ${NS}::label $w.l -text [mc Find:] entry $w.ent -textvariable ${__this}::searchstring -background lightgreen - button $w.bn -text [mc Next] -command [cb find_next] - button $w.bp -text [mc Prev] -command [cb find_prev] - checkbutton $w.cs -text [mc Case-Sensitive] \ + ${NS}::button $w.bn -text [mc Next] -command [cb find_next] + ${NS}::button $w.bp -text [mc Prev] -command [cb find_prev] + ${NS}::checkbutton $w.cs -text [mc Case-Sensitive] \ -variable ${__this}::casesensitive -command [cb _incrsearch] pack $w.l -side left pack $w.cs -side right -- cgit v1.2.3