Merge branch 'master' into storyboards

This commit is contained in:
Dean Herbert
2017-05-31 15:59:01 +09:00
committed by GitHub
15 changed files with 58 additions and 32 deletions

View File

@ -37,11 +37,10 @@ namespace osu.Game.Graphics.UserInterface
this.inputManager = inputManager; this.inputManager = inputManager;
} }
protected override bool OnFocus(InputState state) protected override void OnFocus(InputState state)
{ {
var result = base.OnFocus(state); base.OnFocus(state);
BorderThickness = 0; BorderThickness = 0;
return result;
} }
protected override void OnFocusLost(InputState state) protected override void OnFocusLost(InputState state)
@ -56,6 +55,6 @@ namespace osu.Game.Graphics.UserInterface
base.OnFocusLost(state); base.OnFocusLost(state);
} }
public override bool RequestingFocus => HoldFocus; public override bool RequestsFocus => HoldFocus;
} }
} }

View File

@ -72,7 +72,7 @@ namespace osu.Game.Graphics.UserInterface
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
}, },
new OsuSpriteText { Label = new OsuSpriteText {
Text = text, Text = text,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
@ -85,6 +85,7 @@ namespace osu.Game.Graphics.UserInterface
private Color4? accentColour; private Color4? accentColour;
protected readonly TextAwesome Chevron; protected readonly TextAwesome Chevron;
protected readonly OsuSpriteText Label;
protected override void FormatForeground(bool hover = false) protected override void FormatForeground(bool hover = false)
{ {
@ -170,4 +171,4 @@ namespace osu.Game.Graphics.UserInterface
} }
} }
} }
} }

View File

@ -45,11 +45,10 @@ namespace osu.Game.Graphics.UserInterface
BorderColour = colour.Yellow; BorderColour = colour.Yellow;
} }
protected override bool OnFocus(InputState state) protected override void OnFocus(InputState state)
{ {
BorderThickness = 3; BorderThickness = 3;
base.OnFocus(state);
return base.OnFocus(state);
} }
protected override void OnFocusLost(InputState state) protected override void OnFocusLost(InputState state)

View File

@ -167,11 +167,15 @@ namespace osu.Game.Overlays
} }
} }
protected override bool OnFocus(InputState state) public override bool AcceptsFocus => true;
protected override bool OnClick(InputState state) => true;
protected override void OnFocus(InputState state)
{ {
//this is necessary as inputTextBox is masked away and therefore can't get focus :( //this is necessary as inputTextBox is masked away and therefore can't get focus :(
InputManager.ChangeFocus(inputTextBox); InputManager.ChangeFocus(inputTextBox);
return false; base.OnFocus(state);
} }
protected override void PopIn() protected override void PopIn()

View File

@ -98,7 +98,7 @@ namespace osu.Game.Overlays
new ScrollContainer new ScrollContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
ScrollDraggerVisible = false, ScrollbarVisible = false,
Children = new Drawable[] Children = new Drawable[]
{ {
new FillFlowContainer new FillFlowContainer
@ -187,10 +187,14 @@ namespace osu.Game.Overlays
panels.Children = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b)); panels.Children = BeatmapSets.Select(b => displayStyle == PanelDisplayStyle.Grid ? (DirectPanel)new DirectGridPanel(b) { Width = 400 } : new DirectListPanel(b));
} }
protected override bool OnFocus(InputState state) public override bool AcceptsFocus => true;
protected override bool OnClick(InputState state) => true;
protected override void OnFocus(InputState state)
{ {
InputManager.ChangeFocus(filter.Search); InputManager.ChangeFocus(filter.Search);
return false; base.OnFocus(state);
} }
protected override void PopIn() protected override void PopIn()

View File

