[yast-devel] Input field width in the mod-ui
This bug may be of general interest:
https://bugzilla.novell.com/show_bug.cgi?id=345819
In short, input fields (formerly known as TextEntry) and password fields now
no longer take all the space they can get, but by default use a reasonable
default width - unless you tell them to behave differently.
This was buggy in the old UI: They always stretched, even though though they
should not unless explicitly told (with `opt(`hstretch) ).
This bug is now fixed, but that OTOH means that it now behaves differently.
If we can live with adding some `opt(`hstretch) in some dialogs I would very
much prefer to keep the bug fix and add that `opt(`hstretch) where necessary
and/or useful.
With the fix we can have both ways: Input fields that use a reasonable width
by default and input fields that stretch to take whatever space is available.
Going back to the old version would mean we only have input fields that
stretch, and in cases where you don't want all the width to be consumed by an
input field use HWeight() or add some HSquash() or HVSquash() around the
VBox() to make it smaller, but of course always take care not to have them
become too small and add some MinWidth() - about like this:
`HSquash(
`MinWidth( 30, // min. 30 units wide (80x25 is main window size)
`VBox(
`InputField(`id(...), "blurb" ),
`InputField(`id(...), "blurb" ),
...
`InputField(`id(...), "blurb" )
)
)
)
So now the question is: Which kind of pain is bigger? Adding `opt(`hstretch)
or reverting to the old (IMHO buggy) behaviour?
CU
--
Stefan Hundhammer
On Tue, Dec 04, 2007 at 11:58:45AM +0100, Stefan Hundhammer wrote:
https://bugzilla.novell.com/show_bug.cgi?id=345819
In short, input fields (formerly known as TextEntry) and password fields now no longer take all the space they can get, but by default use a reasonable default width - unless you tell them to behave differently. [...] So now the question is: Which kind of pain is bigger? Adding `opt(`hstretch) or reverting to the old (IMHO buggy) behaviour?
Breaking compatibility is bad. How about preserving the old behavior for TextEntry and changing it for InputField? -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
On Tuesday 04 December 2007 12:44, Martin Vidner wrote:
How about preserving the old behavior for TextEntry and changing it for InputField?
Ugh... implicit magic that happens when people least expect it... application
programmers getting surprised when they forget this little exception (which
will be about in 2-3 weeks)... that doesn't sound very good to me.
CU
--
Stefan Hundhammer
On Tue, Dec 04, 2007 at 01:00:18PM +0100, Stefan Hundhammer wrote:
On Tuesday 04 December 2007 12:44, Martin Vidner wrote:
How about preserving the old behavior for TextEntry and changing it for InputField?
Ugh... implicit magic that happens when people least expect it... application programmers getting surprised when they forget this little exception (which will be about in 2-3 weeks)... that doesn't sound very good to me.
The old behavior may be a bug but people learned to live with it and we have uncountable dialogs relying on the bug. At this point, it is no longer a "bugfix" but "gratuitous incompatibility". Because you only gain broken dialogs. In such situations, if we want new behavior, we need a new name. InputField is obvious, since you already introduced it. How to document it; http://forgeftp.novell.com/yast/doc/SL10.3/tdg/TextEntry_widget.html section Description: "The difference between TextEntry and InputField is that TextEntry has `opt (`hstretch) built in. (Before we had InputField, dialogs often had to compensate that with HSquash.)" -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Martin Vidner napsal(a):
On Tue, Dec 04, 2007 at 01:00:18PM +0100, Stefan Hundhammer wrote:
How about preserving the old behavior for TextEntry and changing it for InputField? Ugh... implicit magic that happens when people least expect it... application
On Tuesday 04 December 2007 12:44, Martin Vidner wrote: programmers getting surprised when they forget this little exception (which will be about in 2-3 weeks)... that doesn't sound very good to me.
The old behavior may be a bug but people learned to live with it and we have uncountable dialogs relying on the bug. At this point, it is no longer a "bugfix" but "gratuitous incompatibility". Because you only gain broken dialogs.
In such situations, if we want new behavior, we need a new name. InputField is obvious, since you already introduced it.
How to document it; http://forgeftp.novell.com/yast/doc/SL10.3/tdg/TextEntry_widget.html section Description: "The difference between TextEntry and InputField is that TextEntry has `opt (`hstretch) built in. (Before we had InputField, dialogs often had to compensate that with HSquash.)"
I fully agree with this idea. Breaking the current dialog because of some 'bug-fix' (which we have already fixed in those dialogs by other way) sound like a bit odd solution. Think about other than openSUSE developers and their current YaST dialogs. Have a nice day Lukas
On Tuesday 04 December 2007 14:07, Martin Vidner wrote:
On Tue, Dec 04, 2007 at 01:00:18PM +0100, Stefan Hundhammer wrote:
On Tuesday 04 December 2007 12:44, Martin Vidner wrote:
How about preserving the old behavior for TextEntry and changing it for InputField?
Even though I don't really like this idea, I can see the reasoning. I don't
think we have a reasonable other chance.
So now it's official: From yast2-core-2.16.14 on, input fields created as
`TextEntry() behave like `InputField(`opt(`hstretch))
(there will be a warning in the log once per program run).
I'd still like to encourage YCP module maintainers to make a conscious
decision which behaviour is desired and use
`InputField() for fields with a reasonable default size and
`InputField(`opt(`hstretch) for fields that stretch as wide as they can.
CU
--
Stefan Hundhammer
I forgot to add: There are new UI examples to demonstrate both behaviours:
InputField-layout.ycp
TextEntry-layout.ycp
See also
http://w3.suse.de/~sh/yast2-screen-shots/InputField-layout.png
http://w3.suse.de/~sh/yast2-screen-shots/TextEntry-layout.png
CU
--
Stefan Hundhammer
participants (3)
-
Lukas Ocilka
-
Martin Vidner
-
Stefan Hundhammer