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 <patthoyts@users.sourceforge.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Pat Thoyts
2010-01-26 00:05:31 +00:00
committed by Shawn O. Pearce
parent ab2d3b0d7d
commit c80d7be5e1
26 changed files with 697 additions and 453 deletions

View File

@ -139,14 +139,14 @@ method _finish {cons ok} {
constructor dialog {} {
global current_branch
global M1B
global M1B use_ttk NS
if {![_can_merge $this]} {
delete_this
return
}
make_toplevel top w
make_dialog top w
wm title $top [append "[appname] ([reponame]): " [mc "Merge"]]
if {$top ne {.}} {
wm geometry $top "+[winfo rootx .]+[winfo rooty .]"
@ -154,21 +154,21 @@ constructor dialog {} {
set _start [cb _start]
label $w.header \
${NS}::label $w.header \
-text [mc "Merge Into %s" $current_branch] \
-font font_uibold
pack $w.header -side top -fill x
frame $w.buttons
button $w.buttons.visualize \
${NS}::frame $w.buttons
${NS}::button $w.buttons.visualize \
-text [mc Visualize] \
-command [cb _visualize]
pack $w.buttons.visualize -side left
button $w.buttons.merge \
${NS}::button $w.buttons.merge \
-text [mc Merge] \
-command $_start
pack $w.buttons.merge -side right
button $w.buttons.cancel \
${NS}::button $w.buttons.cancel \
-text [mc "Cancel"] \
-command [cb _cancel]
pack $w.buttons.cancel -side right -padx 5