mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Added two new helpers, one for PushItemWidth and the other for PushTextWrapPos.
This commit is contained in:
parent
fdfdee1fcb
commit
0acab6935a
1 changed files with 25 additions and 1 deletions
|
|
@ -77,6 +77,30 @@ public static partial class ImRaii
|
|||
return new EndUnconditionally(ImGui.EndTooltip, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pushes the item width for the next widget and returns an <c>IDisposable</c> that pops
|
||||
/// the width when done.
|
||||
/// </summary>
|
||||
/// <param name="width">The width to set the next widget to.</param>
|
||||
/// <returns>An <see cref="IDisposable"/> for use in a <c>using</c> statement.</returns>
|
||||
public static IEndObject ItemWidth(float width)
|
||||
{
|
||||
ImGui.PushItemWidth(width);
|
||||
return new EndUnconditionally(ImGui.PopItemWidth, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pushes the item wrapping width for the next string written and returns an <c>IDisposable</c>
|
||||
/// that pops the wrap width when done.
|
||||
/// </summary>
|
||||
/// <param name="pos">The wrap width to set the next text written to.</param>
|
||||
/// <returns>An <see cref="IDisposable"/> for use in a <c>using</c> statement.</returns>
|
||||
public static IEndObject TextWrapPos(float pos)
|
||||
{
|
||||
ImGui.PushTextWrapPos(pos);
|
||||
return new EndUnconditionally(ImGui.PopTextWrapPos, true);
|
||||
}
|
||||
|
||||
public static IEndObject ListBox(string label)
|
||||
=> new EndConditionally(ImGui.EndListBox, ImGui.BeginListBox(label));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue