93. Icon

Transparent access to Icons

93.1. Authors

  • Lukas Ocilka <lukas.ocilka@suse.cz>

93.2. Summary of Module Globals

List of Global Functions

  • Error - Returns UI term `Image() widget with an error-icon.

  • IconPath - Returns path to an image

  • Image - Returns `Image() term defined by parameters. Returns `Empty() if the current UI doesn't support images.

  • Info - Returns UI term `Image() widget with an info-icon.

  • Simple - Function calls Icon::Image with default options

  • Warning - Returns UI term `Image() widget with a warning-icon.

List of Global Variables

    93.3. Global Functions

    93.3.1. Error

    Returns UI term `Image() widget with an error-icon.

    Return value

    • term - error-icon

    93.3.2. IconPath

    Returns path to an image

    Function parameters

    • string icon_type

    Return value

    • string

    Example 21. 

    	Icon::IconPath ("warning") -> "/usr/share/YaST2/theme/current/icons/32x32/apps/msg_warning.png"


    See also:

    • Icon::Image() for details

    93.3.3. Image

    Returns `Image() term defined by parameters. Returns `Empty() if the current UI doesn't support images.

    Function parameters

    • string icon_type

    • map <string, any> options

    Return value

    • term

    options = $[
       "id" : any_icon_id,
       "label" : (string) icon_label, // (used if icon is missing)
       "margin_left" : 0,  // HSpacing on the left
       "margin_right" : 5, // HSpacing on the right
     ]
    

    Example 22. 

      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)
        )


    93.3.4. Info

    Returns UI term `Image() widget with an info-icon.

    Return value

    • term - info icon

    93.3.5. Simple

    Function calls Icon::Image with default options

    Function parameters

    • string icon_type

    Return value

    • term

    See also:

    • Icon for more information

    93.3.6. Warning

    Returns UI term `Image() widget with a warning-icon.

    Return value

    • term - warning icon

    93.4. Global Variables

    93.5. Module Requirements

    93.5.1. Module Imports

    • Directory

    93.5.2. Module Includes