Some additions to select-slides.
This commit is contained in:
1 parent
56eab7b165
commit
830a2a8c9c
1 file changed
+24
-1
@@ -104,6 +104,8 @@ namespace VocaluxeLib.Menu
|
|||||||
public bool Visible = true;
|
public bool Visible = true;
|
||||||
public bool Highlighted;
|
public bool Highlighted;
|
||||||
|
|
||||||
|
public bool SelectionByHover;
|
||||||
|
|
||||||
private bool _ArrowLeftSelected;
|
private bool _ArrowLeftSelected;
|
||||||
private bool _ArrowRightSelected;
|
private bool _ArrowRightSelected;
|
||||||
|
|
||||||
@@ -114,7 +116,7 @@ namespace VocaluxeLib.Menu
|
|||||||
|
|
||||||
private readonly List<SRectF> _ValueBounds = new List<SRectF>();
|
private readonly List<SRectF> _ValueBounds = new List<SRectF>();
|
||||||
|
|
||||||
public readonly bool WithTextures;
|
public bool WithTextures;
|
||||||
|
|
||||||
private int _Selection = -1;
|
private int _Selection = -1;
|
||||||
public int Selection
|
public int Selection
|
||||||
@@ -654,6 +656,27 @@ namespace VocaluxeLib.Menu
|
|||||||
{
|
{
|
||||||
_ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y) && _Selection > 0;
|
_ArrowLeftSelected = CHelper.IsInBounds(RectArrowLeft, x, y) && _Selection > 0;
|
||||||
_ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y) && _Selection < _ValueNames.Count - 1;
|
_ArrowRightSelected = CHelper.IsInBounds(RectArrowRight, x, y) && _Selection < _ValueNames.Count - 1;
|
||||||
|
|
||||||
|
if (SelectionByHover)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < _ValueBounds.Count; i++)
|
||||||
|
{
|
||||||
|
if (CHelper.IsInBounds(_ValueBounds[i], x, y))
|
||||||
|
{
|
||||||
|
int offset = _Selection - _NumVisible / 2;
|
||||||
|
|
||||||
|
if (_ValueNames.Count - _NumVisible - offset < 0)
|
||||||
|
offset = _ValueNames.Count - _NumVisible;
|
||||||
|
|
||||||
|
if (offset < 0)
|
||||||
|
offset = 0;
|
||||||
|
|
||||||
|
Selection = i + offset;
|
||||||
|
_ValueBounds.Clear();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ProcessMouseLBClick(int x, int y)
|
public void ProcessMouseLBClick(int x, int y)
|
||||||
|
|||||||
Reference in new issue
Block a user