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

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

View File

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

View File

@@ -422,8 +422,20 @@ checkbox-pressed: dialog.png
corner-bl: 640,82,1,1 corner-bl: 640,82,1,1
corner-br: 722,82,1,1 corner-br: 722,82,1,1
# A copy of dialog2 # A copy of dialog3
scrollitem-selected: dialog.png 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 background: 513,1,126,126
border-r: 639,1,1,126 border-r: 639,1,1,126
border-l: 512,1,1,126 border-l: 512,1,1,126

View File

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