@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Music
private bool matching = true; private bool matching = true;
public bool MatchingCurrentFilter public bool MatchingFilter
{ {
set set
{ {

View File

@ -22,7 +22,7 @@ namespace osu.Game.Overlays.Music
} }
} }
public BeatmapSetInfo FirstVisibleSet => items.Children.FirstOrDefault(i => i.MatchingCurrentFilter)?.BeatmapSetInfo; public BeatmapSetInfo FirstVisibleSet => items.Children.FirstOrDefault(i => i.MatchingFilter)?.BeatmapSetInfo;
private void itemSelected(BeatmapSetInfo b) private void itemSelected(BeatmapSetInfo b)
{ {
@ -75,7 +75,7 @@ namespace osu.Game.Overlays.Music
private class ItemSearchContainer : FillFlowContainer<PlaylistItem>, IHasFilterableChildren private class ItemSearchContainer : FillFlowContainer<PlaylistItem>, IHasFilterableChildren
{ {
public string[] FilterTerms => new string[] { }; public string[] FilterTerms => new string[] { };
public bool MatchingCurrentFilter public bool MatchingFilter
{ {
set set
{ {

View File

@ -166,10 +166,14 @@ namespace osu.Game.Overlays.Settings.Sections.General
if (form != null) inputManager.ChangeFocus(form); if (form != null) inputManager.ChangeFocus(form);
} }
protected override bool OnFocus(InputState state) public override bool AcceptsFocus => true;
protected override bool OnClick(InputState state) => true;
protected override void OnFocus(InputState state)
{ {
if (form != null) inputManager.ChangeFocus(form); if (form != null) inputManager.ChangeFocus(form);
return base.OnFocus(state); base.OnFocus(state);
} }
private class LoginForm : FillFlowContainer private class LoginForm : FillFlowContainer
@ -235,10 +239,13 @@ namespace osu.Game.Overlays.Settings.Sections.General
}; };
} }
protected override bool OnFocus(InputState state) public override bool AcceptsFocus => true;
protected override bool OnClick(InputState state) => true;
protected override void OnFocus(InputState state)
{ {
Schedule(() => { inputManager.ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); }); Schedule(() => { inputManager.ChangeFocus(string.IsNullOrEmpty(username.Text) ? username : password); });
return base.OnFocus(state);
} }
} }
@ -338,8 +345,8 @@ namespace osu.Game.Overlays.Settings.Sections.General
{ {
public UserDropdownMenuItem(string text, UserAction current) : base(text, current) public UserDropdownMenuItem(string text, UserAction current) : base(text, current)
{ {
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = UserDropdownHeader.LABEL_LEFT_MARGIN, Right = 5 }; Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 5 };
Chevron.Margin = new MarginPadding { Left = 2, Right = 3 }; Label.Margin = new MarginPadding { Left = UserDropdownHeader.LABEL_LEFT_MARGIN - 11 };
CornerRadius = 5; CornerRadius = 5;
} }
} }

View File

@ -55,7 +55,7 @@ namespace osu.Game.Overlays.Settings
public string[] FilterTerms => new[] { LabelText }; public string[] FilterTerms => new[] { LabelText };
public bool MatchingCurrentFilter public bool MatchingFilter
{ {
set set
{ {

View File

@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Settings
public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>(); public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
public string[] FilterTerms => new[] { Header }; public string[] FilterTerms => new[] { Header };
public bool MatchingCurrentFilter public bool MatchingFilter
{ {
set set
{ {

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Settings
public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>(); public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
public string[] FilterTerms => new[] { Header }; public string[] FilterTerms => new[] { Header };
public bool MatchingCurrentFilter public bool MatchingFilter
{ {
set set
{ {

View File

@ -138,10 +138,14 @@ namespace osu.Game.Overlays
InputManager.ChangeFocus(null); InputManager.ChangeFocus(null);
} }
protected override bool OnFocus(InputState state) public override bool AcceptsFocus => true;
protected override bool OnClick(InputState state) => true;
protected override void OnFocus(InputState state)
{ {
InputManager.ChangeFocus(searchTextBox); InputManager.ChangeFocus(searchTextBox);
return false; base.OnFocus(state);
} }
private class SettingsSectionsContainer : SectionsContainer private class SettingsSectionsContainer : SectionsContainer
@ -159,7 +163,7 @@ namespace osu.Game.Overlays
public SettingsSectionsContainer() public SettingsSectionsContainer()
{ {
ScrollContainer.ScrollDraggerVisible = false; ScrollContainer.ScrollbarVisible = false;
Add(headerBackground = new Box Add(headerBackground = new Box
{ {
Colour = Color4.Black, Colour = Color4.Black,

View File

@ -131,7 +131,15 @@ namespace osu.Game.Screens
Background.Exit(); Background.Exit();
} }
return base.OnExiting(next); if (base.OnExiting(next))
return true;
// while this is not necessary as we are constructing our own bindable, there are cases where
// the GC doesn't run as fast as expected and this is triggered post-exit.
// added to resolve https://github.com/ppy/osu/issues/829
beatmap.ValueChanged -= OnBeatmapChanged;
return false;
} }
} }
} }

View File

@ -74,7 +74,7 @@ namespace osu.Game.Screens.Select.Leaderboards
scrollContainer = new ScrollContainer scrollContainer = new ScrollContainer
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
ScrollDraggerVisible = false, ScrollbarVisible = false,
Children = new Drawable[] Children = new Drawable[]
{ {
scrollFlow = new FillFlowContainer<LeaderboardScore> scrollFlow = new FillFlowContainer<LeaderboardScore>