alignment scales



Hi,

   Mon Sep 10 16:55:49 2001  Tim Janik  <timj gtk org>

        * gtk/gtkalignment.c (gtk_alignment_init): fix xscale and
          yscale behaviour which havoc broke. they have to default to
          1.0 for expand behaviour.

While admittedly I shouldn't have checked that in (the param spec and
_init function were out-of-sync, so I thought it was just a small
bugfix), I think 1.0 is a bad default - an alignment with 1.0
xscale/yscale has no effect whatsoever - it is a complete no-op
container (with the exception of border width). The xalign/yalign
params have no effect in this case.  Or am I missing something?

So what do you mean "have to default to 1.0 for expand behavior"?
When would I want this? All widgets have expand behavior naturally,
they don't need assistance from an alignment. The only reason to use
an alignment is to suppress expand behavior in at least one dimension
(horizontal or vertical).

Changing the default breaks things for gtk_widget_new users. Since
Beast, GLE, etc. are the only apps in CVS that use gtk_widget_new to
create alignments, a survey of its usage:

case A:
 xscale/yscale is irrelevant to behavior since alignment is empty:
   http://cvs.gnome.org/lxr/source/beast/beast-gtk/bstparam.c#238
   http://cvs.gnome.org/lxr/source/beast/beast-gtk/bstmenus.c#181

case B:
 xscale/yscale explicitly set to 0.0:
   http://cvs.gnome.org/lxr/source/beast/beast-gtk/bstparam.c#289
   http://cvs.gnome.org/lxr/source/beast/beast-gtk/bstparam.c#868
   http://cvs.gnome.org/lxr/source/beast/beast-gtk/bstitemview.c#427
   http://cvs.gnome.org/lxr/source/beast/beast-gtk/bsteffectview.c#118
   http://cvs.gnome.org/lxr/source/gnome-core/applets/desk-guide/deskguide_applet.c#562
   http://cvs.gnome.org/lxr/source/gnome-core/applets/desk-guide/deskguide_applet.c#857
   http://cvs.gnome.org/lxr/source/gnome-core/applets/desk-guide/gwmtaskview.c#341

case C:
 base class for new widget, no idea of the details:
   http://cvs.gnome.org/lxr/source/beast/beast-gtk/bstitemview.c#71
   http://cvs.gnome.org/lxr/source/beast/beast-gtk/bsteffectview.c#77
   http://cvs.gnome.org/lxr/source/gle/gle/glercpref.c#64

case D:
 xscale/yscale explicitly set to 1.0, but xalign/yalign also set, 
 which doesn't make much sense, and means the alignment has 
 no effect:
   http://cvs.gnome.org/lxr/source/gle/gle/gleeditor.c#512
   http://cvs.gnome.org/lxr/source/gle/gle/gleeditor.c#1315
   
case E:
 xscale/yscale/xalign/yalign left as defaults, meaning the alignment 
 has no effect:
   http://cvs.gnome.org/lxr/source/gnome-core/applets/desk-guide/deskguide_applet.c#213

So:

 - changing the default only breaks cases E and maybe C

 - fixing the default would assist everyone using Glade, since 
   alignments will be set up for the common case by default

Havoc





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