Proper mouseover support.

This commit is contained in:
Paul Chote
2011-07-04 04:58:56 +12:00
parent 1114293035
commit e9d67860de
10 changed files with 47 additions and 21 deletions

View File

@@ -21,6 +21,7 @@ namespace OpenRA.Widgets
{
IsVisible = () => false;
VisualHeight = 0;
IgnoreChildMouseOver = true;
}
protected ScrollItemWidget(ScrollItemWidget other)
@@ -28,6 +29,7 @@ namespace OpenRA.Widgets
{
IsVisible = () => false;
VisualHeight = 0;
IgnoreChildMouseOver = true;
}
public Func<bool> IsSelected = () => false;
@@ -35,7 +37,7 @@ namespace OpenRA.Widgets
public override void Draw()
{
var state = IsSelected() ? "scrollitem-selected" :
RenderBounds.Contains(Viewport.LastMousePos) ? "scrollitem-hover" :
Widget.MouseOverWidget == this ? "scrollitem-hover" :
null;
if (state != null)