/// <inheritdoc cref="Window.DoWindowContents"/> public override void DoWindowContents(Rect canvas) { Rect tabRect = new Rect(0f, 0f, canvas.width, Text.LineHeight * 2f).Rounded(); var contentRect = new Rect(0f, tabRect.height, canvas.width, canvas.height - tabRect.height); GUI.BeginGroup(canvas); _tabWorker.Draw(tabRect); DrawWindowDecorations(tabRect); GUI.BeginGroup(contentRect); var innerRect = new Rect(0f, 0f, contentRect.width, contentRect.height); if (_dirty) { Rect innerResolution = innerRect.ContractedBy(16f); _itemWorker.NotifyResolutionChanged(innerResolution); _traitWorker.NotifyResolutionChanged(innerResolution); _pawnWorker.NotifyResolutionChanged(innerResolution); _eventWorker.NotifyResolutionChanged(innerResolution); _dirty = false; } _tabWorker.SelectedTab?.Draw(innerRect); GUI.EndGroup(); GUI.EndGroup(); }
/// <inheritdoc cref="ProxySettingsWindow.DrawSettings"/> protected override void DrawSettings(Rect region) { GUI.BeginGroup(region); var tabBarRect = new Rect(0f, 0f, region.width, Text.LineHeight * 2f); var tabPanelRect = new Rect(0f, tabBarRect.height, region.width, region.height - tabBarRect.height); GUI.BeginGroup(tabBarRect); _tabWorker.Draw(tabBarRect.AtZero(), paneled: true); GUI.EndGroup(); GUI.BeginGroup(tabPanelRect); _tabWorker.SelectedTab?.Draw(tabPanelRect.AtZero()); GUI.EndGroup(); GUI.EndGroup(); }