Remove some duplication from widgets that draw fake buttons.

This commit is contained in:
Paul Chote
2011-05-17 13:14:48 +12:00
parent b3f9725872
commit 14af766427
4 changed files with 21 additions and 35 deletions

View File

@@ -197,12 +197,7 @@ namespace OpenRA.Widgets
WidgetUtils.DrawPanel("slider-track", trackRect);
// Thumb
var state = IsDisabled() ? "button-disabled" :
isMoving ? "button-pressed" :
tr.Contains(Viewport.LastMousePos) ? "button-hover" :
"button";
WidgetUtils.DrawPanel(state, tr);
ButtonWidget.DrawBackground(tr, IsDisabled(), isMoving, tr.Contains(Viewport.LastMousePos));
}
}
}