Skip to content
Snippets Groups Projects
icons.py 1.13 KiB
Newer Older
  • Learn to ignore specific revisions
  • Oscar Gustafsson's avatar
    Oscar Gustafsson committed
    """B-ASIC icons."""
    
    import qtawesome
    
    ICONS = {
        'save': 'mdi6.content-save',
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        'save-as': 'mdi6.content-save-edit',
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        'undo': 'mdi6.undo',
        'redo': 'mdi6.redo',
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        'new': 'mdi6.file-outline',
        'open': 'mdi6.folder-open',
    
        'import': 'mdi6.import',
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        'legend': 'mdi6.map-legend',
        'close': 'mdi6.close',
        'all': 'mdi6.select-all',
        'none': 'mdi6.select-remove',
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        'new-sfg': 'ph.selection-plus',
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        'plot-schedule': 'mdi6.chart-gantt',
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        'increase-timeresolution': 'ph.clock-clockwise',
        'decrease-timeresolution': 'ph.clock-counter-clockwise',
        'quit': 'ph.power',
        'info': 'ph.info',
        'gitlab': 'ph.gitlab-logo-simple',
        'docs': 'ph.book',
        'about': 'ph.question',
        'keys': 'ph.keyboard',
        'add-operations': 'ph.math-operations',
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        'zoom-to-fit': 'mdi6.fit-to-page',
        'faq': 'mdi6.frequently-asked-questions',
        'sim': 'mdi6.chart-line',
        'reorder': ('msc.graph-left', {'rotated': -90}),
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
    }
    
    
    def get_icon(name):
        """Return icon for given name"""
    
    Oscar Gustafsson's avatar
    Oscar Gustafsson committed
        info = ICONS[name]
        if isinstance(info, str):
            return qtawesome.icon(info)
        return qtawesome.icon(info[0], **info[1])