IEnumerator OpenMoreInfoPopup(ReleaseInfo info) { bool isDone = false; var skin = _pmSettings.ReleaseMoreInfoDialog; Vector2 scrollPos = Vector2.zero; var popupId = _view.AddPopup(delegate(Rect fullRect) { var popupRect = ImguiUtil.CenterRectInRect(fullRect, skin.PopupSize); _view.DrawPopupCommon(fullRect, popupRect); var contentRect = ImguiUtil.CreateContentRectWithPadding( popupRect, skin.PanelPadding); GUILayout.BeginArea(contentRect); { GUILayout.Label("Release Info", skin.HeadingStyle); GUILayout.Space(skin.HeadingBottomPadding); scrollPos = GUILayout.BeginScrollView(scrollPos, false, true, GUI.skin.horizontalScrollbar, GUI.skin.verticalScrollbar, skin.ScrollViewStyle, GUILayout.Height(skin.ListHeight)); { GUILayout.Space(skin.ListPaddingTop); PmViewHandlerCommon.AddReleaseInfoMoreInfoRows(info, skin); } GUI.EndScrollView(); } GUILayout.EndArea(); var okButtonRect = new Rect( contentRect.xMin + 0.5f * contentRect.width - 0.5f * skin.OkButtonWidth, contentRect.yMax - skin.MarginBottom - skin.OkButtonHeight, skin.OkButtonWidth, skin.OkButtonHeight); if (GUI.Button(okButtonRect, "Ok") || Event.current.keyCode == KeyCode.Escape) { isDone = true; } }); while (!isDone) { yield return(null); } _view.RemovePopup(popupId); }
IEnumerator OpenMoreInfoPopup(PackageInfo info) { bool isDone = false; var skin = _pmSettings.ReleaseMoreInfoDialog; Vector2 scrollPos = Vector2.zero; var popupId = _view.AddPopup(delegate(Rect fullRect) { var popupRect = ImguiUtil.CenterRectInRect(fullRect, skin.PopupSize); _view.DrawPopupCommon(fullRect, popupRect); var contentRect = ImguiUtil.CreateContentRectWithPadding( popupRect, skin.PanelPadding); var scrollViewRect = new Rect( contentRect.xMin, contentRect.yMin, contentRect.width, contentRect.height - skin.MarginBottom - skin.OkButtonHeight - skin.OkButtonTopPadding); GUILayout.BeginArea(scrollViewRect); { scrollPos = GUILayout.BeginScrollView(scrollPos, false, true, GUI.skin.horizontalScrollbar, GUI.skin.verticalScrollbar, skin.ScrollViewStyle, GUILayout.ExpandHeight(true)); { GUILayout.Space(skin.ListPaddingTop); GUILayout.Label("Package Info", skin.HeadingStyle); GUILayout.Space(skin.HeadingBottomPadding); PmViewHandlerCommon.DrawMoreInfoRow(skin, "Name", info.Name); GUILayout.Space(skin.RowSpacing); PmViewHandlerCommon.DrawMoreInfoRow(skin, "Path", info.Path); GUILayout.Space(skin.RowSpacing); PmViewHandlerCommon.DrawMoreInfoRow(skin, "Creation Date", !string.IsNullOrEmpty(info.InstallInfo.InstallDate) ? info.InstallInfo.InstallDate : PmViewHandlerCommon.NotAvailableLabel); GUILayout.Space(skin.ListPaddingTop); GUILayout.Space(skin.ListPaddingTop); GUILayout.Label("Release Info", skin.HeadingStyle); GUILayout.Space(skin.HeadingBottomPadding); if (string.IsNullOrEmpty(info.InstallInfo.ReleaseInfo.Id)) { GUI.color = skin.ValueStyle.normal.textColor; GUILayout.Label("No release is associated with this package", skin.HeadingStyle); GUI.color = Color.white; } else { PmViewHandlerCommon.AddReleaseInfoMoreInfoRows(info.InstallInfo.ReleaseInfo, skin); } GUILayout.Space(skin.RowSpacing); } GUI.EndScrollView(); } GUILayout.EndArea(); var okButtonRect = new Rect( contentRect.xMin + 0.5f * contentRect.width - 0.5f * skin.OkButtonWidth, contentRect.yMax - skin.MarginBottom - skin.OkButtonHeight, skin.OkButtonWidth, skin.OkButtonHeight); if (GUI.Button(okButtonRect, "Ok") || Event.current.keyCode == KeyCode.Escape) { isDone = true; } }); while (!isDone) { yield return(null); } _view.RemovePopup(popupId); }