Fix hover for ra dropdowns (also scrollpanels)

This commit is contained in:
Paul Chote
2011-05-22 17:45:10 +12:00
parent 325fd509b0
commit 53426030ee
4 changed files with 15 additions and 7 deletions

View File

@@ -15,9 +15,7 @@ using OpenRA.Graphics;
namespace OpenRA.Widgets
{
public class ScrollItemWidget : ButtonWidget
{
public int EnableHover = ChromeMetrics.GetInt("EnableHover");
{
public ScrollItemWidget()
: base()
{
@@ -37,7 +35,7 @@ namespace OpenRA.Widgets
public override void DrawInner()
{
var state = IsSelected() ? "scrollitem-selected" :
EnableHover == 1 && RenderBounds.Contains(Viewport.LastMousePos) ? "scrollitem-hover" :
RenderBounds.Contains(Viewport.LastMousePos) ? "scrollitem-hover" :
null;
if (state != null)

View File

@@ -3,4 +3,3 @@
Metrics:
ButtonDepth: 0
ButtonFont: Bold
EnableHover: 1

View File

@@ -422,8 +422,20 @@ checkbox-pressed: dialog.png
corner-bl: 640,82,1,1
corner-br: 722,82,1,1
# A copy of dialog2
# A copy of dialog3
scrollitem-selected: dialog.png
background: 641,1,126,126
border-r: 767,1,1,126
border-l: 640,1,1,126
border-b: 641,127,126,1
border-t: 641,0,126,1
corner-tl: 640,0,1,1
corner-tr: 722,0,1,1
corner-bl: 640,82,1,1
corner-br: 722,82,1,1
# A copy of dialog2
scrollitem-hover: dialog.png
background: 513,1,126,126
border-r: 639,1,1,126
border-l: 512,1,1,126

View File

@@ -3,4 +3,3 @@
Metrics:
ButtonDepth: 1
ButtonFont: Regular
EnableHover: 0