[Tkabber-dev] r399 - in trunk/plugins/tabimages: . msgs

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Sat Sep 25 05:11:54 MSD 2010


Author: Rejjin
Date: 2010-09-25 05:11:53 +0400 (Sat, 25 Sep 2010)
New Revision: 399

Modified:
   trunk/plugins/tabimages/msgs/ru.msg
   trunk/plugins/tabimages/tabimages.tcl
Log:
Fixed bugs with color of icons.
Added option for location of icon in tab.

Modified: trunk/plugins/tabimages/msgs/ru.msg
===================================================================
--- trunk/plugins/tabimages/msgs/ru.msg	2010-09-24 23:39:58 UTC (rev 398)
+++ trunk/plugins/tabimages/msgs/ru.msg	2010-09-25 01:11:53 UTC (rev 399)
@@ -3,4 +3,9 @@
 ::msgcat::mcset ru "Chats" "Чаты"
 ::msgcat::mcset ru "Enable" "Активировать"
 ::msgcat::mcset ru "Groupchats" "Конференции"
-::msgcat::mcset ru "Font to use in tabs bar window" "Шрифт для вкладок"
\ No newline at end of file
+::msgcat::mcset ru "Font to use in tabs bar window" "Шрифт для вкладок"
+::msgcat::mcset ru "Position of icon in tab" "Позиция иконки во вкладке"
+::msgcat::mcset ru "Top" "Сверху"
+::msgcat::mcset ru "Left" "Снизу"
+::msgcat::mcset ru "Right" "Справа"
+::msgcat::mcset ru "Bottom" "Слева"
\ No newline at end of file

Modified: trunk/plugins/tabimages/tabimages.tcl
===================================================================
--- trunk/plugins/tabimages/tabimages.tcl	2010-09-24 23:39:58 UTC (rev 398)
+++ trunk/plugins/tabimages/tabimages.tcl	2010-09-25 01:11:53 UTC (rev 399)
@@ -36,6 +36,18 @@
 	-group Tabimages -type font \
 	-command ${space}::switch_font
 	
+	variable compound
+	custom::defvar compound {left} \
+	[::msgcat::mc "Position of icon in tab"] \
+	-type options -group Tabimages \
+	-command [list ${space}::tab_images_init -reload 1] \
+	-values [list \
+		left [::msgcat::mc "Left"] \
+		right [::msgcat::mc "Right"] \
+		top [::msgcat::mc "Top"] \
+		bottom [::msgcat::mc "Bottom"] \
+	]
+	
 	hook::add finload_hook [list ${space}::tab_images_init -reload 0] 100	
 	hook::add finload_hook ${space}::switch_font 100
 	hook::add open_chat_post_hook ${space}::update_tab 90
@@ -79,9 +91,14 @@
 			3 { if [chat::is_chat $chatid] return }
 		}
 		
-		if [chat::is_groupchat $chatid] return
 		if ![chat::is_opened $chatid] return
 		
+		if {[chat::is_groupchat $chatid] && [chat::is_opened $chatid]} {
+			configure_tab_button [get_tab_button $chatid] \
+			roster/conference/$type left
+			return
+		}
+		
 		set icon roster/user/[get_jid_status $xlib $jid]
 		configure_tab_button [get_tab_button $chatid] $icon left
 	}
@@ -96,14 +113,11 @@
 	
 	proc configure_tab_button {tab_path icon { cmp none }} {
 		variable options
+		variable compound
 		
-		if ![string equal $icon {}] { 
-		set cmp left 
-		}
-		
 		ButtonBar::itemconfigure .nb $tab_path  \
 			-image $icon \
-			-compound $cmp
+			-compound $compound
 	}
 	
 	proc tab_images_init { reload? reload args } {



More information about the Tkabber-dev mailing list