Move common width definition to base class

This commit is contained in:
Dean Herbert 2017-11-14 19:03:50 +09:00
parent f96f7e696d
commit 44671ad9cb
3 changed files with 3 additions and 2 deletions

View File

@ -29,6 +29,7 @@ public class DirectGridPanel : DirectPanel
public DirectGridPanel(BeatmapSetInfo beatmap) : base(beatmap)
{
Width = 400;
Height = 140 + vertical_padding; //full height of all the elements plus vertical padding (autosize uses the image)
}

View File

@ -222,7 +222,7 @@ private void recreatePanels(PanelDisplayStyle displayStyle)
switch (displayStyle)
{
case PanelDisplayStyle.Grid:
return new DirectGridPanel(b) { Width = 400 };
return new DirectGridPanel(b);
default:
return new DirectListPanel(b);
}

View File

@ -52,7 +52,7 @@ protected override void ShowMore()
if (!s.OnlineBeatmapSetID.HasValue)
continue;
var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets)) { Width = 400 };
var panel = new DirectGridPanel(s.ToBeatmapSet(Rulesets));
ItemsContainer.Add(panel);
panel.PreviewPlaying.ValueChanged += isPlaying =>