contrib/hgk
changeset 7738 db366ec8d0a4
parent 7039 aafe12bd7174
child 7745 8bfe47e726fe
equal deleted inserted replaced
7737:26bdb7109170 7738:db366ec8d0a4
   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
   442     global hgvdiff bgcolor
   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
   476     panedwindow .ctop.top.clist -orient horizontal -sashpad 0 -handlesize 4
   476     panedwindow .ctop.top.clist -orient horizontal -sashpad 0 -handlesize 4
   477     pack .ctop.top.clist -side top -fill both -expand 1
   477     pack .ctop.top.clist -side top -fill both -expand 1
   478     .ctop add .ctop.top
   478     .ctop add .ctop.top
   479     set canv .ctop.top.clist.canv
   479     set canv .ctop.top.clist.canv
   480     canvas $canv -height $geometry(canvh) -width $geometry(canv1) \
   480     canvas $canv -height $geometry(canvh) -width $geometry(canv1) \
   481 	-bg white -bd 0 \
   481 	-bg $bgcolor -bd 0 \
   482 	-yscrollincr $linespc -yscrollcommand "$cscroll set" -selectbackground grey
   482 	-yscrollincr $linespc -yscrollcommand "$cscroll set" -selectbackground grey
   483     .ctop.top.clist add $canv
   483     .ctop.top.clist add $canv
   484     set canv2 .ctop.top.clist.canv2
   484     set canv2 .ctop.top.clist.canv2
   485     canvas $canv2 -height $geometry(canvh) -width $geometry(canv2) \
   485     canvas $canv2 -height $geometry(canvh) -width $geometry(canv2) \
   486 	-bg white -bd 0 -yscrollincr $linespc -selectbackground grey
   486 	-bg $bgcolor -bd 0 -yscrollincr $linespc -selectbackground grey
   487     .ctop.top.clist add $canv2
   487     .ctop.top.clist add $canv2
   488     set canv3 .ctop.top.clist.canv3
   488     set canv3 .ctop.top.clist.canv3
   489     canvas $canv3 -height $geometry(canvh) -width $geometry(canv3) \
   489     canvas $canv3 -height $geometry(canvh) -width $geometry(canv3) \
   490 	-bg white -bd 0 -yscrollincr $linespc -selectbackground grey
   490 	-bg $bgcolor -bd 0 -yscrollincr $linespc -selectbackground grey
   491     .ctop.top.clist add $canv3
   491     .ctop.top.clist add $canv3
   492     bind .ctop.top.clist <Configure> {resizeclistpanes %W %w}
   492     bind .ctop.top.clist <Configure> {resizeclistpanes %W %w}
   493 
   493 
   494     set sha1entry .ctop.top.bar.sha1
   494     set sha1entry .ctop.top.bar.sha1
   495     set entries $sha1entry
   495     set entries $sha1entry
   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 white -state disabled -font $textfont \
   550     text $ctext -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 white -selectmode extended -width $geometry(cflistw) \
   584     listbox $cflist -bg $bgcolor -selectmode extended -width $geometry(cflistw) \
   585 	-yscrollcommand ".ctop.cdet.right.sb set"
   585 	-yscrollcommand ".ctop.cdet.right.sb set"
   586     scrollbar .ctop.cdet.right.sb -command "$cflist yview"
   586     scrollbar .ctop.cdet.right.sb -command "$cflist yview"
   587     pack .ctop.cdet.right.sb -side right -fill y
   587     pack .ctop.cdet.right.sb -side right -fill y
   588     pack $cflist -side left -fill both -expand 1
   588     pack $cflist -side left -fill both -expand 1
   589     .ctop.cdet add .ctop.cdet.right
   589     .ctop.cdet add .ctop.cdet.right
   677 }
   677 }
   678 
   678 
   679 proc savestuff {w} {
   679 proc savestuff {w} {
   680     global canv canv2 canv3 ctext cflist mainfont textfont
   680     global canv canv2 canv3 ctext cflist mainfont textfont
   681     global stuffsaved findmergefiles gaudydiff maxgraphpct
   681     global stuffsaved findmergefiles gaudydiff maxgraphpct
   682     global maxwidth authorcolors curidfont
   682     global maxwidth authorcolors curidfont bgcolor
   683 
   683 
   684     if {$stuffsaved} return
   684     if {$stuffsaved} return
   685     if {![winfo viewable .]} return
   685     if {![winfo viewable .]} return
   686     catch {
   686     catch {
   687 	set f [open "~/.hgk-new" w]
   687 	set f [open "~/.hgk-new" w]
   719 	puts $f "# will be assigned to this commit and also all other commits"
   719 	puts $f "# will be assigned to this commit and also all other commits"
   720 	puts $f "# of the same author.  When the list of colors is exhausted,"
   720 	puts $f "# of the same author.  When the list of colors is exhausted,"
   721 	puts $f "# the last entry will be reused."
   721 	puts $f "# the last entry will be reused."
   722 	puts $f "#"
   722 	puts $f "#"
   723 	puts $f "set authorcolors {$authorcolors}"
   723 	puts $f "set authorcolors {$authorcolors}"
       
   724 	puts $f "set bgcolor $bgcolor"
   724 	close $f
   725 	close $f
   725 	file rename -force "~/.hgk-new" "~/.hgk"
   726 	file rename -force "~/.hgk-new" "~/.hgk"
   726     }
   727     }
   727     set stuffsaved 1
   728     set stuffsaved 1
   728 }
   729 }
  3889 
  3890 
  3890 set colors {green red blue magenta darkgrey brown orange}
  3891 set colors {green red blue magenta darkgrey brown orange}
  3891 set authorcolors {
  3892 set authorcolors {
  3892     black blue deeppink mediumorchid blue burlywood4 goldenrod slateblue red2 navy dimgrey
  3893     black blue deeppink mediumorchid blue burlywood4 goldenrod slateblue red2 navy dimgrey
  3893 }
  3894 }
       
  3895 set bgcolor white
  3894 
  3896 
  3895 catch {source ~/.hgk}
  3897 catch {source ~/.hgk}
  3896 
  3898 
  3897 if {$curidfont == ""} {  # initialize late based on current mainfont
  3899 if {$curidfont == ""} {  # initialize late based on current mainfont
  3898     set curidfont "$mainfont bold italic underline"
  3900     set curidfont "$mainfont bold italic underline"