From 19e7867aba19ad7c0dd7c7364c49058b4b0038e2 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Tue, 31 Dec 2019 18:12:03 +0300 Subject: [PATCH] Make OverlayHeader non-generic --- osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs | 8 ++++++-- osu.Game/Overlays/OverlayHeader.cs | 10 +++------- osu.Game/Overlays/TabControlOverlayHeader.cs | 8 ++++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs b/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs index 10664fc5be..6f9445bd47 100644 --- a/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs +++ b/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs @@ -1,10 +1,14 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Framework.Graphics.UserInterface; + namespace osu.Game.Overlays { - public abstract class BreadcrumbControlOverlayHeader : OverlayHeader + public abstract class BreadcrumbControlOverlayHeader : OverlayHeader { - protected override OverlayHeaderBreadcrumbControl CreateControl() => new OverlayHeaderBreadcrumbControl(); + protected OverlayHeaderBreadcrumbControl TabControl; + + protected override TabControl CreateControl() => TabControl = new OverlayHeaderBreadcrumbControl(); } } diff --git a/osu.Game/Overlays/OverlayHeader.cs b/osu.Game/Overlays/OverlayHeader.cs index 4356c54fdf..7575801aac 100644 --- a/osu.Game/Overlays/OverlayHeader.cs +++ b/osu.Game/Overlays/OverlayHeader.cs @@ -11,12 +11,8 @@ using osuTK.Graphics; namespace osu.Game.Overlays { - /// A control for overlay. - public abstract class OverlayHeader : Container - where TControl : TabControl + public abstract class OverlayHeader : Container { - protected readonly TControl TabControl; - private readonly Box titleBackground; private readonly Box controlBackground; private readonly Container background; @@ -88,7 +84,7 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.Both, Colour = Color4.Gray, }, - TabControl = CreateControl().With(control => control.Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }) + CreateControl().With(control => control.Margin = new MarginPadding { Left = UserProfileOverlay.CONTENT_X_MARGIN }) } }, CreateContent() @@ -103,6 +99,6 @@ namespace osu.Game.Overlays protected abstract ScreenTitle CreateTitle(); - protected abstract TControl CreateControl(); + protected abstract TabControl CreateControl(); } } diff --git a/osu.Game/Overlays/TabControlOverlayHeader.cs b/osu.Game/Overlays/TabControlOverlayHeader.cs index 8570bf63b8..f8683b3e7d 100644 --- a/osu.Game/Overlays/TabControlOverlayHeader.cs +++ b/osu.Game/Overlays/TabControlOverlayHeader.cs @@ -1,10 +1,14 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Framework.Graphics.UserInterface; + namespace osu.Game.Overlays { - public abstract class TabControlOverlayHeader : OverlayHeader + public abstract class TabControlOverlayHeader : OverlayHeader { - protected override OverlayHeaderTabControl CreateControl() => new OverlayHeaderTabControl(); + protected OverlayHeaderTabControl TabControl; + + protected override TabControl CreateControl() => TabControl = new OverlayHeaderTabControl(); } }