[patch] Number widget and GUI position improvements



(not urgent)
Hi, Chris, please apply the two attached patches.

# Oh, oh, Jeremy and Chris have revealed a new thing on negative
# position before I send this mail. Anyway, this patch enables
# negative in configurator, so it must be applied.

A couple of months ago you hacked the GUI's window position to allow
negative value, but the default value is also changed to -65536,
because the default initial value is equal to the minimum. (Sudden
appearance of -65536 is sure to make users wonder.) You've fixed it in
ext/matched-window.jl, but again negative is forbidden.

To fix it, I have meddeled with "number" widget to enable an optional
parameter "initial-value". Now the range is -65536..65536, but the
default value is 0.

Depth has gone under similar change. -16..16, but the default is 0,
instead of -16.

The attached patch contains news.texi change, too, and I think git
logs can be used for ChangeLog.

# I learned git-add --interactive. It's really useful.
## I abused git commit --amend -c, and messed up the HEAD X(

For 2.patch (attached file), add
------------------------------------------------------------------------
@item In GUI Configurator, position parameters can be negative [Christopher Bratusek, Teika Kazura]
------------------------------------------------------------------------
under bugfix section, in man/news.texi. 
(It changed after I prepared patch, so not included in the patch ;)

As for negativeness .. well, both make sense (a. extended window, so
-1 is 1 pixel left to 0. b. -1 is -1 from rightmost.)

Regards,
Teika (Teika kazura)

commit e1858e811fc7c2d0c478de20b2b8a33c83c27a0f
Author: Teika kazura <teika lavabit com>
Date:   Wed Aug 26 18:29:11 2009 +0900

    lisp/sawfish/gtk/widget.jl: number widget can take optional initial value.
    man/news.texi: it is recorded.
    This patch reverts 06b722.

diff --git a/lisp/sawfish/gtk/widget.jl b/lisp/sawfish/gtk/widget.jl
index e601622..54a74a8 100644
--- a/lisp/sawfish/gtk/widget.jl
+++ b/lisp/sawfish/gtk/widget.jl
@@ -61,9 +61,12 @@
 
   ;; predefined widget types are:
 
+  ;;    (choice SYMBOLS...)	   
   ;;	(symbol OPTIONS...)
   ;;	(string)
-  ;;	(number [MIN [MAX]])
+  ;;	(number [MIN [MAX [INITIAL-VALUE]]]) ;; integer only
+  ;;       The default of minimum is 0, max 65536,
+  ;;       and initial value is the same as the min.
   ;;	(boolean [LABEL])
   ;;	(color)
   ;;	(font)
@@ -265,12 +268,15 @@
 
   (define-widget-type 'string make-string-item)
 
-  (define (make-number-item changed-callback #!optional minimum maximum)
+  (define (make-number-item changed-callback
+			    #!optional minimum maximum initial-value)
     ;; XXX backwards compat..
     (when (eq minimum 'nil) (setq minimum nil))
     (when (eq maximum 'nil) (setq maximum nil))
-    (let ((widget (gtk-spin-button-new-with-range (or minimum -65535)
+    (let ((widget (gtk-spin-button-new-with-range (or minimum 0)
 						  (or maximum 65535) 1)))
+      (when initial-value
+	(gtk-spin-button-set-value widget initial-value))
       (when changed-callback
 	(g-signal-connect
 	 widget "value-changed" (make-signal-callback changed-callback)))
diff --git a/man/news.texi b/man/news.texi
index 3dc5fc3..739a4a6 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -74,7 +74,7 @@ they occurred between. For more detailed information see the
 
 @item Make sure window-type of docks/panels is dock [Timo Korvola]
 
- item Sawfish-Ui does now allow negative values in SpinButtons by default [Christopher Bratusek]
+ item Number widget can take optional initial value [Teika Kazura]
 
 @item Sawfish does now appear in KDE4s WM Selector [Christopher Bratusek]
 
commit 509f57d73bc63650ab4e96619b714305bbd8b27e
Author: Teika kazura <teika lavabit com>
Date:   Wed Aug 26 18:30:57 2009 +0900

    lisp/sawfish/wm/ext/match-window.jl: In configurator GUI, position parameter can take negative value. Depth's initial value is 0.
    man/news.texi: It is recorded.

diff --git a/lisp/sawfish/wm/ext/match-window.jl b/lisp/sawfish/wm/ext/match-window.jl
index b18c88c..9c877e6 100644
--- a/lisp/sawfish/wm/ext/match-window.jl
+++ b/lisp/sawfish/wm/ext/match-window.jl
@@ -73,11 +73,11 @@
     `((placement ,(_ "Placement")
        (ignore-program-position boolean)
        (place-mode ,(lambda () `(choice ,@placement-modes)))
-       (position (pair (number 0) (number 0)))
+       (position (pair (number -65536 65536 0) (number -65536 65536 0)))
        (dimensions (pair (number 1) (number 1)))
        (workspace (number 1))
        (viewport (pair (number 1) (number 1)))
-       (depth (number -16 16))
+       (depth (number -16 16 0))
        (placement-weight (number 0))
        (fixed-position boolean)
        (maximized (choice all vertical horizontal))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]