[Sumover-dev] [svn commit] r4436 - vic/branches/mpeg4/tcl

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Wed Apr 22 12:46:52 BST 2009


Author: douglask
Date: Wed Apr 22 12:46:48 2009
New Revision: 4436

Modified:
   vic/branches/mpeg4/tcl/ui-main.tcl

Log:
Use -activebackground from another widget to provide an active highlight for the video thumbnails


Modified: vic/branches/mpeg4/tcl/ui-main.tcl
==============================================================================
--- vic/branches/mpeg4/tcl/ui-main.tcl	(original)
+++ vic/branches/mpeg4/tcl/ui-main.tcl	Wed Apr 22 12:46:48 2009
@@ -536,16 +536,7 @@
 	set f [smallfont]
 	set stamp $w.stamp
 	frame $stamp -relief ridge -borderwidth 2
-	if {[string match [ windowingsystem] "aqua"]} {
-		bind $stamp <Enter> "%W configure -background CornflowerBlue"
-	} elseif {$::tk_version > 8.4} {
-		# correct approach would be to somehow query the theme for
-		# selectforeground and use that instead of hardcoding to white
-		bind $stamp <Enter> "%W configure -background white"
-	} else {
-		bind $stamp <Enter> "%W configure -background gray90"
-	}
-	bind $stamp <Leave> "%W configure -background [resource background]"
+
 	create_video_widget $stamp.video 80 60
 	global win_is_slow
 	set win_is_slow($stamp.video) 1
@@ -573,18 +564,17 @@
 
 	pack $w.r.cw -side left -expand 1 -fill both -anchor w -padx 0
 
-
-        if {[string match [ windowingsystem] "aqua"]} {
+	if {[string match [ windowingsystem] "aqua"]} {
                 label $w.r.cw.name -textvariable src_nickname($src) -font $f \
                         -padx 2 -pady 1 -borderwidth 0 -anchor w
                 label $w.r.cw.addr -textvariable src_info($src) -font $f \
                         -padx 2 -pady 1 -borderwidth 0 -anchor w
-        } else {
+	} else {
                 label $w.r.cw.name -textvariable src_nickname($src) -font $f \
                         -pady 1 -borderwidth 0 -anchor w
                 label $w.r.cw.addr -textvariable src_info($src) -font $f \
                         -pady 1 -borderwidth 0 -anchor w
-        }          
+	}          
 
 
 	global ftext btext ltext
@@ -663,7 +653,18 @@
 	pack $w.r.cw -fill x -side top
 	pack $w.r.ctrl -fill x -side top
 	pack $w.r -side left -expand 1 -fill x
-	
+
+	if {[string match [ windowingsystem] "aqua"]} {
+		bind $stamp <Enter> "%W configure -background CornflowerBlue"
+		bind $stamp <Leave> "%W configure -background [resource background]"
+	} elseif {$::tk_version > 8.4} {
+		bind $stamp <Enter> "%W configure -background [$m cget -activebackground]"
+		bind $stamp <Leave> "%W configure -background [$m cget -background]"
+	} else {
+		bind $stamp <Enter> "%W configure -background gray90"
+		bind $stamp <Leave> "%W configure -background [resource background]"
+	}
+
 	bind $stamp.video <1> "select_thumbnail $w $src"
 	bind $stamp.video <Enter> { focus %W }
 	bind $stamp.video <d> "$src deactivate"



More information about the Sumover-dev mailing list