private void DrawToolbar(ref Rect contentRect) { #if UNITY_2019_3_OR_NEWER var toolbarSize = 22; #else var toolbarSize = 18; #endif contentRect.y += toolbarSize; contentRect.height -= toolbarSize; GUILayout.BeginArea(new Rect(0, 0, contentRect.width, toolbarSize)); EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); var clearButton = GUILayout.Button(_clearContent, EditorStyles.toolbarButton, GUILayout.Height(45f)); GUILayout.Space(5f); ShowReceived = GUILayout.Toggle(ShowReceived, _recevedContent, EditorStyles.toolbarButton); ShowTransmitted = GUILayout.Toggle(ShowTransmitted, _transmittedContent, EditorStyles.toolbarButton); GUILayout.FlexibleSpace(); GUILayout.Space(5f); _filterDrawer.Draw(); GUILayout.Space(5f); TrackLast = GUILayout.Toggle(TrackLast, _trackLastContent, EditorStyles.toolbarButton); GUILayout.Space(5f); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); GUILayout.EndArea(); if (clearButton) { OSCWindowConsole.Clear(); SelectedMessage = null; } }
private void DrawToolbar(Rect contentRect) { GUILayout.BeginArea(new Rect(0, 0, contentRect.width, 18)); EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); var clearButton = GUILayout.Button(_clearContent, EditorStyles.toolbarButton, GUILayout.Height(45f)); GUILayout.Space(5f); _showReceived = GUILayout.Toggle(_showReceived, _recevedContent, EditorStyles.toolbarButton); _showTransmitted = GUILayout.Toggle(_showTransmitted, _transmittedContent, EditorStyles.toolbarButton); GUILayout.FlexibleSpace(); GUILayout.Space(5f); //GUILayout.Label(_filterContent); _filterDrawer.Draw(); GUILayout.Space(5f); _trackLast = GUILayout.Toggle(_trackLast, _trackLastContent, EditorStyles.toolbarButton); GUILayout.Space(5f); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); GUILayout.EndArea(); if (clearButton) { OSCWindowConsole.Clear(); _selectedMessage = null; } }