if {[$xmpp(jlib) muc isroom $node@$domain]} {
set title $resource
set image ::img::msgchat
+ Debug $Session "AddTab for $jid title:$title image:$image"
$session(app).nb add $window -text $title -image $image -compound left
} elseif {$node ne {}} {
set title $node
set rs [dict create {*}[$xmpp(jlib) roster getpresence\
$node@$domain -resource $resource]]
set image [XmppGetPresenceImage $Session $jid]
+ Debug $Session "AddTab for $jid title:$title image:$image"
$session(app).nb add $window -text $title -image $image -compound left
} else {
set title $domain
$session(app).nb add $window -text $title -compound none
+ Debug $Session "AddTab for $jid title:$title image:none"
}
}
package require tooltip 1.4; # tklib
package require msgcat; # tcl core
namespace import ::msgcat::mc
+if {![package vsatisfies [package provide Tk] 8.6]} {
+ package require img::png
+}
if {![catch {package require autoproxy}]} {
autoproxy::init
# Load images
namespace eval ::img {
set imgdir [file join $root images]
- image create photo ::img::presence::available -file $imgdir/usr_avail.gif
- image create photo ::img::presence::chat -file $imgdir/usr_avail.gif
- image create photo ::img::presence::away -file $imgdir/usr_away.gif
- image create photo ::img::presence::xa -file $imgdir/usr_away.gif
- image create photo ::img::presence::dnd -file $imgdir/usr_dnd.gif
- image create photo ::img::presence::unavailable -file $imgdir/usr_unavail.gif
+ image create photo ::img::presence::available -file $imgdir/guy-normal.png
+ image create photo ::img::presence::chat -file $imgdir/guy-chat.png
+ image create photo ::img::presence::away -file $imgdir/guy-away.png
+ image create photo ::img::presence::xa -file $imgdir/guy-sleep.png
+ image create photo ::img::presence::dnd -file $imgdir/guy-dnd.png
+ image create photo ::img::presence::unavailable -file $imgdir/guy-grey.png
+ image create photo ::img::network::connected -file $imgdir/network-transmit-receive.png
+ image create photo ::img::network::disconnected -file $imgdir/network-offline.png
}
proc Main {args} {
proc State {Chat message} {
upvar #0 $Chat chat
- $chat(app).status.pane1 configure -text $message
+ set w $chat(app).status.pane1
+ $w configure -text $message -compound text
+ if {[info command ::img::network::$message] ne ""} {
+ $w configure -image ::img::network::$message -compound image
+ }
}
proc Debug {Chat message {type debug}} {
# -------------------------------------------------------------------------
package require Tk 8.5
-
+if {![package vsatisfies [package provide Tk] 8.6]} {
+ package require img::png
+}
namespace eval messagewidget {
variable version 1.0.0
}
set imgdir [file join [file dirname [info script]] images]
- image create photo ::img::msgnorm -file [file join $imgdir mail.gif]
- image create photo ::img::msgchat -file [file join $imgdir chat.gif]
+ image create photo ::img::msgnorm -file [file join $imgdir mail-read.png]
+ image create photo ::img::msgnew -file [file join $imgdir mail-new.png]
+ image create photo ::img::msgchat -file [file join $imgdir chat.png]
#ImageSetTransparency ::img::msgchat
}
lappend values [DisplayTime [dict get $msg -date]]
lappend values [dict get $msg -from]
lappend values [dict get $msg -subject]
- set img ::img::msgnorm
+ set img ::img::msgnew
set item [$state(summary) insert {} end -image $img -tags item -values $values]
}
proc messagewidget::OnSummaryClick {self w x y} {
upvar #0 [namespace current]::$self state
set item [$w identify row $x $y]
+ if {[$state(summary) item $item -image] eq "::img::msgnew"} {
+ $state(summary) item $item -image ::img::msgnorm
+ }
set M [lindex $state(messages) [$w index $item]]
# ? dict set $M -state R
$state(summary) item $item -text " "
}
}
}
- if {$::ttk::currentTheme eq "xpnative"} {
- ttk::style configure ButtonNotebook.Tab -width -8
- ttk::style configure ButtonNotebook.Tab -padding {8 0 0 0}
- }
+ #if {$::tcl_platform(platform) eq "windows"} {} ??
+ ttk::style configure ButtonNotebook.Tab -width -8
+ ttk::style configure ButtonNotebook.Tab -padding {8 0 0 0}
}
bind TNotebook <ButtonPress-1> {+::ButtonNotebook::Press %W %x %y}