alias topicbar {
var %x = 1,%m $window(-3).dw $calc($window(-3).dh -25),%a $active
while ($window(*,%x)) {
window -r $qt($v1) 0 25 %m
inc %x
}
window -a $qt(%a)
window -pw0 +d @topicbar 0 0 $window(-3).dw 25
set %topicbar.tx 4
.timertopicbar -iom 0 500 topicbar.refresh
topicbar.refresh
}
alias -l topicbar.refresh {
var %a = $iif($active == @topicbar,$lactive,$active)
if (%a != %topicbar.lw) set -e %topicbar.tx 4
drawrect -fn @topicbar $color(background) 1 0 0 $window(@topicbar).dw $window(@topicbar).dh
drawtext -np @topicbar $color(topic) Tahoma -11 %topicbar.tx 1 $iif(%a ischan,$iif($chan(%a).topic,$v1,No topic.),$v1)
drawdot @topicbar
}
menu @topicbar {
mouse: {
if (%topicbar.mx) {
tokenize 32 %topicbar.mx $mouse.x
%topicbar.tx = $calc($2 -$1)
%topicbar.lw = $iif($active == @topicbar,$lactive,$active)
topicbar.refresh
}
}
sclick:set %topicbar.mx $mouse.x
uclick:unset %topicbar.mx | window -a $qt($lactive)
$submenu($topicbar.links($1))
-
Reset topic position:set %topicbar.tx 4 | topicbar.refresh
Reset window positions:topicbar
-
Close:window -c @topicbar | .timertopicbar off | unset %topicbar.*
}
alias topicbar.links {
if ($1 == begin) { set -eu1 %topicbar.x 1 | set -eu1 %topicbar.topic $replacex($strip($chan($iif($active == @topicbar,$lactive,$active)).topic),$chr(28),$chr(32),$chr(29),$chr(32),[,$chr(32),],$chr(32),<,$chr(32),>,$chr(32),$chr(123),$chr(32),$chr(124),$chr(32),$chr(125),$chr(32),$chr(44),$chr(32)) }
elseif ($wildtok(%topicbar.topic,*?.?*,%topicbar.x,32)) {
tokenize 1 $v1
inc %topicbar.x
if ($wildtok($1,http://?*.??*,1,32)) || ($wildtok($1,https://?*.??*,1,32)) || ($wildtok($1,www.?*.??*,1,32)) return $replacex($v1,:,;) :url -a $v1
}
elseif ($1 == end) unset %topicbar.x %topicbar.topic
}