[Tkabber-dev] r1379 - in trunk/tkabber: . examples/xrdb ifacetk mclistbox plugins/chat plugins/richtext

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sun Mar 2 23:49:51 MSK 2008


Author: sergei
Date: 2008-03-02 23:49:49 +0300 (Sun, 02 Mar 2008)
New Revision: 1379

Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/chats.tcl
   trunk/tkabber/examples/xrdb/badlop-dark.xrdb
   trunk/tkabber/examples/xrdb/dark.xrdb
   trunk/tkabber/examples/xrdb/dark2.xrdb
   trunk/tkabber/examples/xrdb/ice.xrdb
   trunk/tkabber/examples/xrdb/light.xrdb
   trunk/tkabber/examples/xrdb/lighthouse.xrdb
   trunk/tkabber/examples/xrdb/ocean-deep.xrdb
   trunk/tkabber/examples/xrdb/teopetuk.xrdb
   trunk/tkabber/examples/xrdb/warm.xrdb
   trunk/tkabber/ifacetk/idefault.tcl
   trunk/tkabber/ifacetk/iface.tcl
   trunk/tkabber/ifacetk/iroster.tcl
   trunk/tkabber/mclistbox/mclistbox.tcl
   trunk/tkabber/plugins/chat/draw_xhtml_message.tcl
   trunk/tkabber/plugins/richtext/stylecodes.tcl
   trunk/tkabber/richtext.tcl
   trunk/tkabber/tkabber.tcl
Log:
	* ifacetk/bwidget_workarounds.tcl: Changed look and feel of paned
	  window separators.

	* chats.tcl, examples/xrdb/badlop-dark.xrdb, examples/xrdb/dark.xrdb,
	  examples/xrdb/dark2.xrdb, examples/xrdb/ice.xrdb,
	  examples/xrdb/light.xrdb, examples/xrdb/lighthouse.xrdb,
	  examples/xrdb/ocean-deep.xrdb, examples/xrdb/teopetuk.xrdb,
	  examples/xrdb/warm.xrdb, ifacetk/idefault.tcl, ifacetk/iface.tcl,
	  ifacetk/iroster.tcl, mclistbox/mclistbox.tcl,
	  plugins/chat/draw_xhtml_message.tcl, plugins/richtext/stylecodes.tcl,
	  richtext.tcl, tkabber.tcl: Removed global font variable. Now one
	  should either add option *font or use ifacetk::options(font)
	  variable.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/ChangeLog	2008-03-02 20:49:49 UTC (rev 1379)
@@ -3,6 +3,17 @@
 	* ifacetk/bwidget_workarounds.tcl: Changed look and feel of paned
 	  window separators.
 
+	* chats.tcl, examples/xrdb/badlop-dark.xrdb, examples/xrdb/dark.xrdb,
+	  examples/xrdb/dark2.xrdb, examples/xrdb/ice.xrdb,
+	  examples/xrdb/light.xrdb, examples/xrdb/lighthouse.xrdb,
+	  examples/xrdb/ocean-deep.xrdb, examples/xrdb/teopetuk.xrdb,
+	  examples/xrdb/warm.xrdb, ifacetk/idefault.tcl, ifacetk/iface.tcl,
+	  ifacetk/iroster.tcl, mclistbox/mclistbox.tcl,
+	  plugins/chat/draw_xhtml_message.tcl, plugins/richtext/stylecodes.tcl,
+	  richtext.tcl, tkabber.tcl: Removed global font variable. Now one
+	  should either add option *font or use ifacetk::options(font)
+	  variable.
+
 2008-02-21  Sergei Golovan  <sgolovan at nes.ru>
 
 	* msgs/ru.msg: Updated Russian translation.

