浏览代码

Small UI fixes to match new Skin

/main
Thomas ICHÉ 5 年前
当前提交
0014f3ed
共有 4 个文件被更改,包括 35 次插入34 次删除
  1. 4
      Editor/Utility/Splitter.cs
  2. 59
      ImageSequencer/Editor/ImageSequencer.GUI.cs
  3. 4
      ImageSequencer/Editor/ImageSequencer.Processors.cs
  4. 2
      ImageSequencer/Editor/ImageSequencer.Styles.cs

4
Editor/Utility/Splitter.cs


}
RectOffset o = new RectOffset(7, 8, 0, 0);
EditorGUI.DrawRect(o.Remove(resizeActiveArea), new Color(0,0,0,1.0f));
EditorGUI.DrawRect(o.Remove(resizeActiveArea), new Color(0,0,0,0.5f));
}
}

59
ImageSequencer/Editor/ImageSequencer.GUI.cs


if(m_PreviewCanvas == null)
{
m_PreviewCanvas = new ImageSequencerCanvas(new Rect(0, 16, position.width - m_Splitter.value, position.height - 16),this);
m_PreviewCanvas = new ImageSequencerCanvas(new Rect(0, Styles.ToolbarHeight, position.width - m_Splitter.value, position.height - Styles.ToolbarHeight),this);
}
CheckGraphicsSettings();

InitializeGUI();
if(m_CurrentAsset == null)
if(m_CurrentAsset == null)
{
OnNoAssetGUI();

private void DrawToolbar()
{
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar))
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar, GUILayout.Height(Styles.ToolbarHeight)))
{
EditorGUI.BeginChangeCheck();
bool prev;

bool bMaskRGB = bMaskR && bMaskG && bMaskB;
//GUILayout.Space(m_Splitter.value);
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar, GUILayout.Width(m_Splitter.value)))
using (new EditorGUILayout.HorizontalScope(EditorStyles.toolbar, GUILayout.Width(m_Splitter.value-1)))
{
if (GUILayout.Button(VFXToolboxGUIUtility.Get("Current Sequence: "+m_CurrentAsset.name), EditorStyles.toolbarButton))
{

}
prev = bMaskR;
bMaskR = GUILayout.Toggle(bMaskR, VFXToolboxGUIUtility.Get("R"),styles.MaskRToggle);
bMaskR = GUILayout.Toggle(bMaskR, VFXToolboxGUIUtility.Get("R"),styles.MaskRToggle, GUILayout.Width(20));
bMaskG = GUILayout.Toggle(bMaskG, VFXToolboxGUIUtility.Get("G"),styles.MaskGToggle);
bMaskG = GUILayout.Toggle(bMaskG, VFXToolboxGUIUtility.Get("G"),styles.MaskGToggle, GUILayout.Width(20));
bMaskB = GUILayout.Toggle(bMaskB, VFXToolboxGUIUtility.Get("B"),styles.MaskBToggle);
bMaskB = GUILayout.Toggle(bMaskB, VFXToolboxGUIUtility.Get("B"),styles.MaskBToggle, GUILayout.Width(20));
bMaskA = GUILayout.Toggle(bMaskA, VFXToolboxGUIUtility.Get("A"),styles.MaskAToggle);
bMaskA = GUILayout.Toggle(bMaskA, VFXToolboxGUIUtility.Get("A"),styles.MaskAToggle, GUILayout.Width(20));
if (bMaskA != prev)
m_PreviewCanvas.maskA = bMaskA;

Rect mipRect = GUILayoutUtility.GetRect(164, 24);
GUI.Box(mipRect, GUIContent.none, VFXToolboxStyles.toolbarButton);
GUI.Label(new RectOffset(0, 0, 0, 0).Remove(mipRect), styles.iconMipMapDown);
newMip = (int)Mathf.Round(GUI.HorizontalSlider(new RectOffset(24,64,0,0).Remove(mipRect), (float)newMip, 0.0f, (float)m_PreviewCanvas.mipMapCount-1));
GUI.Label(new RectOffset(100, 0, 0, 0).Remove(mipRect), styles.iconMipMapUp);
GUI.Label(new RectOffset(0, 0, -6, 0).Remove(mipRect), styles.iconMipMapDown);
newMip = (int)Mathf.Round(GUI.HorizontalSlider(new RectOffset(24,64,1,0).Remove(mipRect), (float)newMip, 0.0f, (float)m_PreviewCanvas.mipMapCount-1));
GUI.Label(new RectOffset(100, 0, -6, 0).Remove(mipRect), styles.iconMipMapUp);
GUI.Label(new RectOffset(124, 0, 0, 0).Remove(mipRect), (m_PreviewCanvas.mipMap+1)+"/"+m_PreviewCanvas.mipMapCount, VFXToolboxStyles.toolbarLabelLeft);
GUI.Label(new RectOffset(124, 0, 3, 0).Remove(mipRect), (m_PreviewCanvas.mipMap+1)+"/"+m_PreviewCanvas.mipMapCount, VFXToolboxStyles.toolbarLabelLeft);
}
}
}

{
Rect brightnessRect = GUILayoutUtility.GetRect(160, 24);
GUI.Box(brightnessRect, GUIContent.none, VFXToolboxStyles.toolbarButton);
GUI.Label(new RectOffset(4, 0, 0, 0).Remove(brightnessRect), VFXToolboxGUIUtility.GetTextAndIcon("Background|Sets the Background Brightness", "CheckerFloor"), VFXToolboxStyles.toolbarLabelLeft);
GUI.Label(new RectOffset(4, 0, 2, 0).Remove(brightnessRect), VFXToolboxGUIUtility.GetTextAndIcon("Background|Sets the Background Brightness", "CheckerFloor"), VFXToolboxStyles.toolbarLabelLeft);
float newBrightness = GUI.HorizontalSlider(new RectOffset(82, 4, 0, 0).Remove(brightnessRect), previewCanvas.BackgroundBrightness, 0.0f, 1.0f);
float newBrightness = GUI.HorizontalSlider(new RectOffset(82, 6, 1, 0).Remove(brightnessRect), previewCanvas.BackgroundBrightness, 0.0f, 1.0f);
if (previewCanvas.BackgroundBrightness != newBrightness)
previewCanvas.BackgroundBrightness = newBrightness;
}

{
if (previewCanvas.sequence.length > 1)
previewCanvas.displayRect = new Rect(m_Splitter.value, 16, position.width - m_Splitter.value, position.height - 116);
previewCanvas.displayRect = new Rect(m_Splitter.value, Styles.ToolbarHeight, position.width - m_Splitter.value, position.height - 100 - Styles.ToolbarHeight);
previewCanvas.displayRect = new Rect(m_Splitter.value, 16, position.width - m_Splitter.value, position.height - 16);
previewCanvas.displayRect = new Rect(m_Splitter.value, Styles.ToolbarHeight, position.width - m_Splitter.value, position.height - Styles.ToolbarHeight);
previewCanvas.OnGUI(this);

Rect exportButtonRect = new Rect(position.width - 100, 24, 74, 24);
Rect exportButtonRect = new Rect(position.width - 100, Styles.ToolbarHeight + 12, 74, 24);
if (GUI.Button(exportButtonRect, VFXToolboxGUIUtility.GetTextAndIcon("Update", "SaveActive"), VFXToolboxStyles.TabButtonSingle))
{
UpdateExportedAssets();

private void UpdateCanvasRect()
{
previewCanvas.displayRect = new Rect(m_Splitter.value, 16, position.width - m_Splitter.value, position.height - 16 );
previewCanvas.displayRect = new Rect(m_Splitter.value, Styles.ToolbarHeight , position.width - m_Splitter.value, position.height - Styles.ToolbarHeight);
}
public void Invalidate()

public override Vector2 GetWindowSize()
{
return new Vector2(200, 292);
return new Vector2(200, 300);
}
public override void OnGUI(Rect rect)

}
}
/*
if(GUILayout.Button(VFXToolboxGUIUtility.Get("Documentation"),s_Styles.menuItem))
if(GUILayout.Button(VFXToolboxGUIUtility.Get("GitHub Repository"),s_Styles.menuItem))
Application.OpenURL("https://drive.google.com/open?id=1YUwzA1mGvzWRpajDV-XF0iUd4RhW--bhMpqo-gmj9B8");
}
if(GUILayout.Button(VFXToolboxGUIUtility.Get("Forums (for Feedback)"),s_Styles.menuItem))
{
Application.OpenURL("https://forum.unity3d.com/forums/vfx-toolbox.119/");
Application.OpenURL("https://github.com/Unity-Technologies/VFXToolbox");
*/
if(EditorGUI.EndChangeCheck())
{

private class Styles
{
public readonly GUIStyle menuItem = (GUIStyle)"MenuItem";
public readonly GUIStyle separator = (GUIStyle)"sv_iconselector_sep";
public readonly GUIStyle menuItem;
public readonly GUIStyle separator;
public Styles()
{
menuItem = new GUIStyle((GUIStyle)"MenuItem");
menuItem.fixedHeight += 2;
separator = new GUIStyle((GUIStyle)"sv_iconselector_sep");
}
}
}

4
ImageSequencer/Editor/ImageSequencer.Processors.cs


{
Rect toggle_rect = new Rect(rect.x + 4, rect.y, 16, rect.height);
Rect label_rect = new Rect(rect.x + 24, rect.y, rect.width - 24, rect.height);
Rect view_rect = new Rect(rect.x + rect.width - 37, rect.y, 19, 18);
Rect lock_rect = new Rect(rect.x + rect.width - 16, rect.y+1, 16, 14);
Rect view_rect = new Rect(rect.x + rect.width - 37, rect.y+2, 16, 16);
Rect lock_rect = new Rect(rect.x + rect.width - 16, rect.y+2, 16, 14);
bool enabled = GUI.Toggle(toggle_rect, m_processorStack.processors[index].Enabled,"");
if(enabled != m_processorStack.processors[index].Enabled)

2
ImageSequencer/Editor/ImageSequencer.Styles.cs


public class Styles
{
public const int ToolbarHeight = 21;
public GUIStyle scrollView;
public GUIStyle playbackControlWindow;

正在加载...
取消
保存