/*--------------------------------------------------------------------------------------------*/ public void Update() { vMainAlpha = 1; if (!vItemState.Item.IsEnabled || !vItemState.Item.AreParentsEnabled) { vMainAlpha *= 0.333f; } ISelectableItem selItem = (vItemState.Item as ISelectableItem); float high = vItemState.MaxHighlightProgress; bool showEdge = (vItemState.IsNearestHighlight && !vItemState.IsSelectionPrevented && selItem != null && selItem.AllowSelection); float edge = (showEdge ? high : 0); float select = 1 - (float)Math.Pow(1 - vItemState.SelectionProgress, 1.5f); float selectAlpha = select; if (selItem != null && selItem.IsStickySelected) { selectAlpha = 1; } Color colBg = vVisualSettings.BackgroundColor; Color colEdge = vVisualSettings.EdgeColor; Color colHigh = vVisualSettings.HighlightColor; Color colSel = vVisualSettings.SelectionColor; colBg.a *= vMainAlpha; colEdge.a *= edge * vMainAlpha; colHigh.a *= high * vMainAlpha; colSel.a *= selectAlpha * vMainAlpha; vHoverRect.UpdateBackground(colBg); vHoverRect.UpdateEdge(colEdge); vHoverRect.UpdateHighlight(colHigh, high); vHoverRect.UpdateSelect(colSel, select); vLabel.Alpha = vMainAlpha; vLabel.FontName = vVisualSettings.TextFont; vLabel.FontSize = vVisualSettings.TextSize; vLabel.Color = vVisualSettings.TextColor; vLabel.Label = vItemState.Item.Label; }
/*--------------------------------------------------------------------------------------------*/ public virtual void Update() { vMainAlpha = vPanelState.DisplayStrength * vLayoutState.DisplayStrength; if (!vItemState.Item.IsEnabled || !vItemState.Item.IsAncestryEnabled) { vMainAlpha *= 0.333f; } ISelectableItem selItem = (vItemState.Item as ISelectableItem); float high = vItemState.MaxHighlightProgress; bool showEdge = DisplayUtil.IsEdgeVisible(vItemState); float edge = (showEdge ? high : 0); float select = 1 - (float)Math.Pow(1 - vItemState.SelectionProgress, 1.5f); float selectAlpha = select; if (selItem != null && selItem.IsStickySelected) { selectAlpha = 1; } Color colBg = vSettings.BackgroundColor; Color colEdge = vSettings.EdgeColor; Color colHigh = vSettings.HighlightColor; Color colSel = vSettings.SelectionColor; colBg.a *= vMainAlpha; colEdge.a *= edge * vMainAlpha; colHigh.a *= high * vMainAlpha; colSel.a *= selectAlpha * vMainAlpha; vHoverRect.UpdateBackground(colBg); vHoverRect.UpdateEdge(colEdge); vHoverRect.UpdateHighlight(colHigh, high); vHoverRect.UpdateSelect(colSel, select); vLabel.Alpha = vMainAlpha; vLabel.FontName = vSettings.TextFont; vLabel.FontSize = vSettings.TextSize; vLabel.Color = vSettings.TextColor; vLabel.Label = vItemState.Item.Label; }