Modified: trunk/tkabber/chats.tcl
===================================================================
--- trunk/tkabber/chats.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/chats.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -344,7 +344,6 @@
 hook::add predisconnected_hook [namespace current]::chat::disconnect_groupchats 99
 
 proc chat::open_window {chatid type args} {
-    global font font_bold font_italic font_bold_italic
     global chat_width chat_height
     variable chats
     variable chat_id
@@ -415,13 +414,13 @@
 	    -helptext [get_user_status_desc $connid $jid]
 	pack $cw.status.icon -side left
 	if {$options(display_status_description)} {
-	    Label $cw.status.desc -text "($statusdesc($status))" -font $font \
+	    Label $cw.status.desc -text "($statusdesc($status))" \
 		-helptext [get_user_status_desc $connid $jid]
 	    pack $cw.status.desc -side left
 	}
     }
     if {[cequal $type chat]} {
-	menubutton $cw.status.mb -text $jid -font $font \
+	menubutton $cw.status.mb -text $jid \
 	    -menu $cw.status.mb.menu
 	create_user_menu $cw.status.mb.menu $chatid
 	pack $cw.status.mb -side left
@@ -432,7 +431,7 @@
 	create_conference_menu $cw.status.mb.menu $chatid
 	pack $cw.status.mb -side left
 
-	entry $cw.status.subject -font $font \
+	entry $cw.status.subject \
 	    -xscrollcommand [list [namespace current]::set_subject_tooltip $chatid]
 	pack $cw.status.subject -side left -fill x -expand yes
 
@@ -462,7 +461,7 @@
     set isw [ScrolledWindow $cw.isw -scrollbar vertical]
     pack $cw.isw -fill both -expand yes -side bottom -in $dow
     textUndoable $cw.input -width $chat_width \
-	-height [option get $cw inputheight Chat] -font $font -wrap word
+	-height [option get $cw inputheight Chat] -wrap word
     $isw setwidget $cw.input
     [winfo parent $dow] configure -height [winfo reqheight $cw.input]
     set chats(inputwin,$chatid) $cw.input
@@ -506,7 +505,7 @@
 
     ::richtext::richtext $cf.chat \
         -width $chat_width -height $chat_height \
-        -font $font -wrap word
+        -wrap word
 
     ::plugins::chatlog::config $cf.chat \
 	-theyforeground [query_optiondb $cw theyforeground] \

Modified: trunk/tkabber/examples/xrdb/badlop-dark.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/badlop-dark.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/badlop-dark.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -1,6 +1,6 @@
 ! Badlop-Dark.xrdb theme for Tkabber (based on dark2.xrdb)
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster font)
 !*font:				    -monotype-arial-medium-r-normal-*-17-*-*-*-*-*-koi8-r
 
 ! Main window geometry

Modified: trunk/tkabber/examples/xrdb/dark.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/dark.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/dark.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -44,7 +44,7 @@
 ! Color of insertion cursor
 *insertBackground:		    #ffffff
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster font)
 *font:				    -monotype-arial-medium-r-normal-*-13-*-*-*-*-*-koi8-r
 
 ! Currently there is only progressbar (at the splash screen)

Modified: trunk/tkabber/examples/xrdb/dark2.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/dark2.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/dark2.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -44,7 +44,7 @@
 ! Color of insertion cursor
 *insertBackground:		    #bfbfae
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster font)
 *font:				    -monotype-arial-medium-r-normal-*-13-*-*-*-*-*-koi8-r
 
 ! Currently there is only progressbar (at the splash screen)

Modified: trunk/tkabber/examples/xrdb/ice.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/ice.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/ice.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -44,7 +44,7 @@
 ! Color of insertion cursor
 *insertBackground:		    #000000
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster font)
 *font:				    -monotype-arial-medium-r-normal-*-13-*-*-*-*-*-koi8-r
 
 ! Currently there is only progressbar (at the splash screen)

Modified: trunk/tkabber/examples/xrdb/light.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/light.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/light.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -44,7 +44,7 @@
 ! Color of insertion cursor
 *insertBackground:		    #000000
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster font)
 *font:				    -monotype-arial-medium-r-normal-*-13-*-*-*-*-*-koi8-r
 
 ! Currently there is only progressbar (at the splash screen)

Modified: trunk/tkabber/examples/xrdb/lighthouse.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/lighthouse.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/lighthouse.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -43,7 +43,7 @@
 ! Color of insertion cursor
 *insertBackground:		    #000000
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster font)
 !*font:	   -gnu-unifont-*-*-*-*-*-*-*-*-*-*-iso10646-1
 *font:	   -*-verdana-medium-r-normal-*-12-*-*-*-*-*-iso10646-1
 

Modified: trunk/tkabber/examples/xrdb/ocean-deep.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/ocean-deep.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/ocean-deep.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -32,7 +32,7 @@
 
 ! ------------------------------------------------------------ MAIN WINDOW ----
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster font)
 !*font:           -monotype-arial-medium-r-normal-*-17-*-*-*-*-*-koi8-r
 
 ! Main font color

Modified: trunk/tkabber/examples/xrdb/teopetuk.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/teopetuk.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/teopetuk.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -48,7 +48,7 @@
 ! Color of insertion cursor
 *insertBackground:		    #000000
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster font)
 !*font:				    -monotype-arial-medium-r-normal-*-13-*-*-*-*-*-koi8-r
 
 ! Currently there is only progressbar (at the splash screen)

Modified: trunk/tkabber/examples/xrdb/warm.xrdb
===================================================================
--- trunk/tkabber/examples/xrdb/warm.xrdb	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/examples/xrdb/warm.xrdb	2008-03-02 20:49:49 UTC (rev 1379)
@@ -49,7 +49,7 @@
 ! Color of insertion cursor
 *insertBackground:		    #000000
 
-! Font for drawing text (except cases where $font is used)
+! Font for drawing text (except chats and roster)
 *font:				    -monotype-arial-medium-r-normal-*-13-*-*-*-*-*-koi8-r
 
 ! Currently there is only progressbar (at the splash screen)

Modified: trunk/tkabber/ifacetk/idefault.tcl
===================================================================
--- trunk/tkabber/ifacetk/idefault.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/ifacetk/idefault.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -1,80 +1,31 @@
 # $Id$
 
-if {$::tcl_platform(platform) == "unix" && \
-	([catch {tk::pkgconfig get fontsystem} fontsystem] || \
-	 ($fontsystem != "xft"))} {
-    set xlfd_fonts 1
-} else {
-    set xlfd_fonts 0
-}
+# Getting the default font in text widget
+set f [frame .tmpframe -class Chat]
+set t [text $f.tmptext]
+eval font create font [font actual [lindex [$t configure -font] 4]]
+destroy $f
 
