Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_node.py')
-rw-r--r--release/scripts/startup/bl_ui/space_node.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 1b6baa7d3d9..7c9c47f8eb8 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -21,6 +21,7 @@ import bpy
import nodeitems_utils
from bpy.types import Header, Menu, Panel
from bpy.app.translations import pgettext_iface as iface_
+from bl_operators.presets import PresetMenu
from .properties_grease_pencil_common import (
GreasePencilDrawingToolsPanel,
GreasePencilStrokeEditPanel,
@@ -289,12 +290,12 @@ class NODE_MT_node(Menu):
layout.operator("node.read_fullsamplelayers")
-class NODE_MT_node_color_presets(Menu):
+class NODE_MT_node_color_presets(PresetMenu):
"""Predefined node color"""
bl_label = "Color Presets"
preset_subdir = "node_color"
preset_operator = "script.execute_preset"
- draw = Menu.draw_preset
+ preset_add_operator = "node.node_color_preset_add"
class NODE_MT_node_color_specials(Menu):
@@ -373,6 +374,9 @@ class NODE_PT_active_node_color(Panel):
node = context.active_node
self.layout.prop(node, "use_custom_color", text="")
+ def draw_header_preset(self, context):
+ NODE_MT_node_color_presets.draw_panel_header(self.layout)
+
def draw(self, context):
layout = self.layout
node = context.active_node
@@ -380,13 +384,8 @@ class NODE_PT_active_node_color(Panel):
layout.enabled = node.use_custom_color
row = layout.row()
- col = row.column()
- col.menu("NODE_MT_node_color_presets")
- col.prop(node, "color", text="")
- col = row.column(align=True)
- col.operator("node.node_color_preset_add", text="", icon='ZOOMIN').remove_active = False
- col.operator("node.node_color_preset_add", text="", icon='ZOOMOUT').remove_active = True
- col.menu("NODE_MT_node_color_specials", text="", icon='DOWNARROW_HLT')
+ row.prop(node, "color", text="")
+ row.menu("NODE_MT_node_color_specials", text="", icon='DOWNARROW_HLT')
class NODE_PT_active_node_properties(Panel):