Add design color to preview in combos.

This commit is contained in:
Ottermandias 2024-01-16 21:32:23 +01:00
parent c245b30eaa
commit 13bf83b2b7

View file

@ -81,9 +81,13 @@ public abstract class DesignComboBase : FilterComboCache<Tuple<Design, string>>,
{
_currentDesign = currentDesign;
InnerWidth = 400 * ImGuiHelpers.GlobalScale;
var name = label ?? "Select Design Here...";
var ret = Draw("##design", name, string.Empty, width, ImGui.GetTextLineHeightWithSpacing())
&& CurrentSelection != null;
var name = label ?? "Select Design Here...";
bool ret;
using (_ = currentDesign != null ? ImRaii.PushColor(ImGuiCol.Text, _designColors.GetColor(currentDesign)) : null)
{
ret = Draw("##design", name, string.Empty, width, ImGui.GetTextLineHeightWithSpacing())
&& CurrentSelection != null;
}
if (currentDesign != null)
{
@ -195,7 +199,6 @@ public sealed class RevertDesignCombo : DesignComboBase, IDisposable
_autoDesignManager = autoDesignManager;
}
public void Draw(AutoDesignSet set, AutoDesign? design, int autoDesignIndex)
{
if (!Draw(design?.Design, design?.Name(Incognito), ImGui.GetContentRegionAvail().X))