mirror of
https://github.com/XCharts-Team/XCharts.git
synced 2026-05-24 09:50:15 +00:00
修复Title的textStyle和subTextStyle无效的问题
This commit is contained in:
34
Runtime/Helper/TitleHelper.cs
Normal file
34
Runtime/Helper/TitleHelper.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
/******************************************/
|
||||
/* */
|
||||
/* Copyright (c) 2018 monitor1394 */
|
||||
/* https://github.com/monitor1394 */
|
||||
/* */
|
||||
/******************************************/
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace XCharts
|
||||
{
|
||||
internal static class TitleHelper
|
||||
{
|
||||
public static Font GetTextFont(Title title, ThemeInfo themeInfo)
|
||||
{
|
||||
return (title.textStyle.font != null) ? title.textStyle.font : themeInfo.font;
|
||||
}
|
||||
|
||||
public static Color GetTextColor(Title title, ThemeInfo themeInfo)
|
||||
{
|
||||
return title.textStyle.color != Color.clear ? title.textStyle.color : (Color)themeInfo.titleTextColor;
|
||||
}
|
||||
|
||||
public static Font GetSubTextFont(Title title, ThemeInfo themeInfo)
|
||||
{
|
||||
return (title.subTextStyle.font != null) ? title.subTextStyle.font : themeInfo.font;
|
||||
}
|
||||
|
||||
public static Color GetSubTextColor(Title title, ThemeInfo themeInfo)
|
||||
{
|
||||
return title.subTextStyle.color != Color.clear ? title.subTextStyle.color : (Color)themeInfo.titleSubTextColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Runtime/Helper/TitleHelper.cs.meta
Normal file
11
Runtime/Helper/TitleHelper.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8c96205317b864d6c8c08ec45c27933c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user