• S sverchok
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 148
    • Задачи 148
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 21
    • Запросы на слияние 21
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • nikitronn
  • sverchok
  • Запросы на слияние
  • !1242

Custom icons support

  • Ревью изменений

  • Скачать
  • Почтовые патчи
  • Простое отличие
Слиты nikitronn запросил слияние github/fork/DolphinDream/customIcons в master Фев 18, 2017
  • Обзор 69
  • Коммиты 14
  • Конвейеры 0
  • Изменения 8

Created by: DolphinDream

Started adding custom icon support.

Currently the implementation expects the icons to be stored in the ui/icons folder and be given in sv_icon_name.png format. An icon filename in this folder is converted/uppercased into icon string ID SV_ICON_NAME, which then can be used in sv modules wherever the nodes/props need to add a custom icon.

As suggested by @zeffii I added support to nodeview_space_menu.py to handle a new bl_icon2 attribute that a custom node can specify to declare a custom icon. These custom icons will be displayed in the search menu. (see commit comments for more details). If a node declares bl_icon attribute, this icon is used in the search menu, otherwise, if bl_icon2 is given, the custom icon is used instead.

Note: there’s no need to specify both bl_icon and bl_icon2, but if bl_icon2 is also specified, it takes precedence over the bl_icon.

class SvMixNumbersNode(bpy.types.Node, SverchCustomTreeNode):
    ''' Mix Numbers '''
    bl_idname = 'SvMixNumbersNode'
    bl_label = 'Mix Numbers'
    bl_icon2 = ‘SV_MIX_NUMBER'

To add custom icons to various UI properties, this is done by adding the attribute icon_value=customIcon(“CUSTOM_ICON_ID”) to the property:

layout.prop(self, “floatValue”, text=“Float value”, icon_value=customIcon(“SV_FLOAT”))

Of course, to use custom icons in a module you need to include the custom icon module:

from sverchok.ui.sv_icons import customIcon

sv-customicon-example2

Ответственный
Назначить
Проверяющие
Запросить ревью
Оценка трудозатрат
Исходная ветка: github/fork/DolphinDream/customIcons