From: Pat Thoyts Date: Wed, 20 May 2009 23:06:47 +0000 (+0100) Subject: Switch to using PNG images X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=407c7e09fff343d3dab45911704e1607e74bec73;p=Bullfrog Switch to using PNG images Signed-off-by: Pat Thoyts --- diff --git a/bin/bf_xmpp.tcl b/bin/bf_xmpp.tcl index d27dca8..e6e23e9 100644 --- a/bin/bf_xmpp.tcl +++ b/bin/bf_xmpp.tcl @@ -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" } } diff --git a/bin/bullfrog.tcl b/bin/bullfrog.tcl index 373fa27..2d6e5d4 100644 --- a/bin/bullfrog.tcl +++ b/bin/bullfrog.tcl @@ -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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 index 7b30547..0000000 Binary files a/bin/images/usr_unavail.gif and /dev/null differ diff --git a/bin/message.tcl b/bin/message.tcl index 405533c..1352c8c 100644 --- a/bin/message.tcl +++ b/bin/message.tcl @@ -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 " " diff --git a/bin/tab.tcl b/bin/tab.tcl index ec9a8d9..6368950 100644 --- a/bin/tab.tcl +++ b/bin/tab.tcl @@ -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 {+::ButtonNotebook::Press %W %x %y}