rpms/bwidget/FC-5 bwidget-1.7.0-colorchooser.patch, NONE, 1.1 bwidget.spec, 1.1, 1.2

Michael Thomas (wart) fedora-extras-commits at redhat.com
Sun Aug 13 04:14:17 UTC 2006


Author: wart

Update of /cvs/extras/rpms/bwidget/FC-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv12387

Modified Files:
	bwidget.spec 
Added Files:
	bwidget-1.7.0-colorchooser.patch 
Log Message:
Add patch for adding a color selector to the font dialog



bwidget-1.7.0-colorchooser.patch:

--- NEW FILE bwidget-1.7.0-colorchooser.patch ---
--- /usr/share/bwidget1.7.0/font.tcl~	2006-07-30 11:28:59.000000000 +0200
+++ /usr/share/bwidget1.7.0/font.tcl	2006-07-30 12:43:37.000000000 +0200
@@ -24,8 +24,10 @@
 
         {-type		Enum		dialog        0 {dialog toolbar}}
         {-font		TkResource	""            0 label}
+	{-initialcolor	String		""            0}
 	{-families	String		"all"         1}
 	{-querysystem	Boolean		1             0}
+	{-nosizes	Boolean		0             1}
 	{-styles	String		"bold italic underline overstrike" 1}
         {-command	String		""            0}
         {-sampletext	String		"Sample Text" 0}
@@ -189,7 +191,9 @@
         LabelFrame::configure $labf3 -focus $subf.[lindex $_styles 0]
 
         pack $labf1 -side left -anchor n -fill both -expand yes
-        pack $labf2 -side left -anchor n -fill both -expand yes -padx 8
+	if { ![Widget::getoption "$path#SelectFont" -nosizes] } {
+	        pack $labf2 -side left -anchor n -fill both -expand yes -padx 8
+	}
         pack $labf3 -side left -anchor n -fill both -expand yes
 
         set botf [frame $frame.botf -width 100 -height 50 \
@@ -204,8 +208,38 @@
                       -text [Widget::getoption "$path#SelectFont" -sampletext]]
         place $lab -relx 0.5 -rely 0.5 -anchor c
 
-        pack $topf -pady 4 -fill both -expand yes
-        pack $botf -pady 4 -fill x
+	pack $topf -pady 4 -fill both -expand yes
+
+	if { [Widget::getoption "$path#SelectFont" -initialcolor] != ""} {
+		set thecolor [Widget::getoption "$path#SelectFont" -initialcolor]
+		set colf [frame $frame.colf]
+			
+		set frc [frame $colf.frame -width 50 -height 20 -bg $thecolor -bd 0 -relief flat\
+			-highlightthickness 1 -takefocus 0 \
+			-highlightbackground black \
+			-highlightcolor black]
+			
+		set script "set [list SelectFont::${path}(fontcolor)] \[tk_chooseColor -parent $colf.button -initialcolor \[set [list SelectFont::${path}(fontcolor)]\]\];\
+			SelectFont::_update [list $path]"
+		
+		set but  [button $colf.button -command $script \
+			-text "Color..."]
+		
+		$lab configure -foreground $thecolor
+		$frc configure -bg $thecolor
+		
+		pack $but -side left
+		pack $frc -side left -padx 5
+		
+		set data(frc) $frc
+		set data(fontcolor) $thecolor
+
+		pack $colf -pady 4 -fill x -expand true        
+	
+	} else {
+		set data(fontcolor) -1
+	}
+	pack $botf -pady 4 -fill x
 
         Dialog::add $path -name ok
         Dialog::add $path -name cancel
@@ -360,13 +394,24 @@
 
     if { [Dialog::draw $path] == 0 } {
         set result [Widget::getoption "$path#SelectFont" -font]
+    	set color $data(fontcolor)
+	
+	if { $color == "" } {
+		set color #000000
+	}
+
     } else {
         set result ""
+	set color ""
     }
     unset data
     Widget::destroy "$path#SelectFont"
     destroy $path
-    return $result
+    if { $color != -1 } {
+    	return [list $result $color]
+    } else {
+    	return $result
+    }
 }
 
 
@@ -428,6 +473,14 @@
     if { $type == "dialog" } {
         $data(label) configure -font $font
         $path:cmd configure -cursor $curs
+	if { ($data(fontcolor) != "") && ($data(fontcolor) != -1) } {
+		$data(label) configure -foreground $data(fontcolor)
+		$data(frc) configure -bg $data(fontcolor)
+	} elseif { $data(fontcolor) == "" }  {
+		#If no color is selected, restore previous one
+		set data(fontcolor) [$data(label) cget -foreground]
+
+	}
     } elseif { [set cmd [Widget::getoption "$path#SelectFont" -command]] != "" } {
         uplevel \#0 $cmd
     }


Index: bwidget.spec
===================================================================
RCS file: /cvs/extras/rpms/bwidget/FC-5/bwidget.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- bwidget.spec	22 Feb 2006 17:40:19 -0000	1.1
+++ bwidget.spec	13 Aug 2006 04:14:17 -0000	1.2
@@ -1,12 +1,13 @@
 Name:           bwidget
 Version:        1.7.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Extended widget set for Tk
 
 Group:          Development/Libraries
 License:        Distributable
 URL:            http://tcllib.sourceforge.net/
 Source0:        http://download.sourceforge.net/tcllib/BWidget-1.7.0.tar.gz
+Patch0:         bwidget-1.7.0-colorchooser.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -17,6 +18,7 @@
 
 %prep
 %setup -q -n BWidget-%{version}
+%patch0 -p4
 %{__sed} -i 's/\r//' LICENSE.txt
 
 %install
@@ -44,7 +46,11 @@
 %doc BWman/*.html
 
 %changelog
+* Fri Aug 11 2006 Wart <wart at kobold.org> 1.7.0-3
+- Add patch for adding a color selector to the font dialog (BZ #200809)
+
 * Sat Dec 10 2005 Wart <wart at kobold.org> 1.7.0-2
 - added dist tag to release tag.
+
 * Sat Dec 10 2005 Wart <wart at kobold.org> 1.7.0-1
 - Initial spec file.




More information about the fedora-extras-commits mailing list