53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using System.Numerics;
|
|
using Dalamud.Bindings.ImGui;
|
|
using Dalamud.Interface.Utility.Raii;
|
|
using HellionChat.Ui.Components.Settings;
|
|
|
|
namespace HellionChat.Ui.Components.Settings.Tabs;
|
|
|
|
internal sealed class AppearanceTab
|
|
{
|
|
private readonly ThemePicker _picker;
|
|
private readonly ColorPicker _color;
|
|
private readonly LivePreviewPanel _preview;
|
|
private readonly ThemeImportExportRow _importExport;
|
|
private readonly FontsSection _fonts;
|
|
|
|
public AppearanceTab(
|
|
ThemePicker picker,
|
|
ColorPicker color,
|
|
LivePreviewPanel preview,
|
|
ThemeImportExportRow importExport,
|
|
FontsSection fonts
|
|
)
|
|
{
|
|
_picker = picker;
|
|
_color = color;
|
|
_preview = preview;
|
|
_importExport = importExport;
|
|
_fonts = fonts;
|
|
}
|
|
|
|
public void Draw()
|
|
{
|
|
var availableX = ImGui.GetContentRegionAvail().X;
|
|
var leftWidth = MathF.Max(0, availableX - 290);
|
|
|
|
using (var left = ImRaii.Child("##appearance-left", new Vector2(leftWidth, 0)))
|
|
{
|
|
if (left.Success)
|
|
{
|
|
_picker.Draw();
|
|
ImGui.Spacing();
|
|
_importExport.Draw();
|
|
ImGui.Separator();
|
|
_fonts.Draw();
|
|
ImGui.Separator();
|
|
_color.Draw();
|
|
}
|
|
}
|
|
ImGui.SameLine();
|
|
_preview.Draw();
|
|
}
|
|
}
|