Resizeable changelog (#19272)
This commit is contained in:
@@ -1,22 +1,17 @@
|
|||||||
<changelog:ChangelogWindow xmlns="https://spacestation14.io"
|
<ui:ChangelogWindow xmlns="https://spacestation14.io"
|
||||||
xmlns:changelog="clr-namespace:Content.Client.Changelog"
|
xmlns:ui="clr-namespace:Content.Client.Changelog"
|
||||||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
|
Title="{Loc 'changelog-window-title'}"
|
||||||
SetSize="500 400" MouseFilter="Stop">
|
MinSize="500 400"
|
||||||
|
SetSize="500 400">
|
||||||
|
|
||||||
<PanelContainer StyleClasses="AngleRect" />
|
<PanelContainer StyleClasses="AngleRect" />
|
||||||
<BoxContainer Orientation="Vertical">
|
<BoxContainer Orientation="Vertical">
|
||||||
<BoxContainer Orientation="Horizontal">
|
|
||||||
<Label Margin="6 0 0 0" HorizontalExpand="True" Text="{Loc 'changelog-window-title'}" VAlign="Center"
|
|
||||||
StyleClasses="LabelHeading" />
|
|
||||||
<TextureButton Margin="0 0 8 0" Name="CloseButton" StyleClasses="windowCloseButton"
|
|
||||||
VerticalAlignment="Center" />
|
|
||||||
</BoxContainer>
|
|
||||||
<controls:HighDivider />
|
|
||||||
|
|
||||||
<ScrollContainer VerticalExpand="True" HScrollEnabled="False">
|
<ScrollContainer Margin="5" VerticalExpand="True" HScrollEnabled="False">
|
||||||
<BoxContainer Orientation="Vertical" Name="ChangelogBody" />
|
<BoxContainer Orientation="Vertical" Name="ChangelogBody" />
|
||||||
</ScrollContainer>
|
</ScrollContainer>
|
||||||
|
|
||||||
<PanelContainer StyleClasses="LowDivider" />
|
<PanelContainer StyleClasses="LowDivider" />
|
||||||
<Label Name="VersionLabel" HorizontalAlignment="Right" StyleClasses="LabelSubText" Margin="4 0" />
|
<Label Name="VersionLabel" HorizontalAlignment="Right" StyleClasses="LabelSubText" Margin="4 0" />
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
</changelog:ChangelogWindow>
|
</ui:ChangelogWindow>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ using System.Linq;
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Content.Client.Resources;
|
using Content.Client.Resources;
|
||||||
using Content.Client.Stylesheets;
|
using Content.Client.Stylesheets;
|
||||||
|
using Content.Client.UserInterface.Controls;
|
||||||
using Content.Client.UserInterface.Systems.EscapeMenu;
|
using Content.Client.UserInterface.Systems.EscapeMenu;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -9,7 +10,6 @@ using Robust.Client.AutoGenerated;
|
|||||||
using Robust.Client.ResourceManagement;
|
using Robust.Client.ResourceManagement;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
|
||||||
using Robust.Client.UserInterface.XAML;
|
using Robust.Client.UserInterface.XAML;
|
||||||
using Robust.Shared.Console;
|
using Robust.Shared.Console;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
@@ -19,18 +19,16 @@ using static Robust.Client.UserInterface.Controls.BoxContainer;
|
|||||||
namespace Content.Client.Changelog
|
namespace Content.Client.Changelog
|
||||||
{
|
{
|
||||||
[GenerateTypedNameReferences]
|
[GenerateTypedNameReferences]
|
||||||
public sealed partial class ChangelogWindow : BaseWindow
|
public sealed partial class ChangelogWindow : FancyWindow
|
||||||
{
|
{
|
||||||
[Dependency] private readonly ChangelogManager _changelog = default!;
|
[Dependency] private readonly ChangelogManager _changelog = default!;
|
||||||
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
[Dependency] private readonly IResourceCache _resourceCache = default!;
|
||||||
|
|
||||||
public ChangelogWindow()
|
public ChangelogWindow()
|
||||||
{
|
{
|
||||||
IoCManager.InjectDependencies(this);
|
|
||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
|
WindowTitle.AddStyleClass(StyleBase.StyleClassLabelHeading);
|
||||||
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;
|
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;
|
||||||
CloseButton.OnPressed += _ => Close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Opened()
|
protected override void Opened()
|
||||||
@@ -72,7 +70,7 @@ namespace Content.Client.Changelog
|
|||||||
ChangelogBody.AddChild(new Label
|
ChangelogBody.AddChild(new Label
|
||||||
{
|
{
|
||||||
Text = dayNice,
|
Text = dayNice,
|
||||||
StyleClasses = {"LabelHeading"},
|
StyleClasses = { StyleBase.StyleClassLabelHeading },
|
||||||
Margin = new Thickness(4, 6, 0, 0)
|
Margin = new Thickness(4, 6, 0, 0)
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -84,7 +82,7 @@ namespace Content.Client.Changelog
|
|||||||
|
|
||||||
if (!first)
|
if (!first)
|
||||||
{
|
{
|
||||||
ChangelogBody.AddChild(new Control {Margin = new Thickness(4)});
|
ChangelogBody.AddChild(new Control { Margin = new Thickness(4) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (read && !hasRead)
|
if (read && !hasRead)
|
||||||
@@ -131,7 +129,7 @@ namespace Content.Client.Changelog
|
|||||||
};
|
};
|
||||||
|
|
||||||
readDivider.AddChild(hBox);
|
readDivider.AddChild(hBox);
|
||||||
readDivider.AddChild(new PanelContainer {StyleClasses = {"LowDivider"}});
|
readDivider.AddChild(new PanelContainer { StyleClasses = { StyleBase.ClassLowDivider } });
|
||||||
ChangelogBody.AddChild(readDivider);
|
ChangelogBody.AddChild(readDivider);
|
||||||
|
|
||||||
if (first)
|
if (first)
|
||||||
@@ -190,11 +188,6 @@ namespace Content.Client.Changelog
|
|||||||
ModulateSelfOverride = Color.FromHex(color)
|
ModulateSelfOverride = Color.FromHex(color)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DragMode GetDragModeFor(Vector2 relativeMousePos)
|
|
||||||
{
|
|
||||||
return DragMode.Move;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[UsedImplicitly, AnyCommand]
|
[UsedImplicitly, AnyCommand]
|
||||||
|
|||||||
Reference in New Issue
Block a user