watafak
This commit is contained in:
@@ -52,7 +52,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
"bmp"
|
||||
};
|
||||
private const string _imageFileDialogFilter = "Images{.png,.jpg,.jpeg,.webp,.bmp}";
|
||||
private readonly List<int> _tagEditorSelection = [];
|
||||
private readonly List<int> _tagEditorSelection;
|
||||
private int[] _profileTagIds = [];
|
||||
private readonly List<SeStringUtils.SeStringSegment> _tagPreviewSegments = new();
|
||||
private enum ProfileEditorMode
|
||||
@@ -120,6 +120,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
_fileDialogManager = fileDialogManager;
|
||||
_lightlessProfileManager = lightlessProfileManager;
|
||||
_profileTagService = profileTagService;
|
||||
_tagEditorSelection = new List<int>(_maxProfileTags);
|
||||
|
||||
Mediator.Subscribe<GposeStartMessage>(this, (_) => { _wasOpen = IsOpen; IsOpen = false; });
|
||||
Mediator.Subscribe<GposeEndMessage>(this, (_) => IsOpen = _wasOpen);
|
||||
@@ -346,8 +347,8 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
|
||||
SyncProfileState(profile);
|
||||
DrawSection("Profile Preview", scale, () => DrawProfileSnapshot(profile, scale));
|
||||
DrawSection("Profile Image", scale, () => DrawProfileImageControls(profile, scale));
|
||||
DrawSection("Profile Banner", scale, () => DrawProfileBannerControls(profile, scale));
|
||||
DrawSection("Profile Image", scale, () => DrawProfileImageControls(profile));
|
||||
DrawSection("Profile Banner", scale, () => DrawProfileBannerControls(profile));
|
||||
DrawSection("Profile Description", scale, () => DrawProfileDescriptionEditor(profile, scale));
|
||||
DrawSection("Profile Tags", scale, () => DrawProfileTagsEditor(profile, scale));
|
||||
DrawSection("Visibility", scale, () => DrawProfileVisibilityControls());
|
||||
@@ -434,7 +435,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
|
||||
}
|
||||
|
||||
private void DrawProfileImageControls(LightlessUserProfileData profile, float scale)
|
||||
private void DrawProfileImageControls(LightlessUserProfileData profile)
|
||||
{
|
||||
_uiSharedService.DrawNoteLine("# ", UIColors.Get("LightlessBlue"), "Profile pictures must be 512x512 and under 2 MiB.");
|
||||
|
||||
@@ -498,7 +499,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawProfileBannerControls(LightlessUserProfileData profile, float scale)
|
||||
private void DrawProfileBannerControls(LightlessUserProfileData profile)
|
||||
{
|
||||
_uiSharedService.DrawNoteLine("# ", UIColors.Get("LightlessBlue"), "Profile banners must be 840x260 and under 2 MiB.");
|
||||
|
||||
@@ -950,21 +951,6 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
ProfileTagRenderer.RenderTag(tag, rectMin, scale, drawList, style, _tagBackgroundColor, _tagBorderColor, defaultTextColorU32, _tagPreviewSegments, ResolveIconWrap, _logger);
|
||||
}
|
||||
|
||||
private void DrawInfoCell(string displayName, string idLabel, float rowHeight, ImGuiStylePtr style)
|
||||
{
|
||||
var cellStart = ImGui.GetCursorPos();
|
||||
var nameSize = ImGui.CalcTextSize(displayName);
|
||||
var idSize = ImGui.CalcTextSize(idLabel);
|
||||
var totalHeight = nameSize.Y + style.ItemSpacing.Y + idSize.Y;
|
||||
var offsetY = MathF.Max(0f, (rowHeight - totalHeight) * 0.5f) - style.CellPadding.Y;
|
||||
if (offsetY < 0f) offsetY = 0f;
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(cellStart.X + style.CellPadding.X, cellStart.Y + offsetY));
|
||||
ImGui.TextUnformatted(displayName);
|
||||
ImGui.SetCursorPos(new Vector2(cellStart.X + style.CellPadding.X, ImGui.GetCursorPosY() + style.ItemSpacing.Y));
|
||||
ImGui.TextDisabled(idLabel);
|
||||
}
|
||||
|
||||
private void DrawReorderCell(
|
||||
string contextPrefix,
|
||||
int tagId,
|
||||
@@ -1002,8 +988,6 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
var cellStart = ImGui.GetCursorPos();
|
||||
var available = ImGui.GetContentRegionAvail();
|
||||
var buttonHeight = MathF.Max(1f, rowHeight - style.CellPadding.Y * 2f);
|
||||
var hovered = BlendTowardsWhite(baseColor, 0.15f);
|
||||
var active = BlendTowardsWhite(baseColor, 0.3f);
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(cellStart.X, cellStart.Y + style.CellPadding.Y));
|
||||
using (ImRaii.PushId(idSuffix))
|
||||
@@ -1013,7 +997,7 @@ public partial class EditProfileUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
private bool ColoredButton(string label, Vector4 baseColor, Vector2 size, float scale, bool disabled)
|
||||
private static bool ColoredButton(string label, Vector4 baseColor, Vector2 size, float scale, bool disabled)
|
||||
{
|
||||
var style = ImGui.GetStyle();
|
||||
var hovered = BlendTowardsWhite(baseColor, 0.15f);
|
||||
|
||||
Reference in New Issue
Block a user