Switch to using PNG images
authorPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 20 May 2009 23:06:47 +0000 (00:06 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Wed, 20 May 2009 23:06:47 +0000 (00:06 +0100)
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
21 files changed:
bin/bf_xmpp.tcl
bin/bullfrog.tcl
bin/images/chat.gif [deleted file]
bin/images/chat.png [new file with mode: 0644]
bin/images/guy-alert.png [new file with mode: 0644]
bin/images/guy-away.png [new file with mode: 0644]
bin/images/guy-chat.png [new file with mode: 0644]
bin/images/guy-dnd.png [new file with mode: 0644]
bin/images/guy-grey.png [new file with mode: 0644]
bin/images/guy-normal.png [new file with mode: 0644]
bin/images/guy-sleep.png [new file with mode: 0644]
bin/images/mail-new.png [new file with mode: 0644]
bin/images/mail-read.png [new file with mode: 0644]
bin/images/network-offline.png [new file with mode: 0644]
bin/images/network-transmit-receive.png [new file with mode: 0644]
bin/images/usr_avail.gif [deleted file]
bin/images/usr_away.gif [deleted file]
bin/images/usr_dnd.gif [deleted file]
bin/images/usr_unavail.gif [deleted file]
bin/message.tcl
bin/tab.tcl

index d27dca837bc1f9275a9656835338485a0f8b4fb2..e6e23e983ab38268184efe9328c11acb8c6ac7e2 100644 (file)
@@ -1153,16 +1153,19 @@ proc XmppAddTab {Session window jid} {
     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"
     }
 }
 
index 373fa2788206467b33bef923438a73454054b13e..2d6e5d411ea71bc00c58fab33b8e644401d897a6 100644 (file)
@@ -17,6 +17,9 @@ package require chatwidget 1.1;  # tklib
 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
@@ -35,12 +38,14 @@ source [file join $root bf_xmpp.tcl]
 # 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} {
@@ -182,7 +187,11 @@ proc Status {Chat message} {
 
 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}} {
diff --git a/bin/images/chat.gif b/bin/images/chat.gif
deleted file mode 100644 (file)
index 0b5d67f..0000000
Binary files a/bin/images/chat.gif and /dev/null differ
diff --git a/bin/images/chat.png b/bin/images/chat.png
new file mode 100644 (file)
index 0000000..f6e8325
Binary files /dev/null and b/bin/images/chat.png differ
diff --git a/bin/images/guy-alert.png b/bin/images/guy-alert.png
new file mode 100644 (file)
index 0000000..d32b809
Binary files /dev/null and b/bin/images/guy-alert.png differ
diff --git a/bin/images/guy-away.png b/bin/images/guy-away.png
new file mode 100644 (file)
index 0000000..5331ef8
Binary files /dev/null and b/bin/images/guy-away.png differ
diff --git a/bin/images/guy-chat.png b/bin/images/guy-chat.png
new file mode 100644 (file)
index 0000000..2ad888e
Binary files /dev/null and b/bin/images/guy-chat.png differ
diff --git a/bin/images/guy-dnd.png b/bin/images/guy-dnd.png
new file mode 100644 (file)
index 0000000..21cfbd9
Binary files /dev/null and b/bin/images/guy-dnd.png differ
diff --git a/bin/images/guy-grey.png b/bin/images/guy-grey.png
new file mode 100644 (file)
index 0000000..c8b8334
Binary files /dev/null and b/bin/images/guy-grey.png differ
diff --git a/bin/images/guy-normal.png b/bin/images/guy-normal.png
new file mode 100644 (file)
index 0000000..8d864e6
Binary files /dev/null and b/bin/images/guy-normal.png differ
diff --git a/bin/images/guy-sleep.png b/bin/images/guy-sleep.png
new file mode 100644 (file)
index 0000000..7362f4f
Binary files /dev/null and b/bin/images/guy-sleep.png differ
diff --git a/bin/images/mail-new.png b/bin/images/mail-new.png
new file mode 100644 (file)
index 0000000..7c68cb8
Binary files /dev/null and b/bin/images/mail-new.png differ
diff --git a/bin/images/mail-read.png b/bin/images/mail-read.png
new file mode 100644 (file)
index 0000000..859251f
Binary files /dev/null and b/bin/images/mail-read.png differ
diff --git a/bin/images/network-offline.png b/bin/images/network-offline.png
new file mode 100644 (file)
index 0000000..1f210fc
Binary files /dev/null and b/bin/images/network-offline.png differ
diff --git a/bin/images/network-transmit-receive.png b/bin/images/network-transmit-receive.png
new file mode 100644 (file)
index 0000000..271d37d
Binary files /dev/null and b/bin/images/network-transmit-receive.png differ
diff --git a/bin/images/usr_avail.gif b/bin/images/usr_avail.gif
deleted file mode 100644 (file)
index acc10f6..0000000
Binary files a/bin/images/usr_avail.gif and /dev/null differ
diff --git a/bin/images/usr_away.gif b/bin/images/usr_away.gif
deleted file mode 100644 (file)
index f401511..0000000
Binary files a/bin/images/usr_away.gif and /dev/null differ
diff --git a/bin/images/usr_dnd.gif b/bin/images/usr_dnd.gif
deleted file mode 100644 (file)
index d1241ef..0000000
Binary files a/bin/images/usr_dnd.gif and /dev/null differ
diff --git a/bin/images/usr_unavail.gif b/bin/images/usr_unavail.gif
deleted file mode 100644 (file)
index 7b30547..0000000
Binary files a/bin/images/usr_unavail.gif and /dev/null differ
index 405533c0b86ae879491ffcd98e7026c1c74d0ca0..1352c8c120050c8bc7506e8fe1e475fac17a6946 100644 (file)
@@ -21,7 +21,9 @@
 # -------------------------------------------------------------------------
 
 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
 
@@ -51,8 +53,9 @@ namespace eval messagewidget {
     }
     
     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
 }
 
@@ -180,13 +183,16 @@ proc messagewidget::Add {self args} {
     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 " "
index ec9a8d963f2ff23c1f4e4081b445924fad6b583c..636895056f5579a50dbf7573679a9f25bb1be1f6 100644 (file)
@@ -85,10 +85,9 @@ proc ::ButtonNotebook::Init {{pertab 0}} {
                 }
             }
         }
-        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}