-if {$xlfd_fonts} {
-    # We don't use named font because of insufficient flexibility of font
-    # selection in Tk (for example, you can't select -slant oblique or
-    # -weight semicondensed)
-    # Also font encoding can't be specified
-    set font "fixed"
+set ::default_font [list [font actual font -family] \
+			 [font actual font -size]]
 
-    proc define_fonts {args} {
-	global font font_bold font_italic font_bold_italic
+eval font create boldFont [font configure font] \
+          -weight bold
+eval font create italicFont [font configure font] \
+          -slant italic
+eval font create boldItalicFont [font configure font] \
+          -weight bold -slant italic
 
-	if {![info exists font_bold]} {
-	    set font_bold [eval font create [font actual $font]]
-	    font configure $font_bold -weight bold
-	}
-	if {![info exists font_italic]} {
-	    set font_italic [eval font create [font actual $font]]
-	    font configure $font_italic -slant italic
-	}
-	if {![info exists font_bold_italic]} {
-	    set font_bold_italic [eval font create [font actual $font]]
-	    font configure $font_bold_italic -weight bold -slant italic
-	}
-    }
-
-    option add *Entry.font $::font widgetDefault
-} else {
-    switch -exact -- $::tcl_platform(platform) {
-	"windows" {
-	    set font [font create font -family "Arial" -size 10]
-	}
-	default {
-	    set font [font create font -family "fixed" -size 10]
-	}
-    }
-
-    set default_font [list [font actual $font -family] [font actual $font -size]]
-
-    proc define_fonts {args} {
-	global font font_bold font_italic font_bold_italic
-
-	if {[catch {
-	    set font_bold \
-		[eval font create font_bold [font actual $font]]
-	    set font_italic \
-		[eval font create font_italic [font actual $font]]
-	    set font_bold_italic \
-		[eval font create font_bold_italic [font actual $font]]
-	}]} {
-	    eval font configure font_bold [font actual $font]
-	    eval font configure font_italic [font actual $font]
-	    eval font configure font_bold_italic [font actual $font]
-	}
-	font configure font_italic -slant italic
-	font configure font_bold -weight bold
-	font configure font_bold_italic -weight bold -slant italic
-    }
-
-    #font create menufont -family Helvetica -size 10 \
-    # -weight normal -slant roman -underline 0 -overstrike 0
-    eval [linsert [font configure $font] 0 font create menufont]
-
-    option add *font menufont widgetDefault
-    option add *Entry.font font widgetDefault
+proc redefine_fonts {args} {
+    eval font configure font $args
+    eval font configure boldFont [font configure font] \
+	      -weight bold
+    eval font configure italicFont [font configure font] \
+	      -slant italic
+    eval font configure boldItalicFont [font configure font] \
+	      -weight bold -slant italic
 }
 
-hook::add postload_hook [namespace current]::define_fonts 70
-
 if {![info exists usetabbar]} {
     set usetabbar 1
 }

Modified: trunk/tkabber/ifacetk/iface.tcl
===================================================================
--- trunk/tkabber/ifacetk/iface.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/ifacetk/iface.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -46,12 +46,10 @@
 	-group IFace -type boolean \
 	-command [namespace current]::switch_statusbar
 
-    if {!$::xlfd_fonts} {
-	custom::defvar options(font) $::default_font \
-	    [::msgcat::mc "Font to use in roster, chat windows etc."] \
-	    -group IFace -type font \
-	    -command [namespace current]::switch_font
-    }
+    custom::defvar options(font) $::default_font \
+	[::msgcat::mc "Font to use in roster, chat windows etc."] \
+	-group IFace -type font \
+	-command [namespace current]::switch_font
 
     custom::defvar options(raise_new_tab) 1 \
 	[::msgcat::mc "Raise new tab."] \
@@ -618,8 +616,7 @@
 	lappend args -overstrike 0
     }
 
-    eval [list font configure font] $args
-    define_fonts
+    eval redefine_fonts $args
     roster::redraw_after_idle
 }
 

Modified: trunk/tkabber/ifacetk/iroster.tcl
===================================================================
--- trunk/tkabber/ifacetk/iroster.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/ifacetk/iroster.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -910,7 +910,7 @@
     set config(availableforeground)    [option get $w availableforeground Roster]
     set config(chatforeground)         [option get $w chatforeground Roster]
 
-    canvas $w.canvas -bg $config(background) \
+    canvas $c -bg $config(background) \
 	-highlightthickness $::tk_highlightthickness \
 	-scrollregion {0 0 0 0} \
 	-width $width -height $height
@@ -924,10 +924,10 @@
     set iroster($w,singleclick) $singleclickproc
     set iroster($w,doubleclick) $doubleclickproc
 
-    bindscroll $w.canvas
+    bindscroll $c
 
     if {[info exists draginitcmd]} {
-	DragSite::register $w.canvas -draginitcmd $draginitcmd
+	DragSite::register $c -draginitcmd $draginitcmd
     }
 
     set args {}
