schrodinger.ui.qt.standard.icons.icons module

Module to access all Schrodinger standard icons filepaths. Instructions on using, adding, and editing icons can be found below.

Using standard icons

Standard icon filepaths are exposed as constants. To browse the available icons and what constants they correspond to, run:

$SCHRODINGER/run catalog_gui.py

Once an icon of interest has been identified, import icons.py and access the icon’s path. Example:

from schrodinger.ui.qt.standard.icons import icons
from schrodinger.Qt import QtGui
ok_lb_icon = QtGui.QIcon(icons.OK_LB)

Adding standard icons

  1. If the new icon belongs to an existing family (e.g. a new icon state

    variation), skip to step 2.

    If the new icon does not belong to an existing family, add a blank row to the metadata csv (schrodinger/ui/qt/standard/icons/icon_data/icon_data.csv) and fill in the columns.:

    • Action: The action for the icon (UX should provide)

    • Keywords: Any words not already present in Action that would be helpful

      to search for that icon. Should be space-separated. (UX can provide, but devs can also supplement with whatever seems helpful)

    • Directory name: The name of the directory where all icons in this family

      will be stored. This should pretty much be the same as the action in most cases but lowercase and hyphen-separated. (UX won’t provide. Use best judgment to make most concise name possible)

    • Original File Name: Copy/paste the file name that UX gives you. This

      helps map the new filenames to the old ones that UX has in case UX needs to know which is which.

    • Current or Proposed Symbol: What the symbol looks like (Include if UX

      provides, but not essential)

  2. Rename the icon file according to the naming convention outlined below in

    “File structure”. If this is a completely new family of icons, also create the icon subdirectory, as outlined in “File structure”.

  3. Place the icon into the appropriate icon subdirectory.

  4. Run unit tests. If test_get_icon_metadata_from_csv() fails, most likely there is

    misspelling in the metadata csv, the directory name, or the file name.

    Note: after building modules and removing an icon, that icon will NOT be removed from the build directory. That will require being manually removed.

  5. Confirm the icon appears as expected in the icon viewer with the desired

    search terms. If not, edit the metadata csv as needed.

  6. Commit changes.

Editing standard icons

  1. Edit the metadata csv as needed. See 1) from “Adding standard icons” for

    information on each of the csv columns.

  2. Perform 4) - 6) from “Adding standard icons”

File structure

The following must be true in order for this to work properly.

  1. An icon metadata csv must be present at

    schrodinger/ui/qt/standard/icons/icon_data/icon_data.csv.

  2. The first four columns of the CSV must be ‘Variable name’, ‘Action’,

    ‘Keywords’, and ‘Directory name’ in that order. Other columns are ignored, so they can contain other any information helpful to whoever is editing the CSV.

  3. Each row of the CSV corresponds to only the default version of an icon.

  4. The icons directory MUST follow a particular structure:

    - icons
    | - <icon-dir-name-1>
      | - <icon-dir-name-1>_<icon_state_information_1>.png
      | - <icon-dir-name-1>_<icon_state_information_2>.png
      | - ...
      | - <icon-dir-name-1>_<icon_state_information_N>.png
    | - <icon-dir-name-2>
      | - etc.
    
    Note that each icon in an icon subdirectory must have a base name equal
    to the directory name. Dashes are used in place of spaces for the dir name.
    Each icon filename then has additional information denoting its icon state
    and is separated by underscores. This naming convention helps us identify
    the icon family name from just the icon's file name.
    
    Here's an example using the collapse-chevron-vert subdirectory::
    
    | - collapse-chevron-vert
      | - collapse-chevron-vert_db_d.png
      | - collapse-chevron-vert_db_h.png
      | - collapse-chevron-vert_db.png
      | - collapse-chevron-vert_lb_d.png
      | - collapse-chevron-vert_lb_h.png
      | - collapse-chevron-vert_lb.png
    
  5. See LEGEND_TEXT below for a description of the different icon suffixes.

class schrodinger.ui.qt.standard.icons.icons.IconMetadata(*args, _param_type=<object object>, **kwargs)

Bases: schrodinger.models.parameters.CompoundParam

Param to store the metadata for a given icon file.

var_name: str

Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:

class Coord(CompoundParam):
    x: int
    y: int

An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:

coord = Coord()
coord.x = 4

When a Param value is set, the valueChanged signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:

class Atom(CompoundParam):
    coord: Coord
    element: str
action: str

Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:

class Coord(CompoundParam):
    x: int
    y: int

An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:

coord = Coord()
coord.x = 4

When a Param value is set, the valueChanged signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:

class Atom(CompoundParam):
    coord: Coord
    element: str
filepath: str

Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:

class Coord(CompoundParam):
    x: int
    y: int

An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:

coord = Coord()
coord.x = 4

When a Param value is set, the valueChanged signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:

class Atom(CompoundParam):
    coord: Coord
    element: str
filter_terms: str

Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:

class Coord(CompoundParam):
    x: int
    y: int

An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:

coord = Coord()
coord.x = 4

When a Param value is set, the valueChanged signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:

class Atom(CompoundParam):
    coord: Coord
    element: str
actionChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

actionReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

filepathChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

filepathReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

filter_termsChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

filter_termsReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

var_nameChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

var_nameReplaced

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

schrodinger.ui.qt.standard.icons.icons.get_icon_metadata_from_csv()

Get the icon metadata for all icons files in the icons dir from _ICON_DATA_CSV. Results are stored in a module-level dictionary mapping variable names to the corresponding IconMetadata object.

If the module-level dictionary has already been populated, simply return it without reading the metadata csv again.

Returns

Mapping of icon variable names to their IconMetadata objects

Return type

dict(str: IconMetadata)