private Rect DrawTitle(Rect rect) { if (Title.NullOrEmpty()) { return(rect); } var header = new ListingPlus(); header.Begin(rect); header.Label(Title, font: GameFont.Medium); if (!string.IsNullOrEmpty(Subtitle)) { var titleSize = GUIPlus.GetTextSize(Title, GUIPlus.GetGameFontStyle(GameFont.Medium)); var titleOffset = titleSize.x + GUIPlus.MediumPadding; var subtitleRect = new Rect(rect.x + titleOffset, rect.y, rect.width - titleOffset, titleSize.y); GUIPlus.DrawText(subtitleRect, Subtitle, style: Theme.SmallTextStyle); } header.GapLine(); header.End(); var contentRect = new Rect(rect.x, rect.y + header.CurHeight, rect.width, rect.height - header.CurHeight); if (doCloseButton) { contentRect.height -= CloseButtonOffset; } return(contentRect); }