@@ -938,12 +938,11 @@
 	lappend args -dropcmd $dropcmd
     }
     if {![lempty $args]} {
-	eval [list DropSite::register $w.canvas -droptypes {JID}] $args
+	eval [list DropSite::register $c -droptypes {JID}] $args
     }
 }
 
 proc roster::addline {w type text jid group indent {jids {}} {icon ""} {foreground ""}} {
-    global font
     upvar #0 roster::aliases aliases
     variable roster
     variable iroster
@@ -956,7 +955,7 @@
     set grouptag [jid_to_tag $group]
 
     set ypad 1
-    set linespace [font metric $font -linespace]
+    set linespace [font metric font -linespace]
     set lineheight [expr {$linespace + $ypad}]
 
     set uy $iroster($w,ypos)
@@ -1059,11 +1058,11 @@
 	    set foreground $config(foreground)
 	}
     }
-    $c create text $x $uy -text $text -anchor nw -font $font \
+    $c create text $x $uy -text $text -anchor nw -font font \
 	-fill $foreground -tags [list jid$tag group$grouptag $type text]
 
     set iroster($w,width) [max $iroster($w,width) \
-			      [expr {$x + [font measure $font $text]}]]
+			      [expr {$x + [font measure font $text]}]]
 
 
     $c bind jid$tag <Any-Enter> \

Modified: trunk/tkabber/mclistbox/mclistbox.tcl
===================================================================
--- trunk/tkabber/mclistbox/mclistbox.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/mclistbox/mclistbox.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -199,12 +199,12 @@
 	foreach option [list Anchor Background Font \
 		Foreground Height Image  ] {
 	    set values [$tmpWidget configure -[string tolower $option]]
-	    option add *Mclistbox.label$option [lindex $values 3] widgetDefault
+	    option add *Mclistbox.label$option [lindex $values 4] widgetDefault
 	}
 	set values [$tmpWidget configure -foreground]
-	option add *Mclistbox.labelActiveForeground [lindex $values 3] widgetDefault
+	option add *Mclistbox.labelActiveForeground [lindex $values 4] widgetDefault
 	set values [$tmpWidget configure -background]
-	option add *Mclistbox.labelActiveBackground [lindex $values 3] widgetDefault
+	option add *Mclistbox.labelActiveBackground [lindex $values 4] widgetDefault
 	destroy $tmpWidget
 
 	# these are unique to us...

Modified: trunk/tkabber/plugins/chat/draw_xhtml_message.tcl
===================================================================
--- trunk/tkabber/plugins/chat/draw_xhtml_message.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/plugins/chat/draw_xhtml_message.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -7,7 +7,7 @@
 	weight slant size
 	list_style list_counter
     }
-    #set font [option get . font Tkabber]
+
     set urlid 0
 
     custom::defvar options(enable) 0 \
@@ -81,7 +81,6 @@
 
 
 proc xhtml::init {cw} {
-    variable font
     variable state
     variable stack
 
@@ -97,8 +96,7 @@
     set stack(weight) {}
     set state(slant) 0
     set stack(slant) {}
-    # TODO
-    #set state(size) [font actual $font -size]
+    # TODO: use default font size
     set state(size) 12
     set stack(size) {}
     set state(list_style) ul
@@ -341,7 +339,6 @@
 }
 
 proc xhtml::get_tags {chatw} {
-    variable font
     variable state
 
     set tags {}
@@ -355,23 +352,29 @@
 	-lmargin1 $state(lmargin1) -lmargin2 $state(lmargin2)
     lappend tags $indent_tag
 
-    #set customfont [eval font create [font actual $font]]
     if {$state(weight)} {
 	set fweight bold
+	if {$state(slant)} {
+	    set fslant i
+	    set font boldItalicFont
+	} else {
+	    set fslant r
+	    set font boldFont
+	}
     } else {
-	set fweight medium
+	set fweight normal
+	if {$state(slant)} {
+	    set fslant i
+	    set font italicFont
+	} else {
+	    set fslant r
+	    set font font
+	}
     }
-    if {$state(slant)} {
-	set fslant i
-    } else {
-	set fslant r
-    }
-    # TODO
+    # TODO: use different sizes
     set fsize $state(size)
-    #font configure $customfont -size $fsize -slant $fslant -weight $fweight
     set font_tag tag_font_${fsize}_${fslant}_${fweight}
-    set customfont -*-helvetica-${fweight}-${fslant}-*-*-${fsize}-*-*-*-*-*-*-*
-    $chatw tag configure $font_tag -font $customfont
+    $chatw tag configure $font_tag -font $font
     lappend tags $font_tag
     $chatw tag lower $font_tag xhtml_symb
     
@@ -396,14 +399,3 @@
     return $tag
 }
 
