mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-21 07:50:16 +00:00
Tooltip增加crossLabel显示十字准星指示器
This commit is contained in:
@@ -46,6 +46,8 @@ namespace XCharts
|
||||
SerializedProperty m_TooltipBackgroundColor = prop.FindPropertyRelative("m_TooltipBackgroundColor");
|
||||
SerializedProperty m_TooltipFlagAreaColor = prop.FindPropertyRelative("m_TooltipFlagAreaColor");
|
||||
SerializedProperty m_TooltipTextColor = prop.FindPropertyRelative("m_TooltipTextColor");
|
||||
SerializedProperty m_TooltipLabelColor = prop.FindPropertyRelative("m_TooltipLabelColor");
|
||||
SerializedProperty m_TooltipLineColor = prop.FindPropertyRelative("m_TooltipLineColor");
|
||||
SerializedProperty m_ColorPalette = prop.FindPropertyRelative("m_ColorPalette");
|
||||
|
||||
++EditorGUI.indentLevel;
|
||||
@@ -73,6 +75,10 @@ namespace XCharts
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_TooltipTextColor);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_TooltipLabelColor);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
EditorGUI.PropertyField(drawRect, m_TooltipLineColor);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
|
||||
m_ColorPaletteFoldout = EditorGUI.Foldout(drawRect, m_ColorPaletteFoldout, "ColorPalette");
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
@@ -94,7 +100,7 @@ namespace XCharts
|
||||
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
float height = 0;
|
||||
int propertyCount = 12;
|
||||
int propertyCount = 14;
|
||||
if (m_ColorPaletteFoldout)
|
||||
{
|
||||
SerializedProperty m_ColorPalette = prop.FindPropertyRelative("m_ColorPalette");
|
||||
|
||||
@@ -14,13 +14,23 @@ namespace XCharts
|
||||
Rect drawRect = pos;
|
||||
drawRect.height = EditorGUIUtility.singleLineHeight;
|
||||
SerializedProperty show = prop.FindPropertyRelative("m_Show");
|
||||
SerializedProperty crossLabel = prop.FindPropertyRelative("m_CrossLabel");
|
||||
|
||||
ChartEditorHelper.MakeFoldout(ref drawRect, ref m_TooltipModuleToggle, "Tooltip", show);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
if (m_TooltipModuleToggle)
|
||||
{
|
||||
EditorGUI.PropertyField(drawRect, crossLabel);
|
||||
drawRect.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
}
|
||||
}
|
||||
|
||||
public override float GetPropertyHeight(SerializedProperty prop, GUIContent label)
|
||||
{
|
||||
return 1 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
|
||||
if(m_TooltipModuleToggle)
|
||||
return 2 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
|
||||
else
|
||||
return 1 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user