Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
0fba86b3
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0fba86b3
编写于
5月 16, 2005
作者:
P
Paul Mackerras
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
save window geometry on exit, and restore it on startup
上级
43bddeb4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
63 addition
and
10 deletion
+63
-10
gitk
gitk
+63
-10
未找到文件。
gitk
浏览文件 @
0fba86b3
...
...
@@ -7,7 +7,7 @@ exec wish "$0" -- "${1+$@}"
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or
(
at your option
)
any later version.
# CVS $Revision: 1.1
2
$
# CVS $Revision: 1.1
3
$
proc getcommits
{
rargs
}
{
global commits commfd phase canv mainfont
...
...
@@ -120,7 +120,7 @@ proc readcommit {id} {
proc makewindow
{}
{
global canv canv2 canv3 linespc charspc ctext cflist textfont
global sha1entry findtype findloc findstring
global sha1entry findtype findloc findstring
geometry
menu .bar
.bar add cascade -label
"File"
-menu .bar.file
...
...
@@ -131,7 +131,19 @@ proc makewindow {} {
.bar.help add command -label
"About gitk"
-command about
. configure -menu .bar
if
{
!
[
info exists geometry
(
canv1
)]}
{
set geometry
(
canv1
)
[
expr 45 * $charspc
]
set geometry
(
canv2
)
[
expr 30 * $charspc
]
set geometry
(
canv3
)
[
expr 15 * $charspc
]
set geometry
(
canvh
)
[
expr 25 * $linespc + 4
]
set geometry
(
ctextw
)
80
set geometry
(
ctexth
)
30
set geometry
(
cflistw
)
30
}
panedwindow .ctop -orient vertical
if
{[
info exists geometry
(
width
)]}
{
.ctop conf -width $geometry
(
width
)
-height $geometry
(
height
)
}
frame .ctop.top
frame .ctop.top.bar
pack .ctop.top.bar -side bottom -fill x
...
...
@@ -142,17 +154,16 @@ proc makewindow {} {
pack .ctop.top.clist -side top -fill both -expand 1
.ctop add .ctop.top
set canv .ctop.top.clist.canv
set height
[
expr 25 * $linespc + 4
]
canvas $canv -height $height -width
[
expr 45 * $charspc
]
\
canvas $canv -height $geometry
(
canvh
)
-width $geometry
(
canv1
)
\
-bg white -bd 0
\
-yscrollincr $linespc -yscrollcommand
"
$cscroll
set"
.ctop.top.clist add $canv
set canv2 .ctop.top.clist.canv2
canvas $canv2 -height $
height -width
[
expr 30 * $charspc
]
\
canvas $canv2 -height $
geometry
(
canvh
)
-width $geometry
(
canv2
)
\
-bg white -bd 0 -yscrollincr $linespc
.ctop.top.clist add $canv2
set canv3 .ctop.top.clist.canv3
canvas $canv3 -height $
height -width
[
expr 15 * $charspc
]
\
canvas $canv3 -height $
geometry
(
canvh
)
-width $geometry
(
canv3
)
\
-bg white -bd 0 -yscrollincr $linespc
.ctop.top.clist add $canv3
bind .ctop.top.clist <Configure>
{
resizeclistpanes %W %w
}
...
...
@@ -177,16 +188,22 @@ proc makewindow {} {
pack .ctop.top.bar.findtype -side right
panedwindow .ctop.cdet -orient horizontal
if
{[
info exists geometry
(
cdeth
)]}
{
.ctop.cdet conf -height $geometry
(
cdeth
)
}
.ctop add .ctop.cdet
frame .ctop.cdet.left
set ctext .ctop.cdet.left.ctext
text $ctext -bg white -state disabled -font $textfont -height 32
\
text $ctext -bg white -state disabled -font $textfont
\
-width $geometry
(
ctextw
)
-height $geometry
(
ctexth
)
\
-yscrollcommand
".ctop.cdet.left.sb set"
scrollbar .ctop.cdet.left.sb -command
"
$ctext
yview"
pack .ctop.cdet.left.sb -side right -fill y
pack $ctext -side left -fill both -expand 1
.ctop.cdet add .ctop.cdet.left
bind .ctop.cdet <Configure>
{
resizecdetpanes %W %w
}
if
{[
info exists geometry
(
detlw
)]}
{
.ctop.cdet.left conf -width $geometry
(
detlw
)
}
$ctext tag conf filesep -font
[
concat $textfont bold
]
$ctext tag conf hunksep -back blue -fore white
...
...
@@ -195,12 +212,16 @@ proc makewindow {} {
frame .ctop.cdet.right
set cflist .ctop.cdet.right.cfiles
listbox $cflist -width
30
-bg white -selectmode extended
\
listbox $cflist -width
$geometry
(
cflistw
)
-bg white -selectmode extended
\
-yscrollcommand
".ctop.cdet.right.sb set"
scrollbar .ctop.cdet.right.sb -command
"
$cflist
yview"
pack .ctop.cdet.right.sb -side right -fill y
pack $cflist -side left -fill both -expand 1
.ctop.cdet add .ctop.cdet.right
if
{[
info exists geometry
(
detsash
)]}
{
eval .ctop.cdet sash place 0 $geometry
(
detsash
)
}
bind .ctop.cdet <Configure>
{
resizecdetpanes %W %w
}
pack .ctop -side top -fill both -expand 1
...
...
@@ -232,6 +253,37 @@ proc makewindow {} {
bind . <Control-minus>
{
incrfont -1
}
bind . <Control-KP_Subtract>
{
incrfont -1
}
bind $cflist <<ListboxSelect>> listboxsel
bind . <Destroy>
{
savestuff %W
}
}
proc savestuff
{
w
}
{
global canv canv2 canv3 ctext cflist mainfont textfont
global stuffsaved
if
{
$stuffsaved
}
return
catch
{
set f
[
open
"~/.gitk-new"
w
]
puts $f
"set mainfont {
$mainfont
}"
puts $f
"set textfont {
$textfont
}"
puts $f
"set geometry(width)
[
winfo width .ctop
]
"
puts $f
"set geometry(height)
[
winfo height .ctop
]
"
puts $f
"set geometry(canv1)
[
winfo width $canv
]
"
puts $f
"set geometry(canv2)
[
winfo width $canv2
]
"
puts $f
"set geometry(canv3)
[
winfo width $canv3
]
"
puts $f
"set geometry(canvh)
[
winfo height $canv
]
"
puts $f
"set geometry(cdeth)
[
winfo height .ctop.cdet
]
"
set wid
[
expr
{([
winfo width $ctext
]
- 8
)
\
/
[
font measure $textfont
"0"
]}]
set ht
[
expr
{([
winfo height $ctext
]
- 8
)
\
/
[
font metrics $textfont -linespace
]}]
puts $f
"set geometry(ctextw)
$wid
"
puts $f
"set geometry(ctexth)
$ht
"
set wid
[
expr
{([
winfo width $cflist
]
- 11
)
\
/
[
font measure
[
$cflist
cget -font
]
"0"
]}]
puts $f
"set geometry(cflistw)
$wid
"
close $f
file rename -force
"~/.gitk-new"
"~/.gitk"
}
set stuffsaved 1
}
proc resizeclistpanes
{
win w
}
{
...
...
@@ -315,7 +367,7 @@ Copyright
Use and redistribute under the terms of the GNU General Public License
(
CVS $Revision: 1.1
2
$
)}
\
(
CVS $Revision: 1.1
3
$
)}
\
-justify center -aspect 400
pack $w.m -side top -fill x -padx 20 -pady 20
button $w.ok -text Close -command
"destroy
$w
"
...
...
@@ -1042,6 +1094,7 @@ foreach arg $argv {
set stopped 0
set redisplaying 0
set stuffsaved 0
setcoords
makewindow
getcommits $revtreeargs
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录