-proc xhtml::setup_xhtml_tags {chatid type} {
-    global font
-
-    set cw [::chat::chat_win $chatid]
-
-    $cw tag configure xhtml_symb -font $font
-    $cw tag raise xhtml_symb
-}
-
-hook::add open_chat_post_hook [namespace current]::xhtml::setup_xhtml_tags
-

Modified: trunk/tkabber/plugins/richtext/stylecodes.tcl
===================================================================
--- trunk/tkabber/plugins/richtext/stylecodes.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/plugins/richtext/stylecodes.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -37,7 +37,7 @@
 	    continue
 	}
 
-	foreach elem [scan_stylecodes $s $type $tags {* / _}] {
+	foreach elem [scan_stylecodes $s $type $tags {* / _ -}] {
 	    lappend out $elem
 	}
     }
@@ -177,7 +177,8 @@
     set out {}
     array set tags {* bold
 		    / italic
-		    _ underlined}
+		    _ underlined
+		    - overstricken}
 	
     foreach sc [split $pattern ""] {
 	lappend out $tags($sc)
@@ -192,21 +193,22 @@
 }
 
 proc stylecodes::configure_richtext_widget {w} {
-    global font font_bold font_italic font_bold_italic
     variable options
 
     if {$options(emphasize)} {
 	$w tag configure stylecode -elide $options(hide_markup)
-	$w tag configure bold -font $font_bold
-	$w tag configure italic -font $font_italic
-	$w tag configure bold_italic -font $font_bold_italic
+	$w tag configure bold -font boldFont
+	$w tag configure italic -font italicFont
+	$w tag configure bold_italic -font boldItalicFont
 	$w tag configure underlined -underline 1
+	$w tag configure overstricken -overstrike 1
     } else {
 	$w tag configure stylecode -elide 0
-	$w tag configure bold -font $font
-	$w tag configure italic -font $font
-	$w tag configure bold_italic -font $font
+	$w tag configure bold -font font
+	$w tag configure italic -font font
+	$w tag configure bold_italic -font font
 	$w tag configure underlined -underline 0
+	$w tag configure overstricken -overstrike 0
     }
 }
 

Modified: trunk/tkabber/richtext.tcl
===================================================================
--- trunk/tkabber/richtext.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/richtext.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -149,7 +149,7 @@
     set w [eval text $args]
     config $w
     install_selection_handlers $w
-    $w configure -state disabled
+    $w configure -state disabled -font font
 }
 
 # TODO get rid of "deftag"

Modified: trunk/tkabber/tkabber.tcl
===================================================================
--- trunk/tkabber/tkabber.tcl	2008-03-02 11:33:03 UTC (rev 1378)
+++ trunk/tkabber/tkabber.tcl	2008-03-02 20:49:49 UTC (rev 1379)
@@ -133,7 +133,6 @@
 } 100
 
 load_source default.tcl
-load_source ifacetk idefault.tcl
 
 hook::add postload_hook postload
 hook::add finload_hook finload
@@ -222,6 +221,7 @@
 The IMG package is available at http://www.xs4all.nl/~nijtmans/img.html"
 }
 
+load_source ifacetk idefault.tcl
 load_source custom.tcl
 load_source utils.tcl
 load_source plugins.tcl



More information about the Tkabber-dev mailing list