Make combos start from preview selection if possible.

This commit is contained in:
Ottermandias 2025-05-23 10:47:47 +02:00
parent f192c17c9b
commit 74674cfa0c
3 changed files with 2 additions and 10 deletions

View file

@ -37,7 +37,7 @@ public partial class CustomizationDrawer
using var dragDropTarget = ImUtf8.DragDropTarget();
if (!dragDropTarget.Success || !dragDropTarget.IsDropping("##colorDragDrop"u8))
return;
var idx = _set.DataByValue(_draggedColorType, _draggedColorValue, out var draggedData, _customize.Face);
var bestMatch = _draggedColorValue;
if (draggedData.HasValue)

View file

@ -1,7 +1,6 @@
using Glamourer.Designs;
using ImGuiNET;
using OtterGui;
using OtterGui.Extensions;
using OtterGui.Raii;
using OtterGui.Widgets;
@ -13,13 +12,6 @@ public sealed class DesignColorCombo(DesignColors _designColors, bool _skipAutom
: _designColors.Keys.OrderBy(k => k).Prepend(DesignColors.AutomaticName),
MouseWheelType.Control, Glamourer.Log)
{
protected override void OnMouseWheel(string preview, ref int current, int steps)
{
if (CurrentSelectionIdx < 0)
CurrentSelectionIdx = Items.IndexOf(preview);
base.OnMouseWheel(preview, ref current, steps);
}
protected override bool DrawSelectable(int globalIdx, bool selected)
{
var isAutomatic = !_skipAutomatic && globalIdx == 0;

@ -1 +1 @@
Subproject commit 9aeda9a892d9b971e32b10db21a8daf9c0b9ee53
Subproject commit 421874a12540b7f8c1279dcc6a92e895a94d2fbc