void DisplayTaskDeveloper( TodoListTask task ) { string[] options = Window.GetCurrentList().GetDevelopersStringList(); int currentIndex = Window.GetCurrentList().GetDevelopersList().IndexOf( task.Developer ) + 1; GUIStyle popupStyle = new GUIStyle( EditorStyles.popup ); popupStyle.margin.top = 4; int newIndex = EditorGUILayout.Popup( currentIndex, options, popupStyle, GUILayout.Width( GetFieldSize( TodoListFieldTypes.Developer ) - 8 ) ); GUILayout.Space( 4 ); if( newIndex != currentIndex ) { Window.GetCurrentList().OnTaskChanged( task, "Edit Task Developer" ); if( newIndex == 0 ) { task.Developer = "Unassigned"; } else { task.Developer = Window.GetCurrentList().GetDevelopersList()[ newIndex - 1 ]; } task.AddPost( "", "", task.Developer ); } }
void DisplayTaskStatus( TodoListTask task ) { GUILayout.Label( task.Status, GUILayout.Width( GetFieldSize( TodoListFieldTypes.Status ) - 28 ) ); List<string> transitions = Window.GetCurrentList().GetTransitions( task.Status ); transitions.Insert( 0, "" ); GUIStyle popupStyle = new GUIStyle( EditorStyles.popup ); popupStyle.margin.top = 4; popupStyle.margin.right = 8; int selectedIndex = 0; if( transitions.Count > 1 ) { selectedIndex = EditorGUILayout.Popup( 0, transitions.ToArray(), popupStyle, GUILayout.Width( 16 ) ); } else { GUILayout.Space( 24 ); } if( selectedIndex != 0 ) { Window.GetCurrentList().OnTaskChanged( task, "Edit Task Status" ); task.SetCompleted( Window.GetCurrentList().IsStatusFinished( transitions[ selectedIndex ] ) ); task.Status = transitions[ selectedIndex ]; task.AddPost( "", transitions[ selectedIndex ], "" ); } }