-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add screen selection tabcontrol to the editor #1323
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
545c375
Update design of EditorMenuBar to match flyte's design more closely
smoogipoo ba8bf6c
Add ScreenSelectionTabControl to EditorMenuBar
smoogipoo 95364d0
No more box background
smoogipoo 8688d63
Update framework
smoogipoo 6bb5210
Remove the parentSizedBox
smoogipoo b2eab1f
Set the hover background colour as dictated by flyte
smoogipoo 775e8ba
Make the background bottom corners look nice with the new hover funct…
smoogipoo eed358a
Merge branch 'master' into editor-screen-selection
peppy 7b43482
Don't use new
smoogipoo 21c6a63
Use using for Description
smoogipoo 7bbfad4
Merge branch 'master' into editor-screen-selection
peppy File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Submodule osu-framework
updated
25 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. | ||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE | ||
|
||
using OpenTK.Graphics; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Extensions.Color4Extensions; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Shapes; | ||
using osu.Framework.Graphics.UserInterface; | ||
using osu.Game.Graphics; | ||
using osu.Game.Graphics.UserInterface; | ||
using OpenTK; | ||
|
||
namespace osu.Game.Screens.Edit.Menus | ||
{ | ||
public class ScreenSelectionTabControl : OsuTabControl<EditorScreenMode> | ||
{ | ||
public ScreenSelectionTabControl() | ||
{ | ||
AutoSizeAxes = Axes.X; | ||
RelativeSizeAxes = Axes.Y; | ||
|
||
TabContainer.RelativeSizeAxes &= ~Axes.X; | ||
TabContainer.AutoSizeAxes = Axes.X; | ||
TabContainer.Padding = new MarginPadding(); | ||
|
||
Add(new Box | ||
{ | ||
Anchor = Anchor.BottomLeft, | ||
Origin = Anchor.BottomLeft, | ||
RelativeSizeAxes = Axes.X, | ||
Height = 1, | ||
Colour = Color4.White.Opacity(0.2f), | ||
}); | ||
} | ||
|
||
[BackgroundDependencyLoader] | ||
private void load(OsuColour colours) | ||
{ | ||
AccentColour = colours.Yellow; | ||
} | ||
|
||
protected override Dropdown<EditorScreenMode> CreateDropdown() => null; | ||
|
||
protected override TabItem<EditorScreenMode> CreateTabItem(EditorScreenMode value) => new TabItem(value); | ||
|
||
private new class TabItem : OsuTabItem | ||
{ | ||
private const float transition_length = 250; | ||
|
||
public TabItem(EditorScreenMode value) | ||
: base(value) | ||
{ | ||
Text.Margin = new MarginPadding(); | ||
Text.Anchor = Anchor.CentreLeft; | ||
Text.Origin = Anchor.CentreLeft; | ||
} | ||
|
||
protected override void OnActivated() | ||
{ | ||
base.OnActivated(); | ||
Bar.ScaleTo(new Vector2(1, 5), transition_length, Easing.OutQuint); | ||
} | ||
|
||
protected override void OnDeactivated() | ||
{ | ||
base.OnDeactivated(); | ||
Bar.ScaleTo(Vector2.One, transition_length, Easing.OutQuint); | ||
} | ||
} | ||
} | ||
|
||
public enum EditorScreenMode | ||
{ | ||
[System.ComponentModel.Description("compose")] | ||
Compose, | ||
[System.ComponentModel.Description("design")] | ||
Design, | ||
[System.ComponentModel.Description("timing")] | ||
Timing, | ||
[System.ComponentModel.Description("song")] | ||
SongSetup | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.