From 6ea65009c402f5517d7b8db5bc2def862631e727 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 12 May 2017 14:22:11 +0900 Subject: [PATCH] Initial design update pass --- osu.Game/Overlays/ChatOverlay.cs | 89 ++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 27 deletions(-) diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index a9dc915c6b..7f74750873 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -29,7 +29,7 @@ namespace osu.Game.Overlays { public class ChatOverlay : FocusedOverlayContainer, IOnlineComponent { - private const float textbox_height = 40; + private const float textbox_height = 60; private ScheduledDelegate messageRequest; @@ -43,6 +43,8 @@ namespace osu.Game.Overlays public const float DEFAULT_HEIGHT = 0.4f; + private const float tab_area_height = 50; + private GetMessagesRequest fetchReq; private readonly OsuTabControl channelTabs; @@ -57,45 +59,78 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomLeft; Origin = Anchor.BottomLeft; + const float padding = 5; + Children = new Drawable[] { - channelTabs = new OsuTabControl + new Container { + Name = @"tabs area", RelativeSizeAxes = Axes.X, - Height = 20, - }, - new Box - { - Depth = float.MaxValue, - RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, - Alpha = 0.9f, - }, - currentChannelContainer = new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = 25, Bottom = textbox_height + 5 }, + Height = tab_area_height, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.8f, + }, + channelTabs = new OsuTabControl + { + RelativeSizeAxes = Axes.Both, + }, + } }, new Container { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - RelativeSizeAxes = Axes.X, - Height = textbox_height, - Padding = new MarginPadding(5), + Name = @"chat area", + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = tab_area_height }, Children = new Drawable[] { - inputTextBox = new FocusedTextBox + new Box { RelativeSizeAxes = Axes.Both, - Height = 1, - PlaceholderText = "type your message", - Exit = () => State = Visibility.Hidden, - OnCommit = postMessage, - HoldFocus = true, + Colour = OsuColour.FromHex(@"17292e"), + }, + currentChannelContainer = new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding + { + Top = padding, + Bottom = textbox_height + padding + }, + }, + new Container + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.X, + Height = textbox_height, + Padding = new MarginPadding + { + Top = padding * 2, + Bottom = padding * 2, + Left = ChatLine.LEFT_PADDING + padding * 2, + Right = padding * 2, + }, + Children = new Drawable[] + { + inputTextBox = new FocusedTextBox + { + RelativeSizeAxes = Axes.Both, + Height = 1, + PlaceholderText = "type your message", + Exit = () => State = Visibility.Hidden, + OnCommit = postMessage, + HoldFocus = true, + } + } } } - } + }, }; channelTabs.Current.ValueChanged += newChannel => CurrentChannel = newChannel;