comparison contrib/hgk @ 7745:8bfe47e726fe

hgk: added setting of foreground colour Added the fgcolor setting read by hgk to change the text colour in the diff output and the file list. The colours for diff highlighting remains unchanged.
author Robert Bauck Hamar <r.b.hamar@usit.uio.no>
date Mon, 09 Feb 2009 19:00:48 +0100
parents db366ec8d0a4
children 59815cef38f0
comparison
equal deleted inserted replaced
7744:b44dbb95f07f 7745:8bfe47e726fe
437 global canv canv2 canv3 linespc charspc ctext cflist textfont 437 global canv canv2 canv3 linespc charspc ctext cflist textfont
438 global findtype findtypemenu findloc findstring fstring geometry 438 global findtype findtypemenu findloc findstring fstring geometry
439 global entries sha1entry sha1string sha1but 439 global entries sha1entry sha1string sha1but
440 global maincursor textcursor curtextcursor 440 global maincursor textcursor curtextcursor
441 global rowctxmenu gaudydiff mergemax 441 global rowctxmenu gaudydiff mergemax
442 global hgvdiff bgcolor 442 global hgvdiff bgcolor fgcolor
443 443
444 menu .bar 444 menu .bar
445 .bar add cascade -label "File" -menu .bar.file 445 .bar add cascade -label "File" -menu .bar.file
446 menu .bar.file 446 menu .bar.file
447 .bar.file add command -label "Reread references" -command rereadrefs 447 .bar.file add command -label "Reread references" -command rereadrefs
545 545
546 panedwindow .ctop.cdet -orient horizontal 546 panedwindow .ctop.cdet -orient horizontal
547 .ctop add .ctop.cdet 547 .ctop add .ctop.cdet
548 frame .ctop.cdet.left 548 frame .ctop.cdet.left
549 set ctext .ctop.cdet.left.ctext 549 set ctext .ctop.cdet.left.ctext
550 text $ctext -bg $bgcolor -state disabled -font $textfont \ 550 text $ctext -fg $fgcolor -bg $bgcolor -state disabled -font $textfont \
551 -width $geometry(ctextw) -height $geometry(ctexth) \ 551 -width $geometry(ctextw) -height $geometry(ctexth) \
552 -yscrollcommand ".ctop.cdet.left.sb set" \ 552 -yscrollcommand ".ctop.cdet.left.sb set" \
553 -xscrollcommand ".ctop.cdet.left.hb set" -wrap none 553 -xscrollcommand ".ctop.cdet.left.hb set" -wrap none
554 scrollbar .ctop.cdet.left.sb -command "$ctext yview" 554 scrollbar .ctop.cdet.left.sb -command "$ctext yview"
555 scrollbar .ctop.cdet.left.hb -orient horizontal -command "$ctext xview" 555 scrollbar .ctop.cdet.left.hb -orient horizontal -command "$ctext xview"
579 $ctext tag conf found -back yellow 579 $ctext tag conf found -back yellow
580 } 580 }
581 581
582 frame .ctop.cdet.right 582 frame .ctop.cdet.right
583 set cflist .ctop.cdet.right.cfiles 583 set cflist .ctop.cdet.right.cfiles
584 listbox $cflist -bg $bgcolor -selectmode extended -width $geometry(cflistw) \ 584 listbox $cflist -fg $fgcolor -bg $bgcolor \
585 -selectmode extended -width $geometry(cflistw) \
585 -yscrollcommand ".ctop.cdet.right.sb set" 586 -yscrollcommand ".ctop.cdet.right.sb set"
586 scrollbar .ctop.cdet.right.sb -command "$cflist yview" 587 scrollbar .ctop.cdet.right.sb -command "$cflist yview"
587 pack .ctop.cdet.right.sb -side right -fill y 588 pack .ctop.cdet.right.sb -side right -fill y
588 pack $cflist -side left -fill both -expand 1 589 pack $cflist -side left -fill both -expand 1
589 .ctop.cdet add .ctop.cdet.right 590 .ctop.cdet add .ctop.cdet.right
677 } 678 }
678 679
679 proc savestuff {w} { 680 proc savestuff {w} {
680 global canv canv2 canv3 ctext cflist mainfont textfont 681 global canv canv2 canv3 ctext cflist mainfont textfont
681 global stuffsaved findmergefiles gaudydiff maxgraphpct 682 global stuffsaved findmergefiles gaudydiff maxgraphpct
682 global maxwidth authorcolors curidfont bgcolor 683 global maxwidth authorcolors curidfont bgcolor fgcolor
683 684
684 if {$stuffsaved} return 685 if {$stuffsaved} return
685 if {![winfo viewable .]} return 686 if {![winfo viewable .]} return
686 catch { 687 catch {
687 set f [open "~/.hgk-new" w] 688 set f [open "~/.hgk-new" w]
720 puts $f "# of the same author. When the list of colors is exhausted," 721 puts $f "# of the same author. When the list of colors is exhausted,"
721 puts $f "# the last entry will be reused." 722 puts $f "# the last entry will be reused."
722 puts $f "#" 723 puts $f "#"
723 puts $f "set authorcolors {$authorcolors}" 724 puts $f "set authorcolors {$authorcolors}"
724 puts $f "set bgcolor $bgcolor" 725 puts $f "set bgcolor $bgcolor"
726 puts $f "#"
727 puts $f "# The text color used in the diff and file list view"
728 puts $f "set fgcolor $fgcolor"
725 close $f 729 close $f
726 file rename -force "~/.hgk-new" "~/.hgk" 730 file rename -force "~/.hgk-new" "~/.hgk"
727 } 731 }
728 set stuffsaved 1 732 set stuffsaved 1
729 } 733 }
3892 set authorcolors { 3896 set authorcolors {
3893 black blue deeppink mediumorchid blue burlywood4 goldenrod slateblue red2 navy dimgrey 3897 black blue deeppink mediumorchid blue burlywood4 goldenrod slateblue red2 navy dimgrey
3894 } 3898 }
3895 set bgcolor white 3899 set bgcolor white
3896 3900
3901 # This color should probably be some system color (provided by tk),
3902 # but as the bgcolor has always been set to white, I choose to ignore
3903 set fgcolor black
3904
3897 catch {source ~/.hgk} 3905 catch {source ~/.hgk}
3898 3906
3899 if {$curidfont == ""} { # initialize late based on current mainfont 3907 if {$curidfont == ""} { # initialize late based on current mainfont
3900 set curidfont "$mainfont bold italic underline" 3908 set curidfont "$mainfont bold italic underline"
3901 } 3909 }