mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-18 14:30:10 +00:00
[improve][editor] improve editor edit
This commit is contained in:
@@ -12,8 +12,9 @@ namespace XCharts.Editor
|
||||
{
|
||||
static class Styles
|
||||
{
|
||||
internal static GUIContent btnReset = new GUIContent("Reset", "Reset to default theme");
|
||||
internal static GUIContent btnSync = new GUIContent("Sync Font", "Sync main theme font to sub theme font");
|
||||
internal static GUIContent btnReset = new GUIContent("Reset to Default", "Reset to default theme");
|
||||
internal static GUIContent btnSyncFontToSubTheme = new GUIContent("Sync Font to Sub Theme", "Sync main theme font to sub theme font");
|
||||
internal static GUIContent btnSyncFontFromSetting = new GUIContent("Sync Font from Setting", "Sync main theme font and sub theme font from XCSetting font");
|
||||
}
|
||||
|
||||
private Theme m_Theme;
|
||||
@@ -28,11 +29,35 @@ namespace XCharts.Editor
|
||||
base.OnInspectorGUI();
|
||||
if (GUILayout.Button(Styles.btnReset))
|
||||
{
|
||||
m_Theme.ResetTheme();
|
||||
if (EditorUtility.DisplayDialog(Styles.btnReset.text, Styles.btnReset.tooltip, "Yes", "Cancel"))
|
||||
{
|
||||
m_Theme.ResetTheme();
|
||||
Debug.Log("XCharts: Reset Finish.");
|
||||
}
|
||||
}
|
||||
if (GUILayout.Button(Styles.btnSync))
|
||||
if (GUILayout.Button(Styles.btnSyncFontFromSetting))
|
||||
{
|
||||
m_Theme.SyncFontToSubComponent();
|
||||
if (EditorUtility.DisplayDialog(Styles.btnSyncFontFromSetting.text, Styles.btnSyncFontFromSetting.tooltip, "Yes", "Cancel"))
|
||||
{
|
||||
m_Theme.common.font = XCSettings.font;
|
||||
m_Theme.SyncFontToSubComponent();
|
||||
#if dUI_TextMeshPro
|
||||
m_Theme.common.tmpFont = XCSettings.tmpFont;
|
||||
m_Theme.SyncTMPFontToSubComponent();
|
||||
#endif
|
||||
Debug.Log("XCharts: Sync Finish.");
|
||||
}
|
||||
}
|
||||
if (GUILayout.Button(Styles.btnSyncFontToSubTheme))
|
||||
{
|
||||
if (EditorUtility.DisplayDialog(Styles.btnSyncFontToSubTheme.text, Styles.btnSyncFontToSubTheme.tooltip, "Yes", "Cancel"))
|
||||
{
|
||||
m_Theme.SyncFontToSubComponent();
|
||||
#if dUI_TextMeshPro
|
||||
m_Theme.SyncTMPFontToSubComponent();
|
||||
#endif
|
||||
Debug.Log("XCharts: Sync Finish.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user