From: Paul Mackerras Date: Sat, 19 Dec 2015 02:29:35 +0000 (+1100) Subject: Merge branch 'color-fix' of https://github.com/qykth-git/gitk X-Git-Tag: v2.7.0-rc2~9^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/04d04c071e44a7d5f5813a00febfc33527af338f?ds=inline;hp=-c Merge branch 'color-fix' of https://github.com/qykth-git/gitk --- 04d04c071e44a7d5f5813a00febfc33527af338f diff --combined gitk index b621762f1c,d4fdad3cc1..5f1255c860 --- a/gitk +++ b/gitk @@@ -1943,8 -1943,6 +1943,8 @@@ proc confirm_popup {msg {owner .}} } proc setoptions {} { + global use_ttk + if {[tk windowingsystem] ne "win32"} { option add *Panedwindow.showHandle 1 startupFile option add *Panedwindow.sashRelief raised startupFile @@@ -1967,18 -1965,6 +1967,18 @@@ option add *Listbox.font mainfont startupFile } +proc setttkstyle {} { + eval font configure TkDefaultFont [fontflags mainfont] + eval font configure TkTextFont [fontflags textfont] + eval font configure TkHeadingFont [fontflags mainfont] + eval font configure TkCaptionFont [fontflags mainfont] -weight bold + eval font configure TkTooltipFont [fontflags uifont] + eval font configure TkFixedFont [fontflags textfont] + eval font configure TkIconFont [fontflags uifont] + eval font configure TkMenuFont [fontflags uifont] + eval font configure TkSmallCaptionFont [fontflags uifont] +} + # Make a menu and submenus. # m is the window name for the menu, items is the list of menu items to add. # Each item is a list {mc label type description options...} @@@ -2265,7 -2251,7 +2265,7 @@@ proc makewindow {} set h [expr {[font metrics uifont -linespace] + 2}] set progresscanv .tf.bar.progress canvas $progresscanv -relief sunken -height $h -borderwidth 2 - set progressitem [$progresscanv create rect -1 0 0 $h -fill green] + set progressitem [$progresscanv create rect -1 0 0 $h -fill lime] set fprogitem [$progresscanv create rect -1 0 0 $h -fill yellow] set rprogitem [$progresscanv create rect -1 0 0 $h -fill red] } @@@ -2361,9 -2347,6 +2361,9 @@@ ${NS}::frame .bleft.mid ${NS}::frame .bleft.bottom + # gap between sub-widgets + set wgap [font measure uifont "i"] + ${NS}::button .bleft.top.search -text [mc "Search"] -command dosearch pack .bleft.top.search -side left -padx 5 set sstring .bleft.top.sstring @@@ -2378,9 -2361,8 +2378,9 @@@ -command changediffdisp -variable diffelide -value {0 1} ${NS}::radiobutton .bleft.mid.new -text [mc "New version"] \ -command changediffdisp -variable diffelide -value {1 0} + ${NS}::label .bleft.mid.labeldiffcontext -text " [mc "Lines of context"]: " - pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left + pack .bleft.mid.diff .bleft.mid.old .bleft.mid.new -side left -ipadx $wgap spinbox .bleft.mid.diffcontext -width 5 \ -from 0 -increment 1 -to 10000000 \ -validate all -validatecommand "diffcontextvalidate %P" \ @@@ -2388,7 -2370,7 +2388,7 @@@ .bleft.mid.diffcontext set $diffcontext trace add variable diffcontextstring write diffcontextchange lappend entries .bleft.mid.diffcontext - pack .bleft.mid.labeldiffcontext .bleft.mid.diffcontext -side left + pack .bleft.mid.labeldiffcontext .bleft.mid.diffcontext -side left -ipadx $wgap ${NS}::checkbutton .bleft.mid.ignspace -text [mc "Ignore space change"] \ -command changeignorespace -variable ignorespace pack .bleft.mid.ignspace -side left -padx 5 @@@ -3397,7 -3379,7 +3397,7 @@@ set rectmask 0x00, 0x00, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0xfc, 0x0f, 0x00, 0x00}; } - image create bitmap reficon-H -background black -foreground green \ + image create bitmap reficon-H -background black -foreground lime \ -data $rectdata -maskdata $rectmask image create bitmap reficon-o -background black -foreground "#ddddff" \ -data $rectdata -maskdata $rectmask @@@ -12188,7 -12170,7 +12188,7 @@@ if {[tk windowingsystem] eq "aqua"} set extdifftool "meld" } - set colors {green red blue magenta darkgrey brown orange} + set colors {lime red blue magenta darkgrey brown orange} if {[tk windowingsystem] eq "win32"} { set uicolor SystemButtonFace set uifgcolor SystemButtonText @@@ -12206,12 -12188,12 +12206,12 @@@ } set diffcolors {red "#00a000" blue} set diffcontext 3 - set mergecolors {red blue green purple brown "#009090" magenta "#808000" "#009000" "#ff0080" cyan "#b07070" "#70b0f0" "#70f0b0" "#f0b070" "#ff70b0"} + set mergecolors {red blue lime purple brown "#009090" magenta "#808000" "#009000" "#ff0080" cyan "#b07070" "#70b0f0" "#70f0b0" "#f0b070" "#ff70b0"} set ignorespace 0 set worddiff "" set markbgcolor "#e0e0ff" - set headbgcolor green + set headbgcolor lime set headfgcolor black set headoutlinecolor black set remotebgcolor #ffddaa @@@ -12226,7 -12208,7 +12226,7 @@@ set linehoverfgcolor blac set linehoveroutlinecolor black set mainheadcirclecolor yellow set workingfilescirclecolor red - set indexcirclecolor green + set indexcirclecolor lime set circlecolors {white blue gray blue blue} set linkfgcolor blue set circleoutlinecolor $fgcolor @@@ -12374,10 -12356,6 +12374,10 @@@ if {![info exists have_ttk]} set use_ttk [expr {$have_ttk && $want_ttk}] set NS [expr {$use_ttk ? "ttk" : ""}] +if {$use_ttk} { + setttkstyle +} + regexp {^git version ([\d.]*\d)} [exec git version] _ git_version set show_notes {}