Merge pull request #5628 from pavlos256/smooth-scrolling

Add smooth scrolling to the ScrollPanelWidget
This commit is contained in:
Paul Chote
2014-06-23 21:46:50 +12:00
4 changed files with 95 additions and 39 deletions

View File

@@ -161,7 +161,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var scrolledToBottom = chatScrollPanel.ScrolledToBottom;
chatScrollPanel.AddChild(template);
if (scrolledToBottom)
chatScrollPanel.ScrollToBottom();
chatScrollPanel.ScrollToBottom(smooth: true);
Sound.PlayNotification(modRules, null, "Sounds", "ChatLine", null);
}

View File

@@ -568,7 +568,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
var scrolledToBottom = chatPanel.ScrolledToBottom;
chatPanel.AddChild(template);
if (scrolledToBottom)
chatPanel.ScrollToBottom();
chatPanel.ScrollToBottom(smooth: true);
Sound.PlayNotification(modRules, null, "Sounds", "ChatLine", null);
}

View File

@@ -76,7 +76,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{
var uid = visibleMaps.Random(Game.CosmeticRandom);
selectedUid = uid;
scrollpanel.ScrollToItem(uid);
scrollpanel.ScrollToItem(uid, smooth: true);
};
randomMapButton.IsDisabled = () => visibleMaps == null || visibleMaps.Count == 0;
}