mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:43:10 +08:00
update height to max of its parent height
This commit is contained in:
parent
24960c4fb8
commit
bd1454bdd1
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using Markdig.Syntax;
|
using Markdig.Syntax;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
@ -23,6 +24,8 @@ namespace osu.Game.Overlays.Wiki
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; }
|
private OverlayColourProvider colourProvider { get; set; }
|
||||||
|
|
||||||
|
private WikiPanelMarkdownContainer panelContainer;
|
||||||
|
|
||||||
public string Text;
|
public string Text;
|
||||||
|
|
||||||
public bool IsFullWidth;
|
public bool IsFullWidth;
|
||||||
@ -30,7 +33,6 @@ namespace osu.Game.Overlays.Wiki
|
|||||||
public WikiPanelContainer()
|
public WikiPanelContainer()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
|
||||||
Padding = new MarginPadding(3);
|
Padding = new MarginPadding(3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,7 +59,7 @@ namespace osu.Game.Overlays.Wiki
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new WikiPanelMarkdownContainer
|
panelContainer = new WikiPanelMarkdownContainer
|
||||||
{
|
{
|
||||||
Text = Text,
|
Text = Text,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
@ -67,6 +69,12 @@ namespace osu.Game.Overlays.Wiki
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
Height = Math.Max(panelContainer.Height, Parent.DrawHeight);
|
||||||
|
}
|
||||||
|
|
||||||
private class WikiPanelMarkdownContainer : WikiMarkdownContainer
|
private class WikiPanelMarkdownContainer : WikiMarkdownContainer
|
||||||
{
|
{
|
||||||
public bool IsFullWidth;
|
public bool IsFullWidth;
|
||||||
|
Loading…
Reference in New Issue
Block a user