Resizeable changelog (#19272)

This commit is contained in:
y7o4ka
2023-09-23 05:35:53 +03:00
committed by GitHub
parent b7cff81587
commit dbd21f1295
2 changed files with 14 additions and 26 deletions

View File

@@ -2,6 +2,7 @@ using System.Linq;
using System.Numerics;
using Content.Client.Resources;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Content.Shared.Administration;
using JetBrains.Annotations;
@@ -9,7 +10,6 @@ using Robust.Client.AutoGenerated;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Console;
using Robust.Shared.Utility;
@@ -19,18 +19,16 @@ using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.Changelog
{
[GenerateTypedNameReferences]
public sealed partial class ChangelogWindow : BaseWindow
public sealed partial class ChangelogWindow : FancyWindow
{
[Dependency] private readonly ChangelogManager _changelog = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!;
public ChangelogWindow()
{
IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this);
WindowTitle.AddStyleClass(StyleBase.StyleClassLabelHeading);
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;
CloseButton.OnPressed += _ => Close();
}
protected override void Opened()
@@ -72,7 +70,7 @@ namespace Content.Client.Changelog
ChangelogBody.AddChild(new Label
{
Text = dayNice,
StyleClasses = {"LabelHeading"},
StyleClasses = { StyleBase.StyleClassLabelHeading },
Margin = new Thickness(4, 6, 0, 0)
});
@@ -84,7 +82,7 @@ namespace Content.Client.Changelog
if (!first)
{
ChangelogBody.AddChild(new Control {Margin = new Thickness(4)});
ChangelogBody.AddChild(new Control { Margin = new Thickness(4) });
}
if (read && !hasRead)
@@ -131,7 +129,7 @@ namespace Content.Client.Changelog
};
readDivider.AddChild(hBox);
readDivider.AddChild(new PanelContainer {StyleClasses = {"LowDivider"}});
readDivider.AddChild(new PanelContainer { StyleClasses = { StyleBase.ClassLowDivider } });
ChangelogBody.AddChild(readDivider);
if (first)
@@ -190,11 +188,6 @@ namespace Content.Client.Changelog
ModulateSelfOverride = Color.FromHex(color)
};
}
protected override DragMode GetDragModeFor(Vector2 relativeMousePos)
{
return DragMode.Move;
}
}
[UsedImplicitly, AnyCommand]