Author: locilka Date: Mon Dec 3 17:31:38 2007 New Revision: 42626 URL: http://svn.opensuse.org/viewcvs/yast?rev=42626&view=rev Log: Fixed ID handling More examples Modified: trunk/yast2/library/modules/Icon.ycp Modified: trunk/yast2/library/modules/Icon.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/modules/Icon.ycp?rev=42626&r1=42625&r2=42626&view=diff ============================================================================== --- trunk/yast2/library/modules/Icon.ycp (original) +++ trunk/yast2/library/modules/Icon.ycp Mon Dec 3 17:31:38 2007 @@ -70,8 +70,15 @@ * "margin_right" : 5, // HSpacing on the right * ] * - * @example Icon::Image ("warning", $["id":`my_warning, "label":_("My Warning")]) - * -> + * @example + * Icon::Image ("warning", $["id":`my_warning, "label":_("My Warning")]) + * -> `Image (`id (`my_warning), "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_warning.png", "My Warning") + * Icon::Image ("info", $["margin_left":1, "margin_right":2]) + * -> `HBox ( + * `HSpacing (1), + * `Image (`id ("icon_id_info"), "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_info.png", "info"), + * `HSpacing (2) + * ) */ global term Image (string icon_type, map <string, any> options) { LazyInit(); @@ -79,7 +86,9 @@ if (! has_image_support) return `Empty(); - any icon_id = options["id"]:sformat ("icon_id_%1", icon_type); + any icon_id = options["id"]:nil; + if (icon_id == nil) icon_id = sformat ("icon_id_%1", icon_type); + string icon_label = options["label"]:icon_type; term ret = nil; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org