[yast-commit] r42765 - in /trunk/core: VERSION libyui/src/YCPDialogParser.cc libyui/src/YCPDialogParser.h package/yast2-core.changes
Author: sh-sh-sh Date: Thu Dec 6 16:34:22 2007 New Revision: 42765 URL: http://svn.opensuse.org/viewcvs/yast?rev=42765&view=rev Log: Added bug compatibility mode for TextEntry: TextEntry() is treated as InputField(`opt(`hstretch)) Modified: trunk/core/VERSION trunk/core/libyui/src/YCPDialogParser.cc trunk/core/libyui/src/YCPDialogParser.h trunk/core/package/yast2-core.changes Modified: trunk/core/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/VERSION?rev=42765&r1=42764&r2=42765&view=diff ============================================================================== --- trunk/core/VERSION (original) +++ trunk/core/VERSION Thu Dec 6 16:34:22 2007 @@ -1 +1 @@ -2.16.13 +2.16.14 Modified: trunk/core/libyui/src/YCPDialogParser.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCPDialogParser.cc?rev=42765&r1=42764&r2=42765&view=diff ============================================================================== --- trunk/core/libyui/src/YCPDialogParser.cc (original) +++ trunk/core/libyui/src/YCPDialogParser.cc Thu Dec 6 16:34:22 2007 @@ -252,7 +252,7 @@ else if ( s == YUIWidget_Right ) w = parseAlignment ( p, opt, term, ol, n, YAlignEnd, YAlignUnchanged ); else if ( s == YUIWidget_SelectionBox ) w = parseSelectionBox ( p, opt, term, ol, n ); else if ( s == YUIWidget_Table ) w = parseTable ( p, opt, term, ol, n ); - else if ( s == YUIWidget_TextEntry ) w = parseInputField ( p, opt, term, ol, n, false ); + else if ( s == YUIWidget_TextEntry ) w = parseInputField ( p, opt, term, ol, n, false, true ); // bugCompatibilityMode else if ( s == YUIWidget_Top ) w = parseAlignment ( p, opt, term, ol, n, YAlignUnchanged, YAlignBegin ); else if ( s == YUIWidget_Tree ) w = parseTree ( p, opt, term, ol, n ); else if ( s == YUIWidget_VBox ) w = parseLayoutBox ( p, opt, term, ol, n, YD_VERT ); @@ -1551,13 +1551,23 @@ * @note You can and should set a keyboard shortcut within the * label. When the user presses the hotkey, the corresponding text entry widget * will get the keyboard focus. + * + * @note Bug compatibility mode: If used as TextEntry(), `opt(`hstretch) + * is automatically added (with a warning in the log about that fact) + * to avoid destroying dialogs written before fixing a geometry bug + * in the widget. The bug had caused all TextEntry widgets to be + * horizontally stretchable, so they consumed all the horizontal + * space they could get, typically making them as wide as the dialog. + * When used with the new name InputField(), they use a reasonable + * default width. You can still add `opt(`hstretch), of course. **/ YWidget * YCPDialogParser::parseInputField( YWidget * parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList, int argnr, - bool passwordMode ) + bool passwordMode, bool bugCompatibilityMode ) { + static bool postedBugCompatibilityWarning = false; if ( term->size() - argnr < 1 || term->size() - argnr > 2 || !term->value(argnr)->isString() @@ -1590,6 +1600,28 @@ if ( shrinkable ) inputField->setShrinkable(); + else if ( bugCompatibilityMode ) + { + inputField->setStretchable( YD_HORIZ, true ); + + if ( ! postedBugCompatibilityWarning ) + { + y2warning( "\n" + "\nUsing `TextEntry() in bug compatibiltiy mode." + "\nThis is equivalent to `InputField(`opt(`hstretch), ...)." + "\nThis makes the field grab as much space horizontally as it can get," + "\ntypically making it stretch across the entire width of the dialog." + "\nWithout this hstretch, the field will take a reasonable default width." + "\n" + "\nIf this `hstretch is really desired, please use `InputField(`opt(`hstretch), ...)." + "\nIf it is not, please use `InputField() without `hstretch." + "\n\n" + ); + + postedBugCompatibilityWarning = true; + } + } + return inputField; } @@ -3211,7 +3243,7 @@ nextButtonLabel, wizardMode ); YUI_CHECK_NEW( wizard ); - + // All wizard widgets have a fixed ID `wizard YWidgetID * wizardId = new YCPValueWidgetID( YCPSymbol( YWizardID ) ); wizard->setId( wizardId ); Modified: trunk/core/libyui/src/YCPDialogParser.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCPDialogParser.h?rev=42765&r1=42764&r2=42765&view=diff ============================================================================== --- trunk/core/libyui/src/YCPDialogParser.h (original) +++ trunk/core/libyui/src/YCPDialogParser.h Thu Dec 6 16:34:22 2007 @@ -197,7 +197,7 @@ **/ static YWidget * parseInputField( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList, int argnr, - bool passwordMode ); + bool passwordMode, bool bugCompatibilityMode = false ); static YWidget * parseMultiLineEdit( YWidget *parent, YWidgetOpt & opt, const YCPTerm & term, const YCPList & optList, int argnr ); Modified: trunk/core/package/yast2-core.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?rev=42765&r1=42764&r2=42765&view=diff ============================================================================== --- trunk/core/package/yast2-core.changes (original) +++ trunk/core/package/yast2-core.changes Thu Dec 6 16:34:22 2007 @@ -1,4 +1,15 @@ ------------------------------------------------------------------- +Thu Dec 6 16:28:04 CET 2007 - sh@suse.de + +- Fixed bug #345819 (input fields too small): + Introduced bug compatibility mode for TextEntry widget; + when used with the old name `TextEntry(), `opt(`hstretch) + is automatically assumed; with the new name `InputField() it + behaves like specified. + +- V 2.16.14 + +------------------------------------------------------------------- Wed Dec 5 14:42:32 CET 2007 - sh@suse.de - Fixed YMenuEvent( string ) handling: -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
sh-sh-sh@svn.opensuse.org