mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-22 17:00:08 +00:00
增加Theme的Unbind按钮用于解绑复制图表时的主题 #118
This commit is contained in:
@@ -29,12 +29,12 @@ namespace XCharts
|
||||
base.OnGUI(pos, prop, label);
|
||||
var defaultWidth = pos.width;
|
||||
var defaultX = pos.x;
|
||||
var btnWidth = 45;
|
||||
var btnWidth = 50;
|
||||
ChartEditorHelper.MakeFoldout(ref m_DrawRect, ref m_ThemeModuleToggle, "Theme");
|
||||
m_Heights[m_KeyName] += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing;
|
||||
if (m_ThemeModuleToggle)
|
||||
{
|
||||
m_DrawRect.x = defaultX + defaultWidth - 2 * btnWidth - 2;
|
||||
m_DrawRect.x = defaultX + defaultWidth - 3 * btnWidth - 2;
|
||||
m_DrawRect.width = btnWidth;
|
||||
var chart = prop.serializedObject.targetObject as BaseChart;
|
||||
var lastFont = chart.theme.font;
|
||||
@@ -46,6 +46,12 @@ namespace XCharts
|
||||
chart.theme.ResetTheme();
|
||||
chart.RefreshAllComponent();
|
||||
}
|
||||
m_DrawRect.x = defaultX + defaultWidth - 2 * btnWidth - 2;
|
||||
m_DrawRect.width = btnWidth;
|
||||
if (GUI.Button(m_DrawRect, new GUIContent("Unbind", "Unbind the Theme from another chart")))
|
||||
{
|
||||
chart.UnbindTheme();
|
||||
}
|
||||
m_DrawRect.x = defaultX + defaultWidth - btnWidth;
|
||||
m_DrawRect.width = btnWidth;
|
||||
if (GUI.Button(m_DrawRect, new GUIContent("Export", "Export theme to asset for a new theme")))
|
||||
|
||||
Reference in New Issue